7.0
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-2021 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 );
77 
78 /*=============================================================================
79  * Public function prototypes
80  *============================================================================*/
81 
82 /*----------------------------------------------------------------------------
83  * Initialize gradient computation API.
84  *----------------------------------------------------------------------------*/
85 
86 void
88 
89 /*----------------------------------------------------------------------------
90  * Finalize gradient computation API.
91  *----------------------------------------------------------------------------*/
92 
93 void
95 
96 /*----------------------------------------------------------------------------
97  * Update gradient rotational periodicity computation API in case of
98  * mesh modification.
99  *----------------------------------------------------------------------------*/
100 
101 void
103 
104 /*----------------------------------------------------------------------------
105  * Initialize ghost cell values for Reynolds stress tensor gradient.
106  *
107  * We retrieve the gradient given by perinr (phyvar) for the Reynolds
108  * stress tensor in a buffer on ghost cells. then we define
109  * dpdx, dpdy and dpdz gradient (1 -> n_cells_with_ghosts).
110  *
111  * We can't implicitly take into account rotation of a gradient of a tensor
112  * variable because we have to know all components.
113  *
114  * We set idimtr to 2 for the Reynolds stress tensor.
115  *
116  * We assume that is correct to treat periodicities implicitly for the other
117  * variables when reconstructing gradients.
118  *
119  * parameters:
120  * f <-- pointer to field
121  * tr_dim --> 2 for tensor (Rij) in case of rotation, 0 otherwise
122  * grad <-> gradient of field
123  *----------------------------------------------------------------------------*/
124 
125 void
127  int *tr_dim,
128  cs_real_3_t grad[]);
129 
130 /*----------------------------------------------------------------------------*/
149 /*----------------------------------------------------------------------------*/
150 
151 void
153  cs_real_63_t grad[]);
154 
155 /*----------------------------------------------------------------------------*/
175 /*----------------------------------------------------------------------------*/
176 
177 void
179  cs_real_3_t grad[]);
180 
181 /*----------------------------------------------------------------------------*/
182 
184 
185 #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:300
#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:314
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
void perinr(const int *const imrgra, const int *const iwarnp, const cs_real_t *const epsrgp)
Definition: cs_gradient_perio.c:192
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:343
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:555
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:458
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:287
#define CS_PROCF(x, y)
Definition: cs_defs.h:509
cs_real_t cs_real_63_t[6][3]
Definition: cs_defs.h:335
integer(c_int), pointer, save imrgra
type of gradient reconstruction
Definition: optcal.f90:251