1
#ifndef __CS_SYR_COUPLING_H__
2
#define __CS_SYR_COUPLING_H__
4
/*============================================================================
6
*============================================================================*/
9
This file is part of Code_Saturne, a general-purpose CFD tool.
11
Copyright (C) 1998-2011 EDF S.A.
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
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
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.
28
/*----------------------------------------------------------------------------*/
30
/*----------------------------------------------------------------------------
31
* Standard C library headers
32
*----------------------------------------------------------------------------*/
34
/*----------------------------------------------------------------------------
36
*----------------------------------------------------------------------------*/
38
/*----------------------------------------------------------------------------
40
*----------------------------------------------------------------------------*/
44
/*----------------------------------------------------------------------------
46
*----------------------------------------------------------------------------*/
50
/*----------------------------------------------------------------------------*/
54
/*=============================================================================
55
* Local Macro Definitions
56
*============================================================================*/
58
/*============================================================================
59
* Structure definition
60
*============================================================================*/
62
/*============================================================================
63
* Global variables definition
64
*============================================================================*/
66
/*============================================================================
67
* Public function prototypes for Fortran API
68
*============================================================================*/
70
/*----------------------------------------------------------------------------
71
* Get number of SYRTHES couplings.
78
* INTEGER n_couplings : <-- : number of SYRTHES couplings
79
*----------------------------------------------------------------------------*/
81
void CS_PROCF(nbcsyr, NBCSYR)
83
cs_int_t *const n_couplings
86
/*----------------------------------------------------------------------------
87
* Create nodal coupled mesh.
88
* Send vertices's coordinates and connectivity of coupled mesh.
94
*----------------------------------------------------------------------------*/
96
void CS_PROCF(geosyr, GEOSYR)
101
/*----------------------------------------------------------------------------
102
* Check if SYRTHES 3 couplings continue or if we must stop.
104
* For each SYRTHES 3 coupling, A message (stop or new iteration) is
105
* received. No iteration start message is sent, as this is done
110
* SUBROUTINE TSTSY3 (IMSFIN)
113
* INTEGER NTMABS : <-> : Maximum iteration number
114
* INTEGER NTCABS : --> : Current iteration numbern
115
*----------------------------------------------------------------------------*/
117
void CS_PROCF(tstsy3, TSTSY3)
123
/*----------------------------------------------------------------------------
124
* Synchronize new time step message for SYRTHES 3 couplings.
126
* For SYRTHES 3, it is necessary to distinguish the last iteration from
127
* other iterations (to allow for SYRTHES 3 to determine in advance that it
128
* will need to output postprocessing/restart data), so using this separate
129
* function allows it to be placed after MODPAR in the main time loop,
130
* in case NTMABS is changed by that function.
134
* SUBROUTINE ITDSY3 (NTCABS, NTMABS)
137
* INTEGER NTMABS : --> : Maximum iteration number
138
* INTEGER NTCABS : --> : Current iteration number
139
*----------------------------------------------------------------------------*/
141
void CS_PROCF(itdsy3, ITDSY3)
147
/*----------------------------------------------------------------------------
148
* Get number of boundary faces coupled with SYRTHES.
155
* INTEGER coupl_num : --> : coupling number
156
* INTEGER n_coupl_faces : <-- : number of coupled boundary faces
157
*----------------------------------------------------------------------------*/
159
void CS_PROCF(nbfsyr, NBFSYR)
161
const cs_int_t *coupl_num,
162
cs_int_t *n_coupl_faces
165
/*----------------------------------------------------------------------------
166
* Get local numbering of coupled faces
173
* INTEGER coupl_num : --> : coupling number
174
* INTEGER coupl_face_list : <-- : list of coupled boundary faces
175
*----------------------------------------------------------------------------*/
177
void CS_PROCF(lfasyr, LFASYR)
179
const cs_int_t *coupl_num,
180
fvm_lnum_t *coupl_face_list
183
/*----------------------------------------------------------------------------
184
* User function wrapper for definition of SYRTHES couplings
190
*----------------------------------------------------------------------------*/
192
void CS_PROCF (ussyrc, USSYRC)
197
/*----------------------------------------------------------------------------
198
* Receive coupling variables from SYRTHES
202
* SUBROUTINE VARSYI (NUMSYR, TWALL)
205
* INTEGER NUMSYR : --> : Number of SYRTHES coupling
206
* DOUBLE PRECISION TWALL : <-- : Wall temerature
207
*----------------------------------------------------------------------------*/
209
void CS_PROCF (varsyi, VARSYI)
215
/*----------------------------------------------------------------------------
216
* Send coupling variables to SYRTHES
220
* SUBROUTINE VARSYO (NUMSYR, TFLUID, HWALL)
223
* INTEGER NUMSYR : --> : Number of SYRTHES coupling
224
* DOUBLE PRECISION TFLUID : --> : Fluid temperature
225
* DOUBLE PRECISION HWALL : --> : Exchange coefficient
226
*----------------------------------------------------------------------------*/
228
void CS_PROCF (varsyo, VARSYO)
235
/*============================================================================
236
* Public function prototypes
237
*============================================================================*/
239
/*----------------------------------------------------------------------------
240
* Define new SYRTHES coupling.
242
* In the case of a single Code_Saturne and single SYRTHES instance, the
243
* syrthes_name argument is ignored.
245
* In case of multiple couplings, a coupling will be matched with available
246
* SYRTHES instances based on the syrthes_name argument.
249
* syrthes_name <-- name of SYRTHES instance
250
* boundary_criteria <-- boundary face selection criteria, or NULL
251
* volume_criteria <-- volume cell selection criteria, or NULL
252
* projection_axis <-- 'x', 'y', or 'y' for 2D projection axis (case
253
* independent), or ' ' for standard 3D coupling
254
* verbosity <-- verbosity level
255
* visualization <-- visualization output level (0 or 1)
256
*----------------------------------------------------------------------------*/
259
cs_syr_coupling_define(const char *syrthes_name,
260
const char *boundary_criteria,
261
const char *volume_criteria,
262
char projection_axis,
266
/*----------------------------------------------------------------------------
267
* Initialize SYRTHES couplings.
269
* This function may be called once all couplings have been defined,
270
* and it will match defined couplings with available applications.
273
* port_num <-- port number for rank 0 to enable sockets,
274
* < 0 to disable sockets
275
*----------------------------------------------------------------------------*/
278
cs_syr_coupling_all_init(int port_num);
280
/*----------------------------------------------------------------------------
281
* Finalize all SYRTHES couplings.
282
*----------------------------------------------------------------------------*/
285
cs_syr_coupling_all_finalize(void);
287
/*----------------------------------------------------------------------------*/
291
#endif /* __CS_SYR_COUPLING_H__ */