7.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-2021 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 /*----------------------------------------------------------------------------*/
159 /*----------------------------------------------------------------------------*/
160 
161 void
163 
164 /*----------------------------------------------------------------------------*/
168 /*----------------------------------------------------------------------------*/
169 
170 void
172 
173 /*----------------------------------------------------------------------------*/
181 /*----------------------------------------------------------------------------*/
182 
183 int
184 cs_syr_coupling_is_surf(int cpl_id);
185 
186 /*----------------------------------------------------------------------------*/
195 /*----------------------------------------------------------------------------*/
196 
197 void
199  int bc_type[],
200  int icodcl[],
201  cs_real_t rcodcl[]);
202 
203 /*----------------------------------------------------------------------------*/
210 /*----------------------------------------------------------------------------*/
211 
212 void
214  cs_real_t v_fluid[]);
215 
216 /*----------------------------------------------------------------------------*/
220 /*----------------------------------------------------------------------------*/
221 
222 void
224 
225 /*----------------------------------------------------------------------------*/
234 /*----------------------------------------------------------------------------*/
235 
236 void
238  cs_real_t st_exp[],
239  cs_real_t st_imp[]);
240 
241 /*----------------------------------------------------------------------------*/
250 /*----------------------------------------------------------------------------*/
251 
252 cs_lnum_t
253 cs_syr_coupling_n_elts(int cpl_id,
254  int mode);
255 
256 /*----------------------------------------------------------------------------*/
264 /*----------------------------------------------------------------------------*/
265 
266 void
267 cs_syr_coupling_elt_ids(int cpl_id,
268  int mode,
269  cs_lnum_t elt_ids[]);
270 
271 /*----------------------------------------------------------------------------*/
279 /*----------------------------------------------------------------------------*/
280 
281 void
282 cs_syr_coupling_recv_tsolid(int cpl_id,
283  int mode,
284  cs_real_t t_solid[]);
285 
286 /*----------------------------------------------------------------------------*/
296 /*----------------------------------------------------------------------------*/
297 
298 void
299 cs_syr_coupling_send_tf_hf(int cpl_id,
300  int mode,
301  const cs_lnum_t elt_ids[],
302  cs_real_t t_fluid[],
303  cs_real_t h_fluid[]);
304 
305 /*----------------------------------------------------------------------------*/
306 
308 
309 #endif /* __CS_SYR_COUPLING_H__ */
void cs_syr_coupling_all_finalize(void)
Definition: cs_syr_coupling.c:2283
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:2426
void cs_syr_coupling_recv_boundary(int nvar, int bc_type[], int icodcl[], cs_real_t rcodcl[])
Read boundary field/variable values relative to a SYRTHES coupling.
Definition: cs_syr_coupling.c:2455
int cs_syr_coupling_n_couplings(void)
Definition: cs_syr_coupling.c:2296
void cs_syr_coupling_all_init(void)
Definition: cs_syr_coupling.c:2244
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
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:3097
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:3026
void cs_syr_coupling_set_explicit_treatment(void)
Definition: cs_syr_coupling.c:2321
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
void cs_syr_coupling_set_conservativity(int flag)
Definition: cs_syr_coupling.c:2310
void cs_syr_coupling_log_setup(void)
Log SYRTHES coupling setup information.
Definition: cs_syr_coupling.c:2333
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:2091
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:2199
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:2593
void cs_syr_coupling_exchange_volume(void)
Exchange volume values relative to a SYRTHES coupling.
Definition: cs_syr_coupling.c:2789
integer, save nvar
number of solved variables (must be lower than nvarmx)
Definition: dimens.f90:42
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:3068
void cs_syr_coupling_init_meshes(void)
Create coupled meshes and setup PLE locator for Syrthes couplings.
Definition: cs_syr_coupling.c:2405
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:316
#define END_C_DECLS
Definition: cs_defs.h:511
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:2983
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:2892
Definition: cs_zone.h:55