8.1
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-2023 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 
86 void
87 cs_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 
106 void
107 cs_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 
117 void
119 
120 /*----------------------------------------------------------------------------
121  * Finalize all SYRTHES couplings.
122  *----------------------------------------------------------------------------*/
123 
124 void
126 
127 /*----------------------------------------------------------------------------
128  * Return number of SYRTHES couplings.
129  *
130  * return:
131  * number of SYRTHES couplings defined
132  *----------------------------------------------------------------------------*/
133 
134 int
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 
145 void
147 
148 /*----------------------------------------------------------------------------
149  * Set explicit treatment for the source terms in SYRTHES volume couplings
150  *----------------------------------------------------------------------------*/
151 
152 void
154 
155 /*----------------------------------------------------------------------------*/
180 /*----------------------------------------------------------------------------*/
181 
182 void
184  int flag);
185 
186 /*----------------------------------------------------------------------------*/
190 /*----------------------------------------------------------------------------*/
191 
192 void
194 
195 /*----------------------------------------------------------------------------*/
199 /*----------------------------------------------------------------------------*/
200 
201 void
203 
204 /*----------------------------------------------------------------------------*/
212 /*----------------------------------------------------------------------------*/
213 
214 int
215 cs_syr_coupling_is_surf(int cpl_id);
216 
217 /*----------------------------------------------------------------------------*/
226 /*----------------------------------------------------------------------------*/
227 
228 void
230  int bc_type[]);
231 
232 /*----------------------------------------------------------------------------*/
239 /*----------------------------------------------------------------------------*/
240 
241 void
243  cs_real_t v_fluid[]);
244 
245 /*----------------------------------------------------------------------------*/
249 /*----------------------------------------------------------------------------*/
250 
251 void
253 
254 /*----------------------------------------------------------------------------*/
263 /*----------------------------------------------------------------------------*/
264 
265 void
267  cs_real_t st_exp[],
268  cs_real_t st_imp[]);
269 
270 /*----------------------------------------------------------------------------*/
279 /*----------------------------------------------------------------------------*/
280 
281 cs_lnum_t
282 cs_syr_coupling_n_elts(int cpl_id,
283  int mode);
284 
285 /*----------------------------------------------------------------------------*/
293 /*----------------------------------------------------------------------------*/
294 
295 void
296 cs_syr_coupling_elt_ids(int cpl_id,
297  int mode,
298  cs_lnum_t elt_ids[]);
299 
300 /*----------------------------------------------------------------------------*/
308 /*----------------------------------------------------------------------------*/
309 
310 void
311 cs_syr_coupling_recv_tsolid(int cpl_id,
312  int mode,
313  cs_real_t t_solid[]);
314 
315 /*----------------------------------------------------------------------------*/
325 /*----------------------------------------------------------------------------*/
326 
327 void
328 cs_syr_coupling_send_tf_hf(int cpl_id,
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 
337 
338 #endif /* __CS_SYR_COUPLING_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define END_C_DECLS
Definition: cs_defs.h:515
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
void cs_syr_coupling_set_explicit_treatment(void)
Definition: cs_syr_coupling.c:2348
void cs_syr_coupling_log_setup(void)
Log SYRTHES coupling setup information.
Definition: cs_syr_coupling.c:2412
void cs_syr_coupling_all_init(void)
Definition: cs_syr_coupling.c:2271
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.c:2118
void cs_syr_coupling_exchange_volume(void)
Exchange volume values relative to a SYRTHES coupling.
Definition: cs_syr_coupling.c:2861
cs_lnum_t cs_syr_coupling_n_elts(int cpl_id, int mode)
Get number of coupled elements with SYRTHES.
Definition: cs_syr_coupling.c:3055
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.c:3098
int cs_syr_coupling_n_couplings(void)
Definition: cs_syr_coupling.c:2323
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.c:2226
void cs_syr_coupling_set_conservativity(int flag)
Definition: cs_syr_coupling.c:2337
int cs_syr_coupling_is_surf(int cpl_id)
Check if the given SYRTHES coupling number is a surface couplings.
Definition: cs_syr_coupling.c:2502
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.c:2381
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.c:3169
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.c:2531
void cs_syr_coupling_all_finalize(void)
Definition: cs_syr_coupling.c:2310
void cs_syr_coupling_init_meshes(void)
Create coupled meshes and setup PLE locator for Syrthes couplings.
Definition: cs_syr_coupling.c:2481
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.c:2964
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.c:2665
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.c:3140
integer, save nvar
number of solved variables (must be lower than nvarmx)
Definition: dimens.f90:42
Definition: cs_zone.h:55