6.2
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-2020 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 
42 /*----------------------------------------------------------------------------*/
43 
45 
46 /*=============================================================================
47  * Local Macro Definitions
48  *============================================================================*/
49 
50 /*============================================================================
51  * Structure definition
52  *============================================================================*/
53 
54 /*============================================================================
55  * Global variables definition
56  *============================================================================*/
57 
58 /*============================================================================
59  * Public function prototypes
60  *============================================================================*/
61 
62 /*----------------------------------------------------------------------------
63  * Define new SYRTHES coupling.
64  *
65  * In the case of a single Code_Saturne and single SYRTHES instance, the
66  * syrthes_name argument is ignored.
67  *
68  * In case of multiple couplings, a coupling will be matched with available
69  * SYRTHES instances based on the syrthes_name argument.
70  *
71  * arguments:
72  * syrthes_name <-- name of SYRTHES instance
73  * boundary_criteria <-- boundary face selection criteria, or NULL
74  * volume_criteria <-- volume cell selection criteria, or NULL
75  * projection_axis <-- 'x', 'y', or 'y' for 2D projection axis (case
76  * independent), or ' ' for standard 3D coupling
77  * allow_nonmatching <-- allow nearest-neighbor mapping where matching
78  * within tolerance is not available
79  * tolerance <-- addition to local extents of each element
80  * extent = base_extent * (1 + tolerance)
81  * verbosity <-- verbosity level
82  * visualization <-- visualization output level (0 or 1)
83  *----------------------------------------------------------------------------*/
84 
85 void
86 cs_syr_coupling_define(const char *syrthes_name,
87  const char *boundary_criteria,
88  const char *volume_criteria,
89  char projection_axis,
90  bool allow_nonmatching,
91  float tolerance,
92  int verbosity,
93  int visualization);
94 
95 /*----------------------------------------------------------------------------
96  * Initialize SYRTHES couplings.
97  *
98  * This function may be called once all couplings have been defined,
99  * and it will match defined couplings with available applications.
100  *----------------------------------------------------------------------------*/
101 
102 void
104 
105 /*----------------------------------------------------------------------------
106  * Finalize all SYRTHES couplings.
107  *----------------------------------------------------------------------------*/
108 
109 void
111 
112 /*----------------------------------------------------------------------------
113  * Return number of SYRTHES couplings.
114  *
115  * return:
116  * number of SYRTHES couplings defined
117  *----------------------------------------------------------------------------*/
118 
119 int
121 
122 /*----------------------------------------------------------------------------
123  * Set conservativity forcing flag to True (1) or False (0) for all defined
124  * SYRTHES couplings
125  *
126  * parameter:
127  * flag <-- Conservativity forcing flag to set
128  *----------------------------------------------------------------------------*/
129 
130 void
132 
133 /*----------------------------------------------------------------------------
134  * Set explicit treatment for the source terms in SYRTHES volume couplings
135  *----------------------------------------------------------------------------*/
136 
137 void
139 
140 /*----------------------------------------------------------------------------*/
144 /*----------------------------------------------------------------------------*/
145 
146 void
148 
149 /*----------------------------------------------------------------------------*/
153 /*----------------------------------------------------------------------------*/
154 
155 void
157 
158 /*----------------------------------------------------------------------------*/
166 /*----------------------------------------------------------------------------*/
167 
168 int
169 cs_syr_coupling_is_surf(int cpl_id);
170 
171 /*----------------------------------------------------------------------------*/
180 /*----------------------------------------------------------------------------*/
181 
182 void
184  int bc_type[],
185  int icodcl[],
186  cs_real_t rcodcl[]);
187 
188 /*----------------------------------------------------------------------------*/
195 /*----------------------------------------------------------------------------*/
196 
197 void
199  cs_real_t t_wall[]);
200 
201 /*----------------------------------------------------------------------------*/
205 /*----------------------------------------------------------------------------*/
206 
207 void
209 
210 /*----------------------------------------------------------------------------*/
219 /*----------------------------------------------------------------------------*/
220 
221 void
223  cs_real_t st_exp[],
224  cs_real_t st_imp[]);
225 
226 /*----------------------------------------------------------------------------*/
235 /*----------------------------------------------------------------------------*/
236 
237 cs_lnum_t
238 cs_syr_coupling_n_elts(int cpl_id,
239  int mode);
240 
241 /*----------------------------------------------------------------------------*/
249 /*----------------------------------------------------------------------------*/
250 
251 void
252 cs_syr_coupling_elt_ids(int cpl_id,
253  int mode,
254  cs_lnum_t elt_ids[]);
255 
256 /*----------------------------------------------------------------------------*/
264 /*----------------------------------------------------------------------------*/
265 
266 void
267 cs_syr_coupling_recv_tsolid(int cpl_id,
268  int mode,
269  cs_real_t t_solid[]);
270 
271 /*----------------------------------------------------------------------------*/
281 /*----------------------------------------------------------------------------*/
282 
283 void
284 cs_syr_coupling_send_tf_hf(int cpl_id,
285  int mode,
286  const cs_lnum_t elt_ids[],
287  cs_real_t t_fluid[],
288  cs_real_t h_fluid[]);
289 
290 /*----------------------------------------------------------------------------*/
291 
293 
294 #endif /* __CS_SYR_COUPLING_H__ */
void cs_syr_coupling_all_finalize(void)
Definition: cs_syr_coupling.c:580
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:728
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:770
int cs_syr_coupling_n_couplings(void)
Definition: cs_syr_coupling.c:593
void cs_syr_coupling_all_init(void)
Definition: cs_syr_coupling.c:549
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
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:1404
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:1342
void cs_syr_coupling_set_explicit_treatment(void)
Definition: cs_syr_coupling.c:625
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
void cs_syr_coupling_set_conservativity(int flag)
Definition: cs_syr_coupling.c:614
void cs_syr_coupling_log_setup(void)
Log SYRTHES coupling setup information.
Definition: cs_syr_coupling.c:637
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:470
void cs_syr_coupling_exchange_volume(void)
Exchange volume values relative to a SYRTHES coupling.
Definition: cs_syr_coupling.c:1122
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:1372
void cs_syr_coupling_init_meshes(void)
Create coupled meshes and setup PLE locator for Syrthes couplings.
Definition: cs_syr_coupling.c:709
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:301
#define END_C_DECLS
Definition: cs_defs.h:496
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:1310
void cs_syr_coupling_send_boundary(const cs_real_t h_wall[], cs_real_t t_wall[])
Send field/variable values relative to a SYRTHES coupling.
Definition: cs_syr_coupling.c:929
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:1222