programmer's documentation
cs_boundary_conditions.h
Go to the documentation of this file.
1 #ifndef __CS_BOUNDARY_CONDITIONS_H__
2 #define __CS_BOUNDARY_CONDITIONS_H__
3 
4 /*============================================================================
5  * Boundary condition handling.
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2015 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_nodal.h"
39 #include "fvm_writer.h"
40 
41 #include "cs_base.h"
42 #include "cs_field.h"
43 #include "cs_mesh_location.h"
44 
45 /*----------------------------------------------------------------------------*/
46 
48 
49 /*============================================================================
50  * Macro definitions
51  *============================================================================*/
52 
53 /*============================================================================
54  * Local type definitions
55  *============================================================================*/
56 
57 /*=============================================================================
58  * Global variables
59  *============================================================================*/
60 
61 /*============================================================================
62  * Public function prototypes
63  *============================================================================*/
64 
65 /*----------------------------------------------------------------------------
66  * Handling of boundary condition definition errors and associated output.
67  *
68  * For each boundary face, bc_type defines the boundary condition type.
69  * As a convention here, zero values correspond to undefined types,
70  * positive values to defined types (with no error), and negative values
71  * to defined types with inconsistent or incompatible values, the
72  * absolute value indicating the original boundary condition type.
73  *
74  * parameters:
75  * bc_type <-- array of BC type ids
76  *----------------------------------------------------------------------------*/
77 
78 void
79 cs_boundary_conditions_error(const cs_int_t bc_type[]);
80 
81 /*----------------------------------------------------------------------------
82  * Locate shifted boundary face coordinates on possibly filtered
83  * cells or boundary faces for later interpolation.
84  *
85  * parameters:
86  * location_type <-- matching values location (CS_MESH_LOCATION_CELLS
87  * or CS_MESH_LOCATION_BOUNDARY_FACES)
88  * n_location_elts <-- number of selected location elements
89  * n_faces <-- number of selected boundary faces
90  * location_elts <-- list of selected location elements (0 to n-1),
91  * or NULL if no indirection is needed
92  * faces <-- list of selected boundary faces (0 to n-1),
93  * or NULL if no indirection is needed
94  * coord_shift <-- array of coordinates shift relative to selected
95  * boundary faces
96  * coord_stride <-- access stride in coord_shift: 0 for uniform
97  * shift, 1 for "per face" shift.
98  * tolerance <-- relative tolerance for point location.
99  *
100  * returns:
101  * associated locator structure
102  *----------------------------------------------------------------------------*/
103 
104 ple_locator_t *
106  cs_lnum_t n_location_elts,
107  cs_lnum_t n_faces,
108  const cs_lnum_t *location_elts,
109  const cs_lnum_t *faces,
110  cs_real_3_t *coord_shift,
111  int coord_stride,
112  double tolerance);
113 
114 /*----------------------------------------------------------------------------
115  * Set mapped boundary conditions for a given field and mapping locator.
116  *
117  * parameters:
118  * field <-- field whose boundary conditions are set
119  * locator <-- associated mapping locator, as returned
120  * by cs_boundary_conditions_map().
121  * location_type <-- matching values location (CS_MESH_LOCATION_CELLS or
122  * CS_MESH_LOCATION_BOUNDARY_FACES)
123  * normalize <-- normalization option:
124  * 0: values are simply mapped
125  * 1: values are mapped, then multiplied
126  * by a constant factor so that their
127  * surface integral on selected faces
128  * is preserved (relative to the
129  * input values)
130  * 2: as 1, but with a boundary-defined
131  * weight, defined by balance_w
132  * 3: as 1, but with a cell-defined
133  * weight, defined by balance_w
134  * interpolate <-- interpolation option:
135  * 0: values are simply based on matching
136  * cell or face center values
137  * 1: values are based on matching cell
138  * or face center values, corrected
139  * by gradient interpolation
140  * n_faces <-- number of selected boundary faces
141  * faces <-- list of selected boundary faces (0 to n-1),
142  * or NULL if no indirection is needed
143  * balance_w <-- optional balance weight, or NULL
144  * nvarcl <-- number of variables requiring BC's
145  * rcodcl <-> boundary condition values
146  *----------------------------------------------------------------------------*/
147 
148 void
150  ple_locator_t *locator,
151  cs_mesh_location_type_t location_type,
152  int normalize,
153  int interpolate,
154  cs_lnum_t n_faces,
155  const cs_lnum_t *faces,
156  cs_real_t *balance_w,
157  int nvarcl,
158  cs_real_t rcodcl[]);
159 
160 /*----------------------------------------------------------------------------*/
161 
163 
164 #endif /* __CS_BOUNDARY_CONDITIONS_H__ */
Field descriptor.
Definition: cs_field.h:99
cs_mesh_location_type_t
Definition: cs_mesh_location.h:60
#define BEGIN_C_DECLS
Definition: cs_defs.h:429
void cs_boundary_conditions_error(const cs_int_t bc_type[])
Handling of boundary condition definition errors and associated output.
Definition: cs_boundary_conditions.c:452
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:295
void cs_boundary_conditions_mapped_set(cs_field_t *f, ple_locator_t *locator, cs_mesh_location_type_t location_type, int normalize, int interpolate, cs_lnum_t n_faces, const cs_lnum_t *faces, cs_real_t *balance_w, int nvarcl, cs_real_t rcodcl[])
Set mapped boundary conditions for a given field and mapping locator.
Definition: cs_boundary_conditions.c:811
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:307
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
integer(c_int), pointer, save nvarcl
number of variable plus number of turbulent fluxes (used by the boundary conditions) ...
Definition: optcal.f90:657
#define END_C_DECLS
Definition: cs_defs.h:430
double cs_real_t
Definition: cs_defs.h:296
ple_locator_t * cs_boundary_conditions_map(cs_mesh_location_type_t location_type, cs_lnum_t n_location_elts, cs_lnum_t n_faces, const cs_lnum_t *location_elts, const cs_lnum_t *faces, cs_real_3_t *coord_shift, int coord_stride, double tolerance)
Locate shifted boundary face coordinates on possibly filtered cells or boundary faces for later inter...
Definition: cs_boundary_conditions.c:651