My Project
programmer's 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-2019 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 for Fortran API
60  *============================================================================*/
61 
62 /*----------------------------------------------------------------------------
63  * Get number of SYRTHES couplings.
64  *
65  * Fortran Interface:
66  *
67  * SUBROUTINE NBCSYR
68  * *****************
69  *
70  * INTEGER n_couplings : <-- : number of SYRTHES couplings
71  *----------------------------------------------------------------------------*/
72 
73 void CS_PROCF(nbcsyr, NBCSYR)
74 (
75  cs_int_t *const n_couplings
76 );
77 
78 /*----------------------------------------------------------------------------
79  * Test if the given SYRTHES coupling number is a surface coupling
80  * Return 1 if true else 0
81  *
82  * Fortran Interface:
83  *
84  * SUBROUTINE TSURSY
85  * *****************
86  *
87  * INTEGER cplnum : <-- : number of the SYRTHES coupling
88  * INTEGER issurf : --> : 1 if surface coupling else 0
89  *----------------------------------------------------------------------------*/
90 
91 void CS_PROCF(tsursy, TSURSY)
92 (
93  cs_int_t *const cplnum,
95 );
96 
97 /*----------------------------------------------------------------------------
98  * Test if the given SYRTHES coupling number is a volume coupling
99  * Return 1 if true else 0
100  *
101  * Fortran Interface:
102  *
103  * SUBROUTINE TVOLSY
104  * *****************
105  *
106  * INTEGER cplnum : <-- : number of the SYRTHES coupling
107  * INTEGER issurf : --> : 1 if volume coupling else 0
108  *----------------------------------------------------------------------------*/
109 
110 void CS_PROCF(tvolsy, TVOLSY)
111 (
112  cs_int_t *const cplnum,
113  cs_int_t *isvol
114 );
115 
116 /*----------------------------------------------------------------------------
117  * Get number of coupled elements with SYRTHES.
118  *
119  * Fortran Interface:
120  *
121  * SUBROUTINE NBESYR
122  * *****************
123  *
124  * INTEGER coupl_num : --> : coupling number
125  * INTEGER mode : --> : 0 (surface); 1 (volume)
126  * INTEGER n_coupl_elts : <-- : number of coupled elements
127  *----------------------------------------------------------------------------*/
128 
129 void CS_PROCF(nbesyr, NBESYR)
130 (
131  const cs_int_t *coupl_num,
132  const cs_int_t *mode,
134 );
135 
136 /*----------------------------------------------------------------------------
137  * Get local numbering of coupled elements
138  *
139  * Fortran interface:
140  *
141  * SUBROUTINE LELTSY
142  * *****************
143  *
144  * INTEGER coupl_num : --> : coupling number
145  * INTEGER mode : --> : 0 (surface); 1 (volume)
146  * INTEGER coupl_elt_list : <-- : list of coupled elements
147  *----------------------------------------------------------------------------*/
148 
149 void CS_PROCF(leltsy, LELTSY)
150 (
151  const cs_int_t *coupl_num,
152  const cs_int_t *mode,
154 );
155 
156 /*----------------------------------------------------------------------------
157  * Receive coupling variables from SYRTHES
158  *
159  * Fortran Interface:
160  *
161  * SUBROUTINE VARSYI
162  * *****************
163  *
164  * INTEGER NUMSYR : --> : Number of SYRTHES coupling
165  * INTEGER MODE : --> : 0 (surface); 1 (volume)
166  * DOUBLE PRECISION TSOLID : <-- : Solid temperature
167  *----------------------------------------------------------------------------*/
168 
169 void CS_PROCF (varsyi, VARSYI)
170 (
171  cs_int_t *numsyr,
174 );
175 
176 /*----------------------------------------------------------------------------
177  * Send coupling variables to SYRTHES
178  *
179  * Fortran Interface:
180  *
181  * SUBROUTINE VARSYO
182  * *****************
183  *
184  * INTEGER NUMSYR : --> : Number of SYRTHES coupling
185  * INTEGER MODE : --> : 0 (surface); 1 (volume)
186  * INTEGER LSTELT : --> : List of coupled elements
187  * DOUBLE PRECISION TFLUID : --> : Fluid temperature
188  * DOUBLE PRECISION HFLUID : --> : Exchange coefficient
189  *----------------------------------------------------------------------------*/
190 
191 void CS_PROCF (varsyo, VARSYO)
192 (
193  cs_int_t *numsyr,
195  cs_int_t *lstelt,
196  cs_real_t *tfluid,
198 );
199 
200 /*----------------------------------------------------------------------------
201  * Compute the explicit/implicit contribution to source terms in case of
202  * volume coupling with SYRTHES4
203  *
204  * Fortran Interface:
205  *
206  * SUBROUTINE CTBVSY
207  * *****************
208  *
209  * INTEGER NUMSYR : --> : Number of SYRTHES coupling
210  * DOUBLE PRECISION TFLUID : --> : Fluid temperature
211  * DOUBLE PRECISION CTBIMP : <-> : Implicit contribution
212  * DOUBLE PRECISION CTBEXP : <-> : Explicit contribution
213  *----------------------------------------------------------------------------*/
214 
215 void CS_PROCF (ctbvsy, CTBVSY)
216 (
217  cs_int_t *numsyr,
219  cs_real_t *ctbimp,
221 );
222 
223 /*============================================================================
224  * Public function prototypes
225  *============================================================================*/
226 
227 /*----------------------------------------------------------------------------
228  * Define new SYRTHES coupling.
229  *
230  * In the case of a single Code_Saturne and single SYRTHES instance, the
231  * syrthes_name argument is ignored.
232  *
233  * In case of multiple couplings, a coupling will be matched with available
234  * SYRTHES instances based on the syrthes_name argument.
235  *
236  * arguments:
237  * syrthes_name <-- name of SYRTHES instance
238  * boundary_criteria <-- boundary face selection criteria, or NULL
239  * volume_criteria <-- volume cell selection criteria, or NULL
240  * projection_axis <-- 'x', 'y', or 'y' for 2D projection axis (case
241  * independent), or ' ' for standard 3D coupling
242  * allow_nonmatching <-- allow nearest-neighbor mapping where matching
243  * within tolerance is not available
244  * tolerance <-- addition to local extents of each element
245  * extent = base_extent * (1 + tolerance)
246  * verbosity <-- verbosity level
247  * visualization <-- visualization output level (0 or 1)
248  *----------------------------------------------------------------------------*/
249 
250 void
251 cs_syr_coupling_define(const char *syrthes_name,
252  const char *boundary_criteria,
253  const char *volume_criteria,
254  char projection_axis,
255  bool allow_nonmatching,
256  float tolerance,
257  int verbosity,
258  int visualization);
259 
260 /*----------------------------------------------------------------------------
261  * Initialize SYRTHES couplings.
262  *
263  * This function may be called once all couplings have been defined,
264  * and it will match defined couplings with available applications.
265  *----------------------------------------------------------------------------*/
266 
267 void
269 
270 /*----------------------------------------------------------------------------
271  * Finalize all SYRTHES couplings.
272  *----------------------------------------------------------------------------*/
273 
274 void
276 
277 /*----------------------------------------------------------------------------
278  * Return number of SYRTHES couplings.
279  *
280  * return:
281  * number of SYRTHES couplings defined
282  *----------------------------------------------------------------------------*/
283 
284 int
286 
287 /*----------------------------------------------------------------------------
288  * Set conservativity forcing flag to True (1) or False (0) for all defined
289  * SYRTHES couplings
290  *
291  * parameter:
292  * flag <-- Conservativity forcing flag to set
293  *----------------------------------------------------------------------------*/
294 
295 void
297 
298 /*----------------------------------------------------------------------------
299  * Set explicit treatment for the source terms in SYRTHES volume couplings
300  *----------------------------------------------------------------------------*/
301 
302 void
304 
305 /*----------------------------------------------------------------------------*/
309 /*----------------------------------------------------------------------------*/
310 
311 void
313 
314 /*----------------------------------------------------------------------------*/
318 /*----------------------------------------------------------------------------*/
319 
320 void
322 
323 /*----------------------------------------------------------------------------*/
324 
326 
327 #endif /* __CS_SYR_COUPLING_H__ */
cs_syr_coupling_set_conservativity
void cs_syr_coupling_set_conservativity(int flag)
Definition: cs_syr_coupling.c:945
cs_syr_coupling_all_finalize
void cs_syr_coupling_all_finalize(void)
Definition: cs_syr_coupling.c:911
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_syr_coupling_define
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:801
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
hfluid
void cs_int_t cs_int_t cs_real_t cs_real_t * hfluid
Definition: cs_syr_coupling.h:194
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_syr_coupling_n_couplings
int cs_syr_coupling_n_couplings(void)
Definition: cs_syr_coupling.c:924
coupl_elt_list
void const cs_int_t cs_lnum_t * coupl_elt_list
Definition: cs_syr_coupling.h:152
cs_syr_coupling_init_meshes
void cs_syr_coupling_init_meshes(void)
Create coupled meshes and setup PLE locator for Syrthes couplings.
Definition: cs_syr_coupling.c:1040
CS_PROCF
void CS_PROCF(nbcsyr, NBCSYR)(cs_int_t *const n_couplings)
ctbimp
void cs_real_t cs_real_t * ctbimp
Definition: cs_syr_coupling.h:218
mode
void const cs_int_t * mode
Definition: cs_syr_coupling.h:132
n_coupl_elts
void const cs_int_t cs_int_t * n_coupl_elts
Definition: cs_syr_coupling.h:132
tsolid
void cs_int_t cs_real_t * tsolid
Definition: cs_syr_coupling.h:172
cs_syr_coupling_set_explicit_treatment
void cs_syr_coupling_set_explicit_treatment(void)
Definition: cs_syr_coupling.c:956
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
issurf
void cs_int_t * issurf
Definition: cs_syr_coupling.h:95
cs_syr_coupling_log_setup
void cs_syr_coupling_log_setup(void)
Log SYRTHES coupling setup information.
Definition: cs_syr_coupling.c:968
isvol
void cs_int_t * isvol
Definition: cs_syr_coupling.h:114
cs_int_t
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:301
cs_syr_coupling_all_init
void cs_syr_coupling_all_init(void)
Definition: cs_syr_coupling.c:880
fvm_defs.h
ctbexp
void cs_real_t cs_real_t cs_real_t * ctbexp
Definition: cs_syr_coupling.h:218
lstelt
void cs_int_t cs_int_t * lstelt
Definition: cs_syr_coupling.h:194
tfluid
void cs_int_t cs_int_t cs_real_t * tfluid
Definition: cs_syr_coupling.h:194
cs_base.h