~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to src/base/cs_syr_coupling.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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-2011 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
 * BFT library headers
 
36
 *----------------------------------------------------------------------------*/
 
37
 
 
38
/*----------------------------------------------------------------------------
 
39
 * FVM library headers
 
40
 *----------------------------------------------------------------------------*/
 
41
 
 
42
#include "fvm_defs.h"
 
43
 
 
44
/*----------------------------------------------------------------------------
 
45
 * Local headers
 
46
 *----------------------------------------------------------------------------*/
 
47
 
 
48
#include "cs_base.h"
 
49
 
 
50
/*----------------------------------------------------------------------------*/
 
51
 
 
52
BEGIN_C_DECLS
 
53
 
 
54
/*=============================================================================
 
55
 * Local Macro Definitions
 
56
 *============================================================================*/
 
57
 
 
58
/*============================================================================
 
59
 * Structure definition
 
60
 *============================================================================*/
 
61
 
 
62
/*============================================================================
 
63
 *  Global variables definition
 
64
 *============================================================================*/
 
65
 
 
66
/*============================================================================
 
67
 *  Public function prototypes for Fortran API
 
68
 *============================================================================*/
 
69
 
 
70
/*----------------------------------------------------------------------------
 
71
 * Get number of SYRTHES couplings.
 
72
 *
 
73
 * Fortran Interface:
 
74
 *
 
75
 * SUBROUTINE NBCSYR
 
76
 * *****************
 
77
 *
 
78
 * INTEGER          n_couplings     : <-- : number of SYRTHES couplings
 
79
 *----------------------------------------------------------------------------*/
 
80
 
 
81
void CS_PROCF(nbcsyr, NBCSYR)
 
82
(
 
83
 cs_int_t  *const n_couplings
 
84
);
 
85
 
 
86
/*----------------------------------------------------------------------------
 
87
 * Create nodal coupled mesh.
 
88
 * Send vertices's coordinates and connectivity of coupled mesh.
 
89
 *
 
90
 * Fortran Interface:
 
91
 *
 
92
 * SUBROUTINE GEOSYR
 
93
 * *****************
 
94
 *----------------------------------------------------------------------------*/
 
95
 
 
96
void CS_PROCF(geosyr, GEOSYR)
 
97
(
 
98
 void
 
99
);
 
100
 
 
101
/*----------------------------------------------------------------------------
 
102
 * Check if SYRTHES 3 couplings continue or if we must stop.
 
103
 *
 
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
 
106
 * by ITDSYR.
 
107
 *
 
108
 * Fortran Interface:
 
109
 *
 
110
 * SUBROUTINE TSTSY3 (IMSFIN)
 
111
 * *****************
 
112
 *
 
113
 * INTEGER          NTMABS      : <-> : Maximum iteration number
 
114
 * INTEGER          NTCABS      : --> : Current iteration numbern
 
115
 *----------------------------------------------------------------------------*/
 
116
 
 
117
void CS_PROCF(tstsy3, TSTSY3)
 
118
(
 
119
 cs_int_t *ntmabs,
 
120
 cs_int_t *ntcabs
 
121
);
 
122
 
 
123
/*----------------------------------------------------------------------------
 
124
 * Synchronize new time step message for SYRTHES 3 couplings.
 
125
 *
 
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.
 
131
 *
 
132
 * Fortran Interface:
 
133
 *
 
134
 * SUBROUTINE ITDSY3 (NTCABS, NTMABS)
 
135
 * *****************
 
136
 *
 
137
 * INTEGER          NTMABS      : --> : Maximum iteration number
 
138
 * INTEGER          NTCABS      : --> : Current iteration number
 
139
 *----------------------------------------------------------------------------*/
 
140
 
 
141
void CS_PROCF(itdsy3, ITDSY3)
 
142
(
 
143
 cs_int_t   *ntcabs,
 
144
 cs_int_t   *ntmabs
 
145
);
 
146
 
 
147
/*----------------------------------------------------------------------------
 
148
 * Get number of boundary faces coupled with SYRTHES.
 
149
 *
 
150
 * Fortran Interface:
 
151
 *
 
152
 * SUBROUTINE NBFSYR
 
153
 * *****************
 
154
 *
 
155
 * INTEGER          coupl_num       : --> : coupling number
 
156
 * INTEGER          n_coupl_faces   : <-- : number of coupled boundary faces
 
157
 *----------------------------------------------------------------------------*/
 
158
 
 
159
void CS_PROCF(nbfsyr, NBFSYR)
 
160
(
 
161
 const cs_int_t  *coupl_num,
 
162
       cs_int_t  *n_coupl_faces
 
163
);
 
164
 
 
165
/*----------------------------------------------------------------------------
 
166
 * Get local numbering of coupled faces
 
167
 *
 
168
 * Fortran interface:
 
169
 *
 
170
 * SUBROUTINE LFASYR
 
171
 * *****************
 
172
 *
 
173
 * INTEGER      coupl_num       : --> : coupling number
 
174
 * INTEGER      coupl_face_list : <-- : list of coupled boundary faces
 
175
 *----------------------------------------------------------------------------*/
 
176
 
 
177
void CS_PROCF(lfasyr, LFASYR)
 
178
(
 
179
 const cs_int_t    *coupl_num,
 
180
       fvm_lnum_t  *coupl_face_list
 
181
);
 
182
 
 
183
/*----------------------------------------------------------------------------
 
184
 * User function wrapper for definition of SYRTHES couplings
 
185
 *
 
186
 * Fortran Interface:
 
187
 *
 
188
 * SUBROUTINE USSYRC
 
189
 * *****************
 
190
 *----------------------------------------------------------------------------*/
 
191
 
 
192
void CS_PROCF (ussyrc, USSYRC)
 
193
(
 
194
 void
 
195
);
 
196
 
 
197
/*----------------------------------------------------------------------------
 
198
 * Receive coupling variables from SYRTHES
 
199
 *
 
200
 * Fortran Interface:
 
201
 *
 
202
 * SUBROUTINE VARSYI (NUMSYR, TWALL)
 
203
 * *****************
 
204
 *
 
205
 * INTEGER          NUMSYR      : --> : Number of SYRTHES coupling
 
206
 * DOUBLE PRECISION TWALL       : <-- : Wall temerature
 
207
 *----------------------------------------------------------------------------*/
 
208
 
 
209
void CS_PROCF (varsyi, VARSYI)
 
210
(
 
211
 cs_int_t   *numsyr,
 
212
 cs_real_t  *twall
 
213
);
 
214
 
 
215
/*----------------------------------------------------------------------------
 
216
 * Send coupling variables to SYRTHES
 
217
 *
 
218
 * Fortran Interface:
 
219
 *
 
220
 * SUBROUTINE VARSYO (NUMSYR, TFLUID, HWALL)
 
221
 * *****************
 
222
 *
 
223
 * INTEGER          NUMSYR      : --> : Number of SYRTHES coupling
 
224
 * DOUBLE PRECISION TFLUID      : --> : Fluid temperature
 
225
 * DOUBLE PRECISION HWALL       : --> : Exchange coefficient
 
226
 *----------------------------------------------------------------------------*/
 
227
 
 
228
void CS_PROCF (varsyo, VARSYO)
 
229
(
 
230
 cs_int_t   *numsyr,
 
231
 cs_real_t  *tfluid,
 
232
 cs_real_t  *hwall
 
233
);
 
234
 
 
235
/*============================================================================
 
236
 * Public function prototypes
 
237
 *============================================================================*/
 
238
 
 
239
/*----------------------------------------------------------------------------
 
240
 * Define new SYRTHES coupling.
 
241
 *
 
242
 * In the case of a single Code_Saturne and single SYRTHES instance, the
 
243
 * syrthes_name argument is ignored.
 
244
 *
 
245
 * In case of multiple couplings, a coupling will be matched with available
 
246
 * SYRTHES instances based on the syrthes_name argument.
 
247
 *
 
248
 * arguments:
 
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
 *----------------------------------------------------------------------------*/
 
257
 
 
258
void
 
259
cs_syr_coupling_define(const char  *syrthes_name,
 
260
                       const char  *boundary_criteria,
 
261
                       const char  *volume_criteria,
 
262
                       char         projection_axis,
 
263
                       int          verbosity,
 
264
                       int          visualization);
 
265
 
 
266
/*----------------------------------------------------------------------------
 
267
 * Initialize SYRTHES couplings.
 
268
 *
 
269
 * This function may be called once all couplings have been defined,
 
270
 * and it will match defined couplings with available applications.
 
271
 *
 
272
 * parameters:
 
273
 *   port_num <-- port number for rank 0 to enable sockets,
 
274
 *                < 0 to disable sockets
 
275
 *----------------------------------------------------------------------------*/
 
276
 
 
277
void
 
278
cs_syr_coupling_all_init(int  port_num);
 
279
 
 
280
/*----------------------------------------------------------------------------
 
281
 * Finalize all SYRTHES couplings.
 
282
 *----------------------------------------------------------------------------*/
 
283
 
 
284
void
 
285
cs_syr_coupling_all_finalize(void);
 
286
 
 
287
/*----------------------------------------------------------------------------*/
 
288
 
 
289
END_C_DECLS
 
290
 
 
291
#endif /* __CS_SYR_COUPLING_H__ */