My Project
programmer's documentation
Loading...
Searching...
No Matches
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-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 "cs_base.h"
39
40/*----------------------------------------------------------------------------*/
41
43
44/*=============================================================================
45 * Local Macro Definitions
46 *============================================================================*/
47
48/*============================================================================
49 * Structure definition
50 *============================================================================*/
51
52/* Structure associated to Syrthes coupling */
53
54typedef struct _cs_syr4_coupling_t cs_syr4_coupling_t;
55
56/*============================================================================
57 * Global variables definition
58 *============================================================================*/
59
60/*============================================================================
61 * Public function prototypes for Fortran API
62 *============================================================================*/
63
64/*----------------------------------------------------------------------------
65 * Compute the implicit/explicit contribution for source terms in a SYRTHES
66 * volume coupling
67 *
68 * Fortran Interface:
69 *
70 * SUBROUTINE CTBVSY (NUMSYR, TFLUID, CTBIMP, CTBEXP)
71 * *****************
72 *
73 * INTEGER NUMSYR : --> : Number of SYRTHES coupling
74 * DOUBLE PRECISION TFLUID : --> : Fluid temperature
75 * DOUBLE PRECISION CTBIMP : --> : Implicit contribution
76 * DOUBLE PRECISION CTBEXP : --> : Explicit contribution
77 *----------------------------------------------------------------------------*/
78
79void CS_PROCF (ctbvsy, CTBVSY)
80(
81 cs_int_t *numsyr,
82 cs_real_t *tfluid,
83 cs_real_t *ctbimp,
84 cs_real_t *ctbexp
85);
86
87/*============================================================================
88 * Public function prototypes
89 *============================================================================*/
90
91/*----------------------------------------------------------------------------
92 * Get number of SYRTHES couplings.
93 *
94 * returns:
95 * number of SYRTHES couplings
96 *----------------------------------------------------------------------------*/
97
98int
100
101/*----------------------------------------------------------------------------
102 * Get pointer to SYRTHES coupling.
103 *
104 * parameters:
105 * coupling_id <-- Id (0 to n-1) of SYRTHES coupling
106 *
107 * returns:
108 * pointer to SYRTHES coupling structure
109 *----------------------------------------------------------------------------*/
110
113
114/*----------------------------------------------------------------------------
115 * Create a syr4_coupling_t structure.
116 *
117 * parameters:
118 * dim <-- spatial mesh dimension
119 * ref_axis <-- reference axis
120 * face_sel_criterion <-- criterion for selection of boundary faces
121 * cell_sel_criterion <-- criterion for selection of cells
122 * app_name <-- SYRTHES application name
123 * allow_nonmatching <-- nearest-neighbor search for non-matching faces flag
124 * tolerance <-- addition to local extents of each element
125 * extent = base_extent * (1 + tolerance)
126 * verbosity <-- verbosity level
127 * visualization <-- visualization output flag
128 *----------------------------------------------------------------------------*/
129
130void
132 int ref_axis,
133 const char *face_sel_criterion,
134 const char *cell_sel_criterion,
135 const char *app_name,
136 bool allow_nonmatching,
137 float tolerance,
138 int verbosity,
139 int visualization);
140
141/*----------------------------------------------------------------------------
142 * Destroy cs_syr4_coupling_t structures
143 *----------------------------------------------------------------------------*/
144
145void
147
148/*----------------------------------------------------------------------------
149 * Set conservativity forcing flag to True (1) or False (0) for all defined
150 * SYRTHES couplings
151 *
152 * parameter:
153 * flag <-- Conservativity forcing flag to set
154 *----------------------------------------------------------------------------*/
155
156void
158
159/*----------------------------------------------------------------------------
160 * Set explicit treatment for the source terms in SYRTHES volume couplings
161 *----------------------------------------------------------------------------*/
162
163void
165
166/*----------------------------------------------------------------------------
167 * Initialize communicator for SYRTHES coupling
168 *
169 * parameters:
170 * syr_coupling <-> Syrthes coupling structure
171 * coupling_id <-- id of this coupling (for log file message)
172 * syr_root_rank <-- SYRTHES root rank
173 * n_syr_ranks <-- Number of ranks associated with SYRTHES
174 *----------------------------------------------------------------------------*/
175
176void
178 int coupling_id,
179 int syr_root_rank,
180 int n_syr_ranks);
181
182/*----------------------------------------------------------------------------
183 * Define coupled mesh and send it to SYRTHES
184 *
185 * Optional post-processing output is also built at this stage.
186 *
187 * parameters:
188 * syr_coupling <-- SYRTHES coupling structure
189 *----------------------------------------------------------------------------*/
190
191void
193
194/*----------------------------------------------------------------------------
195 * Return 1 if this coupling is a surface coupling else 0
196 *
197 * parameters:
198 * syr_coupling <-- SYRTHES coupling structure
199 *
200 * returns:
201 * 1 or 0
202 *----------------------------------------------------------------------------*/
203
204int
206
207/*----------------------------------------------------------------------------
208 * Return 1 if this coupling is a volume coupling else 0
209 *
210 * parameters:
211 * syr_coupling <-- SYRTHES coupling structure
212 *
213 * returns:
214 * 1 or 0
215 *----------------------------------------------------------------------------*/
216
217int
219
220/*----------------------------------------------------------------------------
221 * Get number of associated coupled elements in main mesh
222 *
223 * parameters:
224 * syr_coupling <-- SYRTHES coupling structure
225 * mode <-- 0 (surface); 1 (volume)
226 *
227 * returns:
228 * number of vertices in coupled mesh
229 *----------------------------------------------------------------------------*/
230
233 int mode);
234
235/*----------------------------------------------------------------------------
236 * Get local numbering of coupled elements
237 *
238 * parameters:
239 * syr_coupling <-- SYRTHES coupling structure
240 * cpl_elt_lst --> List of coupled elements (1 to n)
241 * mode <-- 0 (surface); 1 (volume)
242 *----------------------------------------------------------------------------*/
243
244void
246 cs_int_t cpl_elt_lst[],
247 int mode);
248
249/*----------------------------------------------------------------------------
250 * Receive coupling variables from SYRTHES
251 *
252 * parameters:
253 * syr_coupling <-- SYRTHES coupling structure
254 * tsolid --> solid temperature
255 * mode <-- 0: surface coupling; 1: volume coupling
256 *----------------------------------------------------------------------------*/
257
258void
260 cs_real_t tsolid[],
261 int mode);
262
263/*----------------------------------------------------------------------------
264 * Send coupling variables to SYRTHES
265 *
266 * parameters:
267 * syr_coupling <-- SYRTHES coupling structure
268 * cpl_elt_list <-- list of coupled boundary faces
269 * tf <-- fluid temperature
270 * hf <-- fluid heat exchange coef. (numerical or user-defined)
271 * mode <-- 0 (surface); 1 (volume)
272 *----------------------------------------------------------------------------*/
273
274void
276 const cs_lnum_t cpl_elt_lst[],
277 cs_real_t tf[],
278 cs_real_t hf[],
279 int mode);
280
281/*----------------------------------------------------------------------------
282 * Compute the explicit/implicit contribution to source terms in case of
283 * volume coupling with SYRTHES4
284 *
285 * parameters:
286 * syr_coupling <-- SYRTHES coupling structure
287 * tf <-- fluid temperature
288 * ctbimp <-> implicit contribution
289 * ctbexp <-> explicit contribution
290 *----------------------------------------------------------------------------*/
291
292void
294 const cs_real_t tf[],
295 cs_real_t ctbimp[],
296 cs_real_t ctbexp[]);
297
298/*----------------------------------------------------------------------------*/
299
301
302#endif /* __CS_SYR4_COUPLING_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:467
double cs_real_t
Floating-point value.
Definition cs_defs.h:302
int cs_int_t
Fortran-compatible integer.
Definition cs_defs.h:301
#define CS_PROCF(x, y)
Definition cs_defs.h:481
#define END_C_DECLS
Definition cs_defs.h:468
int cs_lnum_t
local mesh entity id
Definition cs_defs.h:298
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:1777
void cs_syr4_coupling_recv_tsolid(cs_syr4_coupling_t *syr_coupling, cs_real_t tsolid[], int mode)
Definition cs_syr4_coupling.c:1726
cs_syr4_coupling_t * cs_syr4_coupling_by_id(cs_int_t coupling_id)
Definition cs_syr4_coupling.c:1316
void ctbvsy(cs_int_t *numsyr, cs_real_t *tfluid, cs_real_t *ctbimp, cs_real_t *ctbexp)
Definition cs_syr_coupling.c:745
struct _cs_syr4_coupling_t cs_syr4_coupling_t
Definition cs_syr4_coupling.h:54
cs_lnum_t cs_syr4_coupling_get_n_elts(const cs_syr4_coupling_t *syr_coupling, int mode)
Definition cs_syr4_coupling.c:1661
int cs_syr4_coupling_is_surf(const cs_syr4_coupling_t *syr_coupling)
Definition cs_syr4_coupling.c:1614
void cs_syr4_coupling_set_explicit_treatment(void)
Definition cs_syr4_coupling.c:1488
void cs_syr4_coupling_all_destroy(void)
Definition cs_syr4_coupling.c:1425
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:1504
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:1693
int cs_syr4_coupling_n_couplings(void)
Definition cs_syr4_coupling.c:1300
void cs_syr4_coupling_set_conservativity(int flag)
Definition cs_syr4_coupling.c:1478
void cs_syr4_coupling_init_mesh(cs_syr4_coupling_t *syr_coupling)
Definition cs_syr4_coupling.c:1564
void cs_syr4_coupling_ts_contrib(const cs_syr4_coupling_t *syr_coupling, const cs_real_t tf[], cs_real_t ctbimp[], cs_real_t ctbexp[])
Definition cs_syr4_coupling.c:1855
int cs_syr4_coupling_is_vol(const cs_syr4_coupling_t *syr_coupling)
Definition cs_syr4_coupling.c:1637
void cs_syr4_coupling_add(int dim, int ref_axis, const char *face_sel_criterion, const char *cell_sel_criterion, const char *app_name, bool allow_nonmatching, float tolerance, int verbosity, int visualization)
Definition cs_syr4_coupling.c:1344