1
/*============================================================================
3
* This file is part of the Code_Saturne Kernel, element of the
4
* Code_Saturne CFD tool.
6
* Copyright (C) 1998-2009 EDF S.A., France
8
* contact: saturne-support@edf.fr
10
* The Code_Saturne Kernel is free software; you can redistribute it
11
* and/or modify it under the terms of the GNU General Public License
12
* as published by the Free Software Foundation; either version 2 of
13
* the License, or (at your option) any later version.
15
* The Code_Saturne Kernel is distributed in the hope that it will be
16
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with the Code_Saturne Kernel; if not, write to the
22
* Free Software Foundation, Inc.,
23
* 51 Franklin St, Fifth Floor,
24
* Boston, MA 02110-1301 USA
26
*============================================================================*/
28
#ifndef __CS_SYR4_COUPLING_H__
29
#define __CS_SYR4_COUPLING_H__
31
/*============================================================================
33
*============================================================================*/
35
/*----------------------------------------------------------------------------
36
* Standard C library headers
37
*----------------------------------------------------------------------------*/
39
/*----------------------------------------------------------------------------
41
*----------------------------------------------------------------------------*/
43
/*----------------------------------------------------------------------------
45
*----------------------------------------------------------------------------*/
47
/*----------------------------------------------------------------------------
49
*----------------------------------------------------------------------------*/
53
/*----------------------------------------------------------------------------*/
57
/*=============================================================================
58
* Local Macro Definitions
59
*============================================================================*/
61
/*============================================================================
62
* Structure definition
63
*============================================================================*/
65
/* Structure associated to Syrthes coupling */
67
typedef struct _cs_syr4_coupling_t cs_syr4_coupling_t;
69
/*============================================================================
70
* Global variables definition
71
*============================================================================*/
73
/*============================================================================
74
* Public function prototypes for Fortran API
75
*============================================================================*/
77
/*============================================================================
78
* Public function definitions
79
*============================================================================*/
81
/*----------------------------------------------------------------------------
82
* Get number of SYRTHES couplings.
85
* number of SYRTHES couplings
86
*----------------------------------------------------------------------------*/
89
cs_syr4_coupling_n_couplings(void);
91
/*----------------------------------------------------------------------------
92
* Get pointer to SYRTHES coupling.
95
* coupling_id <-- Id (0 to n-1) of SYRTHES coupling
98
* pointer to SYRTHES coupling structure
99
*----------------------------------------------------------------------------*/
102
cs_syr4_coupling_by_id(cs_int_t coupling_id);
104
/*----------------------------------------------------------------------------
105
* Create a syr4_coupling_t structure.
108
* dim <-- spatial mesh dimension
109
* ref_axis <-- reference axis
110
* face_sel_criterion <-- criterion for selection of boundary faces
111
* cell_sel_criterion <-- criterion for selection of cells
112
* app_num <-- SYRTHES application number, or -1
113
* app_name <-- SYRTHES application name, or NULL
114
* verbosity <-- verbosity level
115
*----------------------------------------------------------------------------*/
118
cs_syr4_coupling_add(fvm_lnum_t dim,
120
const char *face_sel_criterion,
121
const char *cell_sel_criterion,
123
const char *app_name,
126
/*----------------------------------------------------------------------------
127
* Destroy cs_syr4_coupling_t structures
128
*----------------------------------------------------------------------------*/
131
cs_syr4_coupling_all_destroy(void);
133
/*----------------------------------------------------------------------------
134
* Initialize communicator for SYRTHES coupling
137
* syr_coupling <-> Syrthes coupling structure
138
* coupling_id <-- id of this coupling (for log file message)
139
* syr_root_rank <-- SYRTHES root rank
140
* n_syr_ranks <-- Number of ranks associated with SYRTHES
141
*----------------------------------------------------------------------------*/
144
cs_syr4_coupling_init_comm(cs_syr4_coupling_t *syr_coupling,
149
/*----------------------------------------------------------------------------
150
* Exchange new iteration or stop message with SYRTHES.
152
* If nt_cur_abs < nt_max_abs, a new iteration message is sent;
153
* otherwise, a stop message is sent. A corresponding message
154
* is received, and if it is a stop message, nt_max_abs is
158
* nt_cur_abs <-- current iteration number
159
* nt_max_abs <-> maximum iteration number
160
*----------------------------------------------------------------------------*/
163
cs_syr4_coupling_sync_iter(int nt_cur_abs,
166
/*----------------------------------------------------------------------------
167
* Synchronize new time step
170
* nt_cur_abs <-- current iteration number
171
* nt_max_abs --> maximum iteration number
172
*----------------------------------------------------------------------------*/
175
cs_syr4_coupling_new_time_step(int nt_cur_abs,
178
/*----------------------------------------------------------------------------
179
* Define coupled mesh and send it to SYRTHES
182
* syr_coupling <-- SYRTHES coupling structure
183
*----------------------------------------------------------------------------*/
186
cs_syr4_coupling_init_mesh(cs_syr4_coupling_t *syr_coupling);
188
/*----------------------------------------------------------------------------
189
* Get number of associated coupled faces in main mesh
192
* syr_coupling <-- SYRTHES coupling structure
195
* number of vertices in coupled mesh
196
*----------------------------------------------------------------------------*/
199
cs_syr4_coupling_get_n_faces(const cs_syr4_coupling_t *syr_coupling);
201
/*----------------------------------------------------------------------------
202
* Get local numbering of coupled faces
205
* syr_coupling <-- SYRTHES coupling structure
206
* coupl_face_list --> List of coupled faces (1 to n)
207
*----------------------------------------------------------------------------*/
210
cs_syr4_coupling_get_face_list(const cs_syr4_coupling_t *syr_coupling,
211
cs_int_t coupl_face_list[]);
213
/*----------------------------------------------------------------------------
214
* Receive coupling variables from SYRTHES
217
* syr_coupling <-- SYRTHES coupling structure
218
* twall --> wall temperature
219
*----------------------------------------------------------------------------*/
222
cs_syr4_coupling_recv_twall(cs_syr4_coupling_t *syr_coupling,
225
/*----------------------------------------------------------------------------
226
* Send coupling variables to SYRTHES
229
* syr_coupling <-- SYRTHES coupling structure
230
* tf <-- fluid temperature
231
* hwall <-- wall heat exchange coefficient (numerical, not physical)
232
*----------------------------------------------------------------------------*/
235
cs_syr4_coupling_send_tf_hwall(cs_syr4_coupling_t *syr_coupling,
239
/*----------------------------------------------------------------------------
240
* Initialize post-processing of a SYRTHES coupling
243
* coupling_id --> Id of SYRTHES coupling
244
* writer_id --> Id of associated writer
245
*----------------------------------------------------------------------------*/
248
cs_syr4_coupling_post_init(int coupling_id,
251
/*----------------------------------------------------------------------------*/
255
#endif /* __CS_SYR4_COUPLING_H__ */