Code_Saturne
CFD tool
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-2012 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  * BFT library headers
36  *----------------------------------------------------------------------------*/
37 
38 /*----------------------------------------------------------------------------
39  * FVM library headers
40  *----------------------------------------------------------------------------*/
41 
42 #include "fvm_defs.h"
43 
44 /*----------------------------------------------------------------------------
45  * Local headers
46  *----------------------------------------------------------------------------*/
47 
48 #include "cs_base.h"
49 
50 /*----------------------------------------------------------------------------*/
51 
53 
54 /*=============================================================================
55  * Local Macro Definitions
56  *============================================================================*/
57 
58 /*============================================================================
59  * Structure definition
60  *============================================================================*/
61 
62 /*============================================================================
63  * Global variables definition
64  *============================================================================*/
65 
66 /*============================================================================
67  * Public function prototypes for Fortran API
68  *============================================================================*/
69 
70 /*----------------------------------------------------------------------------
71  * Get number of SYRTHES couplings.
72  *
73  * Fortran Interface:
74  *
75  * SUBROUTINE NBCSYR
76  * *****************
77  *
78  * INTEGER n_couplings : <-- : number of SYRTHES couplings
79  *----------------------------------------------------------------------------*/
80 
81 void CS_PROCF(nbcsyr, NBCSYR)
82 (
83  cs_int_t *const n_couplings
84 );
85 
86 /*----------------------------------------------------------------------------
87  * Test if the given SYRTHES coupling number is a surface coupling
88  * Return 1 if true else 0
89  *
90  * Fortran Interface:
91  *
92  * SUBROUTINE TSURSY
93  * *****************
94  *
95  * INTEGER cplnum : <-- : number of the SYRTHES coupling
96  * INTEGER issurf : --> : 1 if surface coupling else 0
97  *----------------------------------------------------------------------------*/
98 
99 void CS_PROCF(tsursy, TSURSY)
100 (
101  cs_int_t *const cplnum,
102  cs_int_t *issurf
103 );
104 
105 /*----------------------------------------------------------------------------
106  * Test if the given SYRTHES coupling number is a volume coupling
107  * Return 1 if true else 0
108  *
109  * Fortran Interface:
110  *
111  * SUBROUTINE TVOLSY
112  * *****************
113  *
114  * INTEGER cplnum : <-- : number of the SYRTHES coupling
115  * INTEGER issurf : --> : 1 if volume coupling else 0
116  *----------------------------------------------------------------------------*/
117 
118 void CS_PROCF(tvolsy, TVOLSY)
119 (
120  cs_int_t *const cplnum,
121  cs_int_t *isvol
122 );
123 
124 /*----------------------------------------------------------------------------
125  * Create nodal coupled mesh.
126  * Send vertices's coordinates and connectivity of coupled mesh.
127  *
128  * Fortran Interface:
129  *
130  * SUBROUTINE GEOSYR
131  * *****************
132  *----------------------------------------------------------------------------*/
133 
134 void CS_PROCF(geosyr, GEOSYR)
135 (
136  void
137 );
138 
139 /*----------------------------------------------------------------------------
140  * Get number of coupled elements with SYRTHES.
141  *
142  * Fortran Interface:
143  *
144  * SUBROUTINE NBESYR
145  * *****************
146  *
147  * INTEGER coupl_num : --> : coupling number
148  * INTEGER mode : --> : 0 (surface); 1 (volume)
149  * INTEGER n_coupl_elts : <-- : number of coupled elements
150  *----------------------------------------------------------------------------*/
151 
152 void CS_PROCF(nbesyr, NBESYR)
153 (
154  const cs_int_t *coupl_num,
155  const cs_int_t *mode,
156  cs_int_t *n_coupl_elts
157 );
158 
159 /*----------------------------------------------------------------------------
160  * Get local numbering of coupled elements
161  *
162  * Fortran interface:
163  *
164  * SUBROUTINE LELTSY
165  * *****************
166  *
167  * INTEGER coupl_num : --> : coupling number
168  * INTEGER mode : --> : 0 (surface); 1 (volume)
169  * INTEGER coupl_elt_list : <-- : list of coupled elements
170  *----------------------------------------------------------------------------*/
171 
172 void CS_PROCF(leltsy, LELTSY)
173 (
174  const cs_int_t *coupl_num,
175  const cs_int_t *mode,
176  cs_lnum_t *coupl_elt_list
177 );
178 
179 /*----------------------------------------------------------------------------
180  * User function wrapper for definition of SYRTHES couplings
181  *
182  * Fortran Interface:
183  *
184  * SUBROUTINE USSYRC
185  * *****************
186  *----------------------------------------------------------------------------*/
187 
188 void CS_PROCF (ussyrc, USSYRC)
189 (
190  void
191 );
192 
193 /*----------------------------------------------------------------------------
194  * Receive coupling variables from SYRTHES
195  *
196  * Fortran Interface:
197  *
198  * SUBROUTINE VARSYI
199  * *****************
200  *
201  * INTEGER NUMSYR : --> : Number of SYRTHES coupling
202  * INTEGER MODE : --> : 0 (surface); 1 (volume)
203  * DOUBLE PRECISION TSOLID : <-- : Solid temperature
204  *----------------------------------------------------------------------------*/
205 
206 void CS_PROCF (varsyi, VARSYI)
207 (
208  cs_int_t *numsyr,
209  cs_int_t *mode,
210  cs_real_t *tsolid
211 );
212 
213 /*----------------------------------------------------------------------------
214  * Send coupling variables to SYRTHES
215  *
216  * Fortran Interface:
217  *
218  * SUBROUTINE VARSYO
219  * *****************
220  *
221  * INTEGER NUMSYR : --> : Number of SYRTHES coupling
222  * INTEGER MODE : --> : 0 (surface); 1 (volume)
223  * INTEGER LSTELT : --> : List of coupled elements
224  * DOUBLE PRECISION TFLUID : --> : Fluid temperature
225  * DOUBLE PRECISION HFLUID : --> : Exchange coefficient
226  *----------------------------------------------------------------------------*/
227 
228 void CS_PROCF (varsyo, VARSYO)
229 (
230  cs_int_t *numsyr,
231  cs_int_t *mode,
232  cs_int_t *lstelt,
233  cs_real_t *tfluid,
234  cs_real_t *hfluid
235 );
236 
237 /*----------------------------------------------------------------------------
238  * Compute the explicit/implicit contribution to source terms in case of
239  * volume coupling with SYRTHES4
240  *
241  * Fortran Interface:
242  *
243  * SUBROUTINE CTBVSY
244  * *****************
245  *
246  * INTEGER NUMSYR : --> : Number of SYRTHES coupling
247  * DOUBLE PRECISION TFLUID : --> : Fluid temperature
248  * DOUBLE PRECISION CTBIMP : <-> : Implicit contribution
249  * DOUBLE PRECISION CTBEXP : <-> : Explicit contribution
250  *----------------------------------------------------------------------------*/
251 
252 void CS_PROCF (ctbvsy, CTBVSY)
253 (
254  cs_int_t *numsyr,
255  cs_real_t *tfluid,
256  cs_real_t *ctbimp,
257  cs_real_t *ctbexp
258 );
259 
260 /*============================================================================
261  * Public function prototypes
262  *============================================================================*/
263 
264 /*----------------------------------------------------------------------------
265  * Define new SYRTHES coupling.
266  *
267  * In the case of a single Code_Saturne and single SYRTHES instance, the
268  * syrthes_name argument is ignored.
269  *
270  * In case of multiple couplings, a coupling will be matched with available
271  * SYRTHES instances based on the syrthes_name argument.
272  *
273  * arguments:
274  * syrthes_name <-- name of SYRTHES instance
275  * boundary_criteria <-- boundary face selection criteria, or NULL
276  * volume_criteria <-- volume cell selection criteria, or NULL
277  * projection_axis <-- 'x', 'y', or 'y' for 2D projection axis (case
278  * independent), or ' ' for standard 3D coupling
279  * verbosity <-- verbosity level
280  * visualization <-- visualization output level (0 or 1)
281  *----------------------------------------------------------------------------*/
282 
283 void
284 cs_syr_coupling_define(const char *syrthes_name,
285  const char *boundary_criteria,
286  const char *volume_criteria,
287  char projection_axis,
288  int verbosity,
289  int visualization);
290 
291 /*----------------------------------------------------------------------------
292  * Initialize SYRTHES couplings.
293  *
294  * This function may be called once all couplings have been defined,
295  * and it will match defined couplings with available applications.
296  *----------------------------------------------------------------------------*/
297 
298 void
300 
301 /*----------------------------------------------------------------------------
302  * Finalize all SYRTHES couplings.
303  *----------------------------------------------------------------------------*/
304 
305 void
307 
308 /*----------------------------------------------------------------------------
309  * Set conservativity forcing flag to True (1) or False (0) for all defined
310  * SYRTHES couplings
311  *
312  * parameter:
313  * flag <-- Conservativity forcing flag to set
314  *----------------------------------------------------------------------------*/
315 
316 void
318 
319 /*----------------------------------------------------------------------------
320  * Set explicit treatment for the source terms in SYRTHES volume couplings
321  *----------------------------------------------------------------------------*/
322 
323 void
325 
326 /*----------------------------------------------------------------------------*/
327 
329 
330 #endif /* __CS_SYR_COUPLING_H__ */
void cs_syr_coupling_all_finalize(void)
Definition: cs_syr_coupling.c:947
BEGIN_C_DECLS void nbcsyr(cs_int_t *const n_couplings)
Definition: cs_syr_coupling.c:449
void varsyo(cs_int_t *numsyr, cs_int_t *mode, cs_int_t *lstelt, cs_real_t *tfluid, cs_real_t *hfluid)
Definition: cs_syr_coupling.c:757
void varsyi(cs_int_t *numsyr, cs_int_t *mode, cs_real_t *tsolid)
Definition: cs_syr_coupling.c:721
void nbesyr(const cs_int_t *coupl_num, const cs_int_t *mode, cs_int_t *n_coupl_elts)
Definition: cs_syr_coupling.c:635
void cs_syr_coupling_all_init(void)
Definition: cs_syr_coupling.c:918
#define BEGIN_C_DECLS
Definition: cs_defs.h:365
void leltsy(const cs_int_t *coupl_num, const cs_int_t *mode, cs_lnum_t *coupl_elt_list)
Definition: cs_syr_coupling.c:670
void cs_syr_coupling_set_explicit_treatment(void)
Definition: cs_syr_coupling.c:972
int cs_int_t
Definition: cs_defs.h:263
void ctbvsy(cs_int_t *numsyr, cs_real_t *tfluid, cs_real_t *ctbimp, cs_real_t *ctbexp)
Definition: cs_syr_coupling.c:795
void cs_syr_coupling_set_conservativity(int flag)
Definition: cs_syr_coupling.c:961
void ussyrc(void)
Definition: cs_syr_coupling.c:700
int cs_lnum_t
Definition: cs_defs.h:260
void geosyr(void)
Definition: cs_syr_coupling.c:607
#define END_C_DECLS
Definition: cs_defs.h:366
double cs_real_t
Definition: cs_defs.h:264
#define CS_PROCF(x, y)
Definition: cs_defs.h:379
void tsursy(cs_int_t *const cplnum, cs_int_t *issurf)
Definition: cs_syr_coupling.c:477
void cs_syr_coupling_define(const char *syrthes_name, const char *boundary_criteria, const char *volume_criteria, char projection_axis, int verbosity, int visualization)
Definition: cs_syr_coupling.c:843
void tvolsy(cs_int_t *const cplnum, cs_int_t *isvol)
Definition: cs_syr_coupling.c:543