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_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-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 "
fvm_defs.h
"
39
40
#include "
cs_base.h
"
41
42
/*----------------------------------------------------------------------------*/
43
44
BEGIN_C_DECLS
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,
94
cs_int_t
*issurf
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
* Create nodal coupled mesh.
118
* Send vertices's coordinates and connectivity of coupled mesh.
119
*
120
* Fortran Interface:
121
*
122
* SUBROUTINE GEOSYR
123
* *****************
124
*----------------------------------------------------------------------------*/
125
126
void
CS_PROCF
(
geosyr
, GEOSYR)
127
(
128
void
129
);
130
131
/*----------------------------------------------------------------------------
132
* Get number of coupled elements with SYRTHES.
133
*
134
* Fortran Interface:
135
*
136
* SUBROUTINE NBESYR
137
* *****************
138
*
139
* INTEGER coupl_num : --> : coupling number
140
* INTEGER mode : --> : 0 (surface); 1 (volume)
141
* INTEGER n_coupl_elts : <-- : number of coupled elements
142
*----------------------------------------------------------------------------*/
143
144
void
CS_PROCF
(
nbesyr
, NBESYR)
145
(
146
const
cs_int_t
*coupl_num,
147
const
cs_int_t
*mode,
148
cs_int_t
*n_coupl_elts
149
);
150
151
/*----------------------------------------------------------------------------
152
* Get local numbering of coupled elements
153
*
154
* Fortran interface:
155
*
156
* SUBROUTINE LELTSY
157
* *****************
158
*
159
* INTEGER coupl_num : --> : coupling number
160
* INTEGER mode : --> : 0 (surface); 1 (volume)
161
* INTEGER coupl_elt_list : <-- : list of coupled elements
162
*----------------------------------------------------------------------------*/
163
164
void
CS_PROCF
(
leltsy
, LELTSY)
165
(
166
const
cs_int_t
*coupl_num,
167
const
cs_int_t
*mode,
168
cs_lnum_t
*coupl_elt_list
169
);
170
171
/*----------------------------------------------------------------------------
172
* User function wrapper for definition of SYRTHES couplings
173
*
174
* Fortran Interface:
175
*
176
* SUBROUTINE USSYRC
177
* *****************
178
*----------------------------------------------------------------------------*/
179
180
void
CS_PROCF
(
ussyrc
, USSYRC)
181
(
182
void
183
);
184
185
/*----------------------------------------------------------------------------
186
* Receive coupling variables from SYRTHES
187
*
188
* Fortran Interface:
189
*
190
* SUBROUTINE VARSYI
191
* *****************
192
*
193
* INTEGER NUMSYR : --> : Number of SYRTHES coupling
194
* INTEGER MODE : --> : 0 (surface); 1 (volume)
195
* DOUBLE PRECISION TSOLID : <-- : Solid temperature
196
*----------------------------------------------------------------------------*/
197
198
void
CS_PROCF
(
varsyi
, VARSYI)
199
(
200
cs_int_t
*numsyr,
201
cs_int_t
*mode,
202
cs_real_t
*tsolid
203
);
204
205
/*----------------------------------------------------------------------------
206
* Send coupling variables to SYRTHES
207
*
208
* Fortran Interface:
209
*
210
* SUBROUTINE VARSYO
211
* *****************
212
*
213
* INTEGER NUMSYR : --> : Number of SYRTHES coupling
214
* INTEGER MODE : --> : 0 (surface); 1 (volume)
215
* INTEGER LSTELT : --> : List of coupled elements
216
* DOUBLE PRECISION TFLUID : --> : Fluid temperature
217
* DOUBLE PRECISION HFLUID : --> : Exchange coefficient
218
*----------------------------------------------------------------------------*/
219
220
void
CS_PROCF
(
varsyo
, VARSYO)
221
(
222
cs_int_t
*numsyr,
223
cs_int_t
*mode,
224
cs_int_t
*lstelt,
225
cs_real_t
*tfluid,
226
cs_real_t
*hfluid
227
);
228
229
/*----------------------------------------------------------------------------
230
* Compute the explicit/implicit contribution to source terms in case of
231
* volume coupling with SYRTHES4
232
*
233
* Fortran Interface:
234
*
235
* SUBROUTINE CTBVSY
236
* *****************
237
*
238
* INTEGER NUMSYR : --> : Number of SYRTHES coupling
239
* DOUBLE PRECISION TFLUID : --> : Fluid temperature
240
* DOUBLE PRECISION CTBIMP : <-> : Implicit contribution
241
* DOUBLE PRECISION CTBEXP : <-> : Explicit contribution
242
*----------------------------------------------------------------------------*/
243
244
void
CS_PROCF
(
ctbvsy
, CTBVSY)
245
(
246
cs_int_t
*numsyr,
247
cs_real_t
*tfluid,
248
cs_real_t
*ctbimp,
249
cs_real_t
*ctbexp
250
);
251
252
/*============================================================================
253
* Public function prototypes
254
*============================================================================*/
255
256
/*----------------------------------------------------------------------------
257
* Define new SYRTHES coupling.
258
*
259
* In the case of a single Code_Saturne and single SYRTHES instance, the
260
* syrthes_name argument is ignored.
261
*
262
* In case of multiple couplings, a coupling will be matched with available
263
* SYRTHES instances based on the syrthes_name argument.
264
*
265
* arguments:
266
* syrthes_name <-- name of SYRTHES instance
267
* boundary_criteria <-- boundary face selection criteria, or NULL
268
* volume_criteria <-- volume cell selection criteria, or NULL
269
* projection_axis <-- 'x', 'y', or 'y' for 2D projection axis (case
270
* independent), or ' ' for standard 3D coupling
271
* allow_nonmatching <-- allow nearest-neighbor mapping where matching
272
* within tolerance is not available
273
* tolerance <-- addition to local extents of each element
274
* extent = base_extent * (1 + tolerance)
275
* verbosity <-- verbosity level
276
* visualization <-- visualization output level (0 or 1)
277
*----------------------------------------------------------------------------*/
278
279
void
280
cs_syr_coupling_define
(
const
char
*syrthes_name,
281
const
char
*boundary_criteria,
282
const
char
*volume_criteria,
283
char
projection_axis,
284
bool
allow_nonmatching,
285
float
tolerance,
286
int
verbosity,
287
int
visualization);
288
289
/*----------------------------------------------------------------------------
290
* Initialize SYRTHES couplings.
291
*
292
* This function may be called once all couplings have been defined,
293
* and it will match defined couplings with available applications.
294
*----------------------------------------------------------------------------*/
295
296
void
297
cs_syr_coupling_all_init
(
void
);
298
299
/*----------------------------------------------------------------------------
300
* Finalize all SYRTHES couplings.
301
*----------------------------------------------------------------------------*/
302
303
void
304
cs_syr_coupling_all_finalize
(
void
);
305
306
/*----------------------------------------------------------------------------
307
* Return number of SYRTHES couplings.
308
*
309
* return:
310
* number of SYRTHES couplings defined
311
*----------------------------------------------------------------------------*/
312
313
int
314
cs_syr_coupling_n_couplings
(
void
);
315
316
/*----------------------------------------------------------------------------
317
* Set conservativity forcing flag to True (1) or False (0) for all defined
318
* SYRTHES couplings
319
*
320
* parameter:
321
* flag <-- Conservativity forcing flag to set
322
*----------------------------------------------------------------------------*/
323
324
void
325
cs_syr_coupling_set_conservativity
(
int
flag);
326
327
/*----------------------------------------------------------------------------
328
* Set explicit treatment for the source terms in SYRTHES volume couplings
329
*----------------------------------------------------------------------------*/
330
331
void
332
cs_syr_coupling_set_explicit_treatment
(
void
);
333
334
/*----------------------------------------------------------------------------*/
335
336
END_C_DECLS
337
338
#endif
/* __CS_SYR_COUPLING_H__ */
Generated on Thu Feb 27 2014 19:21:34 by
1.8.3.1