Code_Saturne
CFD tool
cs_syr4_coupling.h
Go to the documentation of this file.
1 #ifndef __CS_SYR4_COUPLING_H__
2 #define __CS_SYR4_COUPLING_H__
3 
4 /*============================================================================
5  * Syrthes 4 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 /*----------------------------------------------------------------------------
43  * Local headers
44  *----------------------------------------------------------------------------*/
45 
46 #include "cs_base.h"
47 
48 /*----------------------------------------------------------------------------*/
49 
51 
52 /*=============================================================================
53  * Local Macro Definitions
54  *============================================================================*/
55 
56 /*============================================================================
57  * Structure definition
58  *============================================================================*/
59 
60 /* Structure associated to Syrthes coupling */
61 
63 
64 /*============================================================================
65  * Global variables definition
66  *============================================================================*/
67 
68 /*============================================================================
69  * Public function prototypes for Fortran API
70  *============================================================================*/
71 
72 /*----------------------------------------------------------------------------
73  * Compute the implicit/explicit contribution for source terms in a SYRTHES
74  * volume coupling
75  *
76  * Fortran Interface:
77  *
78  * SUBROUTINE CTBVSY (NUMSYR, TFLUID, CTBIMP, CTBEXP)
79  * *****************
80  *
81  * INTEGER NUMSYR : --> : Number of SYRTHES coupling
82  * DOUBLE PRECISION TFLUID : --> : Fluid temperature
83  * DOUBLE PRECISION CTBIMP : --> : Implicit contribution
84  * DOUBLE PRECISION CTBEXP : --> : Explicit contribution
85  *----------------------------------------------------------------------------*/
86 
87 void CS_PROCF (ctbvsy, CTBVSY)
88 (
89  cs_int_t *numsyr,
90  cs_real_t *tfluid,
91  cs_real_t *ctbimp,
92  cs_real_t *ctbexp
93 );
94 
95 /*============================================================================
96  * Public function prototypes
97  *============================================================================*/
98 
99 /*----------------------------------------------------------------------------
100  * Get number of SYRTHES couplings.
101  *
102  * returns:
103  * number of SYRTHES couplings
104  *----------------------------------------------------------------------------*/
105 
106 int
108 
109 /*----------------------------------------------------------------------------
110  * Get pointer to SYRTHES coupling.
111  *
112  * parameters:
113  * coupling_id <-- Id (0 to n-1) of SYRTHES coupling
114  *
115  * returns:
116  * pointer to SYRTHES coupling structure
117  *----------------------------------------------------------------------------*/
118 
120 cs_syr4_coupling_by_id(cs_int_t coupling_id);
121 
122 /*----------------------------------------------------------------------------
123  * Create a syr4_coupling_t structure.
124  *
125  * parameters:
126  * dim <-- spatial mesh dimension
127  * ref_axis <-- reference axis
128  * face_sel_criterion <-- criterion for selection of boundary faces
129  * cell_sel_criterion <-- criterion for selection of cells
130  * app_name <-- SYRTHES application name
131  * verbosity <-- verbosity level
132  * visualization <-- visualization output flag
133  *----------------------------------------------------------------------------*/
134 
135 void
138  const char *face_sel_criterion,
139  const char *cell_sel_criterion,
140  const char *app_name,
141  int verbosity,
142  int visualization);
143 
144 /*----------------------------------------------------------------------------
145  * Destroy cs_syr4_coupling_t structures
146  *----------------------------------------------------------------------------*/
147 
148 void
150 
151 /*----------------------------------------------------------------------------
152  * Set conservativity forcing flag to True (1) or False (0) for all defined
153  * SYRTHES couplings
154  *
155  * parameter:
156  * flag <-- Conservativity forcing flag to set
157  *----------------------------------------------------------------------------*/
158 
159 void
161 
162 /*----------------------------------------------------------------------------
163  * Set explicit treatment for the source terms in SYRTHES volume couplings
164  *----------------------------------------------------------------------------*/
165 
166 void
168 
169 /*----------------------------------------------------------------------------
170  * Initialize communicator for SYRTHES coupling
171  *
172  * parameters:
173  * syr_coupling <-> Syrthes coupling structure
174  * coupling_id <-- id of this coupling (for log file message)
175  * syr_root_rank <-- SYRTHES root rank
176  * n_syr_ranks <-- Number of ranks associated with SYRTHES
177  *----------------------------------------------------------------------------*/
178 
179 void
181  int coupling_id,
182  int syr_root_rank,
183  int n_syr_ranks);
184 
185 /*----------------------------------------------------------------------------
186  * Define coupled mesh and send it to SYRTHES
187  *
188  * Optional post-processing output is also built at this stage.
189  *
190  * parameters:
191  * syr_coupling <-- SYRTHES coupling structure
192  *----------------------------------------------------------------------------*/
193 
194 void
196 
197 /*----------------------------------------------------------------------------
198  * Return 1 if this coupling is a surface coupling else 0
199  *
200  * parameters:
201  * syr_coupling <-- SYRTHES coupling structure
202  *
203  * returns:
204  * 1 or 0
205  *----------------------------------------------------------------------------*/
206 
207 int
208 cs_syr4_coupling_is_surf(const cs_syr4_coupling_t *syr_coupling);
209 
210 /*----------------------------------------------------------------------------
211  * Return 1 if this coupling is a volume coupling else 0
212  *
213  * parameters:
214  * syr_coupling <-- SYRTHES coupling structure
215  *
216  * returns:
217  * 1 or 0
218  *----------------------------------------------------------------------------*/
219 
220 int
221 cs_syr4_coupling_is_vol(const cs_syr4_coupling_t *syr_coupling);
222 
223 /*----------------------------------------------------------------------------
224  * Get number of associated coupled elements in main mesh
225  *
226  * parameters:
227  * syr_coupling <-- SYRTHES coupling structure
228  * mode <-- 0 (surface); 1 (volume)
229  *
230  * returns:
231  * number of vertices in coupled mesh
232  *----------------------------------------------------------------------------*/
233 
234 cs_lnum_t
236  int mode);
237 
238 /*----------------------------------------------------------------------------
239  * Get local numbering of coupled elements
240  *
241  * parameters:
242  * syr_coupling <-- SYRTHES coupling structure
243  * cpl_elt_lst --> List of coupled elements (1 to n)
244  * mode <-- 0 (surface); 1 (volume)
245  *----------------------------------------------------------------------------*/
246 
247 void
249  cs_int_t cpl_elt_lst[],
250  int mode);
251 
252 /*----------------------------------------------------------------------------
253  * Receive coupling variables from SYRTHES
254  *
255  * parameters:
256  * syr_coupling <-- SYRTHES coupling structure
257  * tsolid --> solid temperature
258  * mode <-- 0: surface coupling; 1: volume coupling
259  *----------------------------------------------------------------------------*/
260 
261 void
263  cs_real_t tsolid[],
264  int mode);
265 
266 /*----------------------------------------------------------------------------
267  * Send coupling variables to SYRTHES
268  *
269  * parameters:
270  * syr_coupling <-- SYRTHES coupling structure
271  * cpl_elt_list <-- list of coupled boundary faces
272  * tf <-- fluid temperature
273  * hf <-- fluid heat exchange coef. (numerical or user-defined)
274  * mode <-- 0 (surface); 1 (volume)
275  *----------------------------------------------------------------------------*/
276 
277 void
279  const cs_lnum_t cpl_elt_lst[],
280  cs_real_t tf[],
281  cs_real_t hf[],
282  int mode);
283 
284 /*----------------------------------------------------------------------------
285  * Compute the explicit/implicit contribution to source terms in case of
286  * volume coupling with SYRTHES4
287  *
288  * parameters:
289  * syr_coupling <-- SYRTHES coupling structure
290  * tf <-- fluid temperature
291  * ctbimp <-> implicit contribution
292  * ctbexp <-> explicit contribution
293  *----------------------------------------------------------------------------*/
294 
295 void
297  const cs_real_t tf[],
298  cs_real_t ctbimp[],
299  cs_real_t ctbexp[]);
300 
301 /*----------------------------------------------------------------------------*/
302 
304 
305 #endif /* __CS_SYR4_COUPLING_H__ */
typedefBEGIN_C_DECLS struct _cs_syr4_coupling_t cs_syr4_coupling_t
Definition: cs_syr4_coupling.h:62
void cs_syr4_coupling_set_explicit_treatment(void)
Definition: cs_syr4_coupling.c:1303
void cs_syr4_coupling_all_destroy(void)
Definition: cs_syr4_coupling.c:1240
int visualization
Definition: cs_syr4_coupling.c:142
#define BEGIN_C_DECLS
Definition: cs_defs.h:365
int cs_syr4_coupling_is_vol(const cs_syr4_coupling_t *syr_coupling)
Definition: cs_syr4_coupling.c:1463
int verbosity
Definition: cs_syr4_coupling.c:141
void cs_syr4_coupling_recv_tsolid(cs_syr4_coupling_t *syr_coupling, cs_real_t tsolid[], int mode)
Definition: cs_syr4_coupling.c:1552
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_syr4_coupling_set_conservativity(int flag)
Definition: cs_syr4_coupling.c:1293
cs_syr4_coupling_t * cs_syr4_coupling_by_id(cs_int_t coupling_id)
Definition: cs_syr4_coupling.c:1138
void cs_syr4_coupling_get_elt_list(const cs_syr4_coupling_t *syr_coupling, cs_int_t cpl_elt_lst[], int mode)
Definition: cs_syr4_coupling.c:1519
int cs_lnum_t
Definition: cs_defs.h:260
int cs_syr4_coupling_is_surf(const cs_syr4_coupling_t *syr_coupling)
Definition: cs_syr4_coupling.c:1440
int cs_syr4_coupling_n_couplings(void)
Definition: cs_syr4_coupling.c:1122
void cs_syr4_coupling_init_mesh(cs_syr4_coupling_t *syr_coupling)
Definition: cs_syr4_coupling.c:1379
int dim
Definition: cs_syr4_coupling.c:130
Definition: cs_syr4_coupling.c:126
#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 cs_syr4_coupling_ts_contrib(cs_syr4_coupling_t *syr_coupling, const cs_real_t tf[], cs_real_t ctbimp[], cs_real_t ctbexp[])
Definition: cs_syr4_coupling.c:1684
void cs_syr4_coupling_send_tf_hf(cs_syr4_coupling_t *syr_coupling, const cs_lnum_t cpl_elt_lst[], cs_real_t tf[], cs_real_t hf[], int mode)
Definition: cs_syr4_coupling.c:1606
void cs_syr4_coupling_init_comm(cs_syr4_coupling_t *syr_coupling, int coupling_id, int syr_root_rank, int n_syr_ranks)
Definition: cs_syr4_coupling.c:1319
int ref_axis
Definition: cs_syr4_coupling.c:131
void cs_syr4_coupling_add(cs_lnum_t dim, cs_lnum_t ref_axis, const char *face_sel_criterion, const char *cell_sel_criterion, const char *app_name, int verbosity, int visualization)
Definition: cs_syr4_coupling.c:1163
cs_lnum_t cs_syr4_coupling_get_n_elts(const cs_syr4_coupling_t *syr_coupling, int mode)
Definition: cs_syr4_coupling.c:1487