8.3
general documentation
cs_syr_coupling.h
Go to the documentation of this file.
1#ifndef __CS_SYR_COUPLING_H__
2#define __CS_SYR_COUPLING_H__
3
4/*============================================================================
5 * SYRTHES coupling
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2024 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30/*----------------------------------------------------------------------------
31 * Standard C library headers
32 *----------------------------------------------------------------------------*/
33
34/*----------------------------------------------------------------------------
35 * Local headers
36 *----------------------------------------------------------------------------*/
37
38#include "fvm_defs.h"
39
40#include "cs_base.h"
41#include "cs_zone.h"
42
43/*----------------------------------------------------------------------------*/
44
46
47/*=============================================================================
48 * Local Macro Definitions
49 *============================================================================*/
50
51/*============================================================================
52 * Structure definition
53 *============================================================================*/
54
55/*============================================================================
56 * Global variables definition
57 *============================================================================*/
58
59/*============================================================================
60 * Public function prototypes
61 *============================================================================*/
62
63/*----------------------------------------------------------------------------
64 * Define new SYRTHES coupling.
65 *
66 * In the case of a single code_saturne and single SYRTHES instance, the
67 * syrthes_name argument is ignored.
68 *
69 * In case of multiple couplings, a coupling will be matched with available
70 * SYRTHES instances based on the syrthes_name argument.
71 *
72 * arguments:
73 * syrthes_name <-- name of SYRTHES instance
74 * boundary_criteria <-- boundary face selection criteria, or NULL
75 * volume_criteria <-- volume cell selection criteria, or NULL
76 * projection_axis <-- 'x', 'y', or 'y' for 2D projection axis (case
77 * independent), or ' ' for standard 3D coupling
78 * allow_nonmatching <-- allow nearest-neighbor mapping where matching
79 * within tolerance is not available
80 * tolerance <-- addition to local extents of each element
81 * extent = base_extent * (1 + tolerance)
82 * verbosity <-- verbosity level
83 * visualization <-- visualization output level (0 or 1)
84 *----------------------------------------------------------------------------*/
85
86void
87cs_syr_coupling_define(const char *syrthes_name,
88 const char *boundary_criteria,
89 const char *volume_criteria,
90 char projection_axis,
91 bool allow_nonmatching,
92 float tolerance,
93 int verbosity,
94 int visualization);
95
96/*----------------------------------------------------------------------------*/
104/*----------------------------------------------------------------------------*/
105
106void
107cs_syr_coupling_add_zone(const char *syrthes_name,
108 const cs_zone_t *z);
109
110/*----------------------------------------------------------------------------
111 * Initialize SYRTHES couplings.
112 *
113 * This function may be called once all couplings have been defined,
114 * and it will match defined couplings with available applications.
115 *----------------------------------------------------------------------------*/
116
117void
119
120/*----------------------------------------------------------------------------
121 * Finalize all SYRTHES couplings.
122 *----------------------------------------------------------------------------*/
123
124void
126
127/*----------------------------------------------------------------------------
128 * Return number of SYRTHES couplings.
129 *
130 * return:
131 * number of SYRTHES couplings defined
132 *----------------------------------------------------------------------------*/
133
134int
136
137/*----------------------------------------------------------------------------
138 * Set conservativity forcing flag to True (1) or False (0) for all defined
139 * SYRTHES couplings
140 *
141 * parameter:
142 * flag <-- Conservativity forcing flag to set
143 *----------------------------------------------------------------------------*/
144
145void
147
148/*----------------------------------------------------------------------------
149 * Set explicit treatment for the source terms in SYRTHES volume couplings
150 *----------------------------------------------------------------------------*/
151
152void
154
155/*----------------------------------------------------------------------------*/
180/*----------------------------------------------------------------------------*/
181
182void
184 int flag);
185
186/*----------------------------------------------------------------------------*/
190/*----------------------------------------------------------------------------*/
191
192void
194
195/*----------------------------------------------------------------------------*/
199/*----------------------------------------------------------------------------*/
200
201void
203
204/*----------------------------------------------------------------------------*/
212/*----------------------------------------------------------------------------*/
213
214int
215cs_syr_coupling_is_surf(int cpl_id);
216
217/*----------------------------------------------------------------------------*/
226/*----------------------------------------------------------------------------*/
227
228void
230 int bc_type[]);
231
232/*----------------------------------------------------------------------------*/
239/*----------------------------------------------------------------------------*/
240
241void
243 cs_real_t v_fluid[]);
244
245/*----------------------------------------------------------------------------*/
249/*----------------------------------------------------------------------------*/
250
251void
253
254/*----------------------------------------------------------------------------*/
263/*----------------------------------------------------------------------------*/
264
265void
267 cs_real_t st_exp[],
268 cs_real_t st_imp[]);
269
270/*----------------------------------------------------------------------------*/
279/*----------------------------------------------------------------------------*/
280
282cs_syr_coupling_n_elts(int cpl_id,
283 int mode);
284
285/*----------------------------------------------------------------------------*/
293/*----------------------------------------------------------------------------*/
294
295void
296cs_syr_coupling_elt_ids(int cpl_id,
297 int mode,
298 cs_lnum_t elt_ids[]);
299
300/*----------------------------------------------------------------------------*/
308/*----------------------------------------------------------------------------*/
309
310void
312 int mode,
313 cs_real_t t_solid[]);
314
315/*----------------------------------------------------------------------------*/
325/*----------------------------------------------------------------------------*/
326
327void
329 int mode,
330 const cs_lnum_t elt_ids[],
331 cs_real_t t_fluid[],
332 cs_real_t h_fluid[]);
333
334/*----------------------------------------------------------------------------*/
335/*
336 * \brief Receive coupling variables (Tf,hf) from code_saturne
337 * (called by CDO thermal solver).
338 */
339/*----------------------------------------------------------------------------*/
340
341void
343(
344 int cpl_id,
345 int mode,
346 const cs_lnum_t elt_ids[],
347 cs_real_t t_fluid[],
348 cs_real_t h_fluid[]
349);
350
351/*----------------------------------------------------------------------------*/
352/*
353 * \brief Send coupling variables (Ts) to code_saturne
354 * (called by CDO thermal solver).
355 */
356/*----------------------------------------------------------------------------*/
357
358void
360(
361 int cpl_id,
362 int mode,
363 const cs_real_t t_solid[]
364);
365
366/*----------------------------------------------------------------------------*/
367/*
368 * \brief Check if a boundary zone is coupled.
369 *
370 * \return 1 if coupled 0 if not.
371 */
372/*----------------------------------------------------------------------------*/
373
374int
376(
377 const cs_zone_t *z
378);
379
380/*----------------------------------------------------------------------------*/
381
383
384#endif /* __CS_SYR_COUPLING_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
int cs_syr_coupling_is_bnd_zone_coupled(const cs_zone_t *z)
Check if a boundary zone is coupled.
Definition: cs_syr_coupling.cpp:3358
void cs_syr_coupling_set_explicit_treatment(void)
Definition: cs_syr_coupling.cpp:2378
void cs_syr_coupling_log_setup(void)
Log SYRTHES coupling setup information.
Definition: cs_syr_coupling.cpp:2442
void cs_syr_coupling_all_init(void)
Definition: cs_syr_coupling.cpp:2301
void cs_syr_coupling_define(const char *syrthes_name, const char *boundary_criteria, const char *volume_criteria, char projection_axis, bool allow_nonmatching, float tolerance, int verbosity, int visualization)
Define new SYRTHES coupling.
Definition: cs_syr_coupling.cpp:2148
void cs_syr_coupling_exchange_volume(void)
Exchange volume values relative to a SYRTHES coupling.
Definition: cs_syr_coupling.cpp:2893
cs_lnum_t cs_syr_coupling_n_elts(int cpl_id, int mode)
Get number of coupled elements with SYRTHES.
Definition: cs_syr_coupling.cpp:3087
void cs_syr_coupling_recv_tf_hf(int cpl_id, int mode, const cs_lnum_t elt_ids[], cs_real_t t_fluid[], cs_real_t h_fluid[])
Receive coupling variables (Tf,hf) from code_saturne (called by CDO thermal solver).
Definition: cs_syr_coupling.cpp:3230
void cs_syr_coupling_elt_ids(int cpl_id, int mode, cs_lnum_t elt_ids[])
Get local ids of elements coupled with SYRTHES.
Definition: cs_syr_coupling.cpp:3130
int cs_syr_coupling_n_couplings(void)
Definition: cs_syr_coupling.cpp:2353
void cs_syr_coupling_add_zone(const char *syrthes_name, const cs_zone_t *z)
Associated a zone to a defined SYRTHES coupling.
Definition: cs_syr_coupling.cpp:2256
void cs_syr_coupling_set_conservativity(int flag)
Definition: cs_syr_coupling.cpp:2367
int cs_syr_coupling_is_surf(int cpl_id)
Check if the given SYRTHES coupling number is a surface couplings.
Definition: cs_syr_coupling.cpp:2533
void cs_syr_coupling_send_tsolid(int cpl_id, int mode, const cs_real_t t_solid[])
Send coupling variables (Ts) to code_saturne (called by CDO thermal solver).
Definition: cs_syr_coupling.cpp:3300
void cs_syr_coupling_set_time_sync_flag(int cpl_id, int flag)
Set time synchronization mode for a given SYRTHES coupling.
Definition: cs_syr_coupling.cpp:2411
void cs_syr_coupling_send_tf_hf(int cpl_id, int mode, const cs_lnum_t elt_ids[], cs_real_t t_fluid[], cs_real_t h_fluid[])
Send coupling variables to SYRTHES.
Definition: cs_syr_coupling.cpp:3202
void cs_syr_coupling_recv_boundary(const int nvar, int bc_type[])
Read boundary field/variable values relative to a SYRTHES coupling.
Definition: cs_syr_coupling.cpp:2562
void cs_syr_coupling_all_finalize(void)
Definition: cs_syr_coupling.cpp:2340
void cs_syr_coupling_init_meshes(void)
Create coupled meshes and setup PLE locator for Syrthes couplings.
Definition: cs_syr_coupling.cpp:2512
void cs_syr_coupling_volume_source_terms(int field_id, cs_real_t st_exp[], cs_real_t st_imp[])
Compute the source term (implicit and/or explicit part) for a volume coupling with SYRTHES.
Definition: cs_syr_coupling.cpp:2996
void cs_syr_coupling_send_boundary(const cs_real_t h_wall[], cs_real_t v_fluid[])
Send field/variable values relative to a SYRTHES coupling.
Definition: cs_syr_coupling.cpp:2696
void cs_syr_coupling_recv_tsolid(int cpl_id, int mode, cs_real_t t_solid[])
Receive coupling variables from SYRTHES.
Definition: cs_syr_coupling.cpp:3172
integer, save nvar
number of solved variables (must be lower than nvarmx)
Definition: dimens.f90:42
Definition: cs_zone.h:55