programmer's documentation
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
src
base
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-2013 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
42
BEGIN_C_DECLS
43
44
/*=============================================================================
45
* Local Macro Definitions
46
*============================================================================*/
47
48
/*============================================================================
49
* Structure definition
50
*============================================================================*/
51
52
/* Structure associated to Syrthes coupling */
53
54
typedef
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
79
void
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
98
int
99
cs_syr4_coupling_n_couplings
(
void
);
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
111
cs_syr4_coupling_t *
112
cs_syr4_coupling_by_id
(
cs_int_t
coupling_id);
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
130
void
131
cs_syr4_coupling_add
(
int
dim,
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
145
void
146
cs_syr4_coupling_all_destroy
(
void
);
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
156
void
157
cs_syr4_coupling_set_conservativity
(
int
flag);
158
159
/*----------------------------------------------------------------------------
160
* Set explicit treatment for the source terms in SYRTHES volume couplings
161
*----------------------------------------------------------------------------*/
162
163
void
164
cs_syr4_coupling_set_explicit_treatment
(
void
);
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
176
void
177
cs_syr4_coupling_init_comm
(cs_syr4_coupling_t *syr_coupling,
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
191
void
192
cs_syr4_coupling_init_mesh
(cs_syr4_coupling_t *syr_coupling);
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
204
int
205
cs_syr4_coupling_is_surf
(
const
cs_syr4_coupling_t *syr_coupling);
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
217
int
218
cs_syr4_coupling_is_vol
(
const
cs_syr4_coupling_t *syr_coupling);
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
231
cs_lnum_t
232
cs_syr4_coupling_get_n_elts
(
const
cs_syr4_coupling_t *syr_coupling,
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
244
void
245
cs_syr4_coupling_get_elt_list
(
const
cs_syr4_coupling_t *syr_coupling,
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
258
void
259
cs_syr4_coupling_recv_tsolid
(cs_syr4_coupling_t *syr_coupling,
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
274
void
275
cs_syr4_coupling_send_tf_hf
(cs_syr4_coupling_t *syr_coupling,
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
292
void
293
cs_syr4_coupling_ts_contrib
(
const
cs_syr4_coupling_t *syr_coupling,
294
const
cs_real_t
tf[],
295
cs_real_t
ctbimp[],
296
cs_real_t
ctbexp[]);
297
298
/*----------------------------------------------------------------------------*/
299
300
END_C_DECLS
301
302
#endif
/* __CS_SYR4_COUPLING_H__ */
Generated on Thu Feb 27 2014 19:21:34 by
1.8.3.1