6.2
general documentation
cs_gradient_perio.h
Go to the documentation of this file.
1 #ifndef __CS_GRADIENT_PERIO_H__
2 #define __CS_GRADIENT_PERIO_H__
3 
4 /*============================================================================
5  * Gradient reconstruction.
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2020 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  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_base.h"
35 #include "cs_field.h"
36 
37 /*----------------------------------------------------------------------------*/
38 
40 
41 /*=============================================================================
42  * Local Macro definitions
43  *============================================================================*/
44 
45 /*============================================================================
46  * Type definition
47  *============================================================================*/
48 
49 /*============================================================================
50  * Global variables
51  *============================================================================*/
52 
53 /*============================================================================
54  * Public function prototypes for Fortran API
55  *============================================================================*/
56 
57 /*----------------------------------------------------------------------------
58  * Preparation rotation periodicity for Reynolds stresses.
59  *
60  * Compute an estimation of the velocity gradient.
61  * The gradient is not reconstructed (as we would need a gradient,
62  * thus periodicity). I seems possible to use a least-squares gradient.
63  *
64  * The gradient is then saved in an array representing the ghost cells, then
65  * rotated where necessary to be ready for use (cf. cs_gradient_perio_init_rij).
66  *
67  * Compute cell gradient of vector field.
68  *----------------------------------------------------------------------------*/
69 
70 void CS_PROCF (perinr, PERINR)
71 (
72  const int *const imrgra, /* <-- gradient computation mode */
73  const int *const iwarnp, /* <-- verbosity level */
74  const cs_real_t *const epsrgp, /* <-- precision for iterative gradient
75  calculation */
76  const cs_real_t *const extrap /* <-- extrapolate gradient at boundary */
77 );
78 
79 /*=============================================================================
80  * Public function prototypes
81  *============================================================================*/
82 
83 /*----------------------------------------------------------------------------
84  * Initialize gradient computation API.
85  *----------------------------------------------------------------------------*/
86 
87 void
89 
90 /*----------------------------------------------------------------------------
91  * Finalize gradient computation API.
92  *----------------------------------------------------------------------------*/
93 
94 void
96 
97 /*----------------------------------------------------------------------------
98  * Update gradient rotational periodicity computation API in case of
99  * mesh modification.
100  *----------------------------------------------------------------------------*/
101 
102 void
104 
105 /*----------------------------------------------------------------------------
106  * Initialize ghost cell values for Reynolds stress tensor gradient.
107  *
108  * We retrieve the gradient given by perinr (phyvar) for the Reynolds
109  * stress tensor in a buffer on ghost cells. then we define
110  * dpdx, dpdy and dpdz gradient (1 -> n_cells_with_ghosts).
111  *
112  * We can't implicitly take into account rotation of a gradient of a tensor
113  * variable because we have to know all components.
114  *
115  * We set idimtr to 2 for the Reynolds stress tensor.
116  *
117  * We assume that is correct to treat periodicities implicitly for the other
118  * variables when reconstructing gradients.
119  *
120  * parameters:
121  * f <-- pointer to field
122  * tr_dim --> 2 for tensor (Rij) in case of rotation, 0 otherwise
123  * grad <-> gradient of field
124  *----------------------------------------------------------------------------*/
125 
126 void
128  int *tr_dim,
129  cs_real_3_t grad[]);
130 
131 /*----------------------------------------------------------------------------*/
150 /*----------------------------------------------------------------------------*/
151 
152 void
154  cs_real_63_t grad[]);
155 
156 /*----------------------------------------------------------------------------*/
176 /*----------------------------------------------------------------------------*/
177 
178 void
180  cs_real_3_t grad[]);
181 
182 /*----------------------------------------------------------------------------*/
183 
185 
186 #endif /* __CS_GRADIENT_PERIO__ */
Field descriptor.
Definition: cs_field.h:125
void cs_gradient_perio_finalize(void)
Finalize gradient rotational periodicity computation API.
Definition: cs_gradient_perio.c:302
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
void cs_gradient_perio_update_mesh(void)
Update gradient rotational periodicity computation API in case of mesh modification.
Definition: cs_gradient_perio.c:316
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
void cs_gradient_perio_init_rij(const cs_field_t *f, int *tr_dim, cs_real_3_t grad[])
Initialize ghost cell values for Reynolds stress tensor gradient.
Definition: cs_gradient_perio.c:345
void cs_gradient_perio_process_rij(int f_id, cs_real_3_t grad[])
Process grad buffers in case of rotation on Reynolds stress tensor.
Definition: cs_gradient_perio.c:557
void cs_gradient_perio_init_rij_tensor(int *tr_dim, cs_real_63_t grad[])
Initialize ghost cell values for Reynolds stress tensor gradient.
Definition: cs_gradient_perio.c:460
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:320
#define END_C_DECLS
Definition: cs_defs.h:496
void cs_gradient_perio_initialize(void)
Initialize gradient rotational periodicity computation API.
Definition: cs_gradient_perio.c:289
#define CS_PROCF(x, y)
Definition: cs_defs.h:509
cs_real_t cs_real_63_t[6][3]
Definition: cs_defs.h:335
void perinr(const int *const imrgra, const int *const iwarnp, const cs_real_t *const epsrgp, const cs_real_t *const extrap)
Definition: cs_gradient_perio.c:192
integer(c_int), pointer, save imrgra
type of gradient reconstruction
Definition: optcal.f90:258