9.2
general documentation
cs_convection_diffusion.h
Go to the documentation of this file.
1#ifndef CS_CONVECTION_DIFFUSION_H
2#define CS_CONVECTION_DIFFUSION_H
3
4/*============================================================================
5 * Convection-diffusion operators.
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 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#include "base/cs_defs.h"
31
32/*----------------------------------------------------------------------------
33 * Local headers
34 *----------------------------------------------------------------------------*/
35
36#include "base/cs_base.h"
37#include "base/cs_dispatch.h"
38#include "base/cs_halo.h"
39#include "base/cs_math.h"
42
43/*=============================================================================
44 * Macro definitions
45 *============================================================================*/
46
47/*============================================================================
48 * Type definition
49 *============================================================================*/
50
51/*----------------------------------------------------------------------------
52 * NVD/TVD Advection Scheme
53 *----------------------------------------------------------------------------*/
54
55typedef enum {
56
57 CS_NVD_GAMMA = 0, /* GAMMA */
58 CS_NVD_SMART = 1, /* SMART */
59 CS_NVD_CUBISTA = 2, /* CUBISTA */
60 CS_NVD_SUPERBEE = 3, /* SUPERBEE */
61 CS_NVD_MUSCL = 4, /* MUSCL */
62 CS_NVD_MINMOD = 5, /* MINMOD */
63 CS_NVD_CLAM = 6, /* CLAM */
64 CS_NVD_STOIC = 7, /* STOIC */
65 CS_NVD_OSHER = 8, /* OSHER */
66 CS_NVD_WASEB = 9, /* WASEB */
67 CS_NVD_VOF_HRIC = 10, /* M-HRIC for VOF */
68 CS_NVD_VOF_CICSAM = 11, /* M-CICSAM for VOF */
69 CS_NVD_VOF_STACS = 12, /* STACS for VOF */
70 CS_NVD_N_TYPES = 13 /* number of NVD schemes */
71
73
74/*============================================================================
75 * Global variables
76 *============================================================================*/
77
78/*=============================================================================
79 * Public function prototypes
80 *============================================================================*/
81
82/*----------------------------------------------------------------------------
83 * Return pointer to slope test indicator field values if active.
84 *
85 * parameters:
86 * f_id <-- field id (or -1)
87 * eqp <-- equation parameters
88 *
89 * return:
90 * pointer to local values array, or NULL;
91 *----------------------------------------------------------------------------*/
92
94cs_get_v_slope_test(int f_id,
95 const cs_equation_param_t eqp);
96
97/*----------------------------------------------------------------------------*/
98/*
99 * \brief Compute the beta blending coefficient of the
100 * beta limiter (ensuring preservation of a given min/max pair of values).
101 *
102 * \param[in] f_id field id
103 * \param[in] inc "not an increment" flag
104 * \param[in] rovsdt rho * volume / dt
105 */
106/*----------------------------------------------------------------------------*/
107
108void
110 int inc,
111 const cs_real_t rovsdt[]);
112
113/*----------------------------------------------------------------------------*/
114/*
115 * \brief Add the explicit part of the convection/diffusion terms of a
116 * standard transport equation of a scalar field \f$ \varia \f$.
117 *
118 * More precisely, the right hand side \f$ Rhs \f$ is updated as
119 * follows:
120 * \f[
121 * Rhs = Rhs - \sum_{\fij \in \Facei{\celli}} \left(
122 * \dot{m}_\ij \left( \varia_\fij - \varia_\celli \right)
123 * - \mu_\fij \gradv_\fij \varia \cdot \vect{S}_\ij \right)
124 * \f]
125 *
126 * Warning:
127 * - \f$ Rhs \f$ has already been initialized before calling bilsc2!
128 * - mind the sign minus
129 *
130 * Please refer to the
131 * <a href="../../theory.pdf#bilsc2"><b>bilsc2</b></a> section of the
132 * theory guide for more information.
133 *
134 * \param[in] f pointer to field, or null
135 * \param[in] eqp equation parameters
136 * \param[in] icvflb global indicator of boundary convection flux
137 * - 0 upwind scheme at all boundary faces
138 * - 1 imposed flux at some boundary faces
139 * \param[in] inc indicator
140 * - 0 when solving an increment
141 * - 1 otherwise
142 * \param[in] imasac take mass accumulation into account?
143 * \param[in] pvar solved variable
144 * \param[in] icvfli boundary face indicator array of convection flux
145 * - 0 upwind scheme
146 * - 1 imposed flux
147 * \param[in] bc_coeffs boundary condition structure for the variable
148 * \param[in] i_massflux mass flux at interior faces
149 * \param[in] b_massflux mass flux at boundary faces
150 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
151 * at interior faces for the r.h.s.
152 * \param[in] b_visc \f$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} \f$
153 * at border faces for the r.h.s.
154 * \param[in] c_weight gradient weighting for diffusion
155 * \param[in,out] rhs right hand side \f$ \vect{Rhs} \f$
156 * \param[in,out] i_flux interior flux (or nullptr)
157 * \param[in,out] b_flux boundary flux (or nullptr)
158 */
159/*----------------------------------------------------------------------------*/
160
161void
163 const cs_equation_param_t eqp,
164 int icvflb,
165 int inc,
166 int imasac,
167 const cs_real_t *pvar,
168 const int icvfli[],
169 cs_field_bc_coeffs_t *bc_coeffs,
170 const cs_real_t i_massflux[],
171 const cs_real_t b_massflux[],
172 const cs_real_t i_visc[],
173 const cs_real_t b_visc[],
174 const cs_real_t *c_weight,
175 cs_real_t *rhs,
176 cs_real_2_t i_flux[],
177 cs_real_t b_flux[]);
178
179/*----------------------------------------------------------------------------*/
180/*
181 * \brief Update face flux with convection contribution of a standard transport
182 * equation of a scalar field \f$ \varia \f$.
183 *
184 * \f[
185 * C_\ij = \dot{m}_\ij \left( \varia_\fij - \varia_\celli \right)
186 * \f]
187 *
188 * \param[in] idtvar indicator of the temporal scheme
189 * \param[in] f_id field id (or -1)
190 * \param[in] eqp equation parameters
191 * \param[in] icvflb global indicator of boundary convection flux
192 * - 0 upwind scheme at all boundary faces
193 * - 1 imposed flux at some boundary faces
194 * \param[in] inc indicator
195 * - 0 when solving an increment
196 * - 1 otherwise
197 * \param[in] imasac take mass accumulation into account?
198 * \param[in] pvar solved variable (current time step)
199 * \param[in] pvara solved variable (previous time step)
200 * \param[in] icvfli boundary face indicator array of convection flux
201 * - 0 upwind scheme
202 * - 1 imposed flux
203 * \param[in] bc_coeffs boundary condition structure for the variable
204 * \param[in] i_massflux mass flux at interior faces
205 * \param[in] b_massflux mass flux at boundary faces
206 * \param[in,out] i_conv_flux scalar convection flux at interior faces
207 * \param[in,out] b_conv_flux scalar convection flux at boundary faces
208 */
209/*----------------------------------------------------------------------------*/
210
211void
213 int f_id,
214 const cs_equation_param_t eqp,
215 int icvflb,
216 int inc,
217 int imasac,
218 cs_real_t *pvar,
219 const cs_real_t *pvara,
220 const int icvfli[],
221 cs_field_bc_coeffs_t *bc_coeffs,
222 const cs_real_t i_massflux[],
223 const cs_real_t b_massflux[],
224 cs_real_2_t i_conv_flux[],
225 cs_real_t b_conv_flux[]);
226
227/*----------------------------------------------------------------------------*/
228/*
229 * \brief Add the explicit part of the convection/diffusion terms of a transport
230 * equation of a vector field \f$ \vect{\varia} \f$.
231 *
232 * More precisely, the right hand side \f$ \vect{Rhs} \f$ is updated as
233 * follows:
234 * \f[
235 * \vect{Rhs} = \vect{Rhs} - \sum_{\fij \in \Facei{\celli}} \left(
236 * \dot{m}_\ij \left( \vect{\varia}_\fij - \vect{\varia}_\celli \right)
237 * - \mu_\fij \gradt_\fij \vect{\varia} \cdot \vect{S}_\ij \right)
238 * \f]
239 *
240 * Remark:
241 * if ivisep = 1, then we also take \f$ \mu \transpose{\gradt\vect{\varia}}
242 * + \lambda \trace{\gradt\vect{\varia}} \f$, where \f$ \lambda \f$ is
243 * the secondary viscosity, i.e. usually \f$ -\frac{2}{3} \mu \f$.
244 *
245 * Warning:
246 * - \f$ \vect{Rhs} \f$ has already been initialized before calling bilsc!
247 * - mind the sign minus
248 *
249 * \param[in] idtvar indicator of the temporal scheme
250 * \param[in] f_id index of the current variable
251 * \param[in] eqp equation parameters
252 * \param[in] icvflb global indicator of boundary convection flux
253 * - 0 upwind scheme at all boundary faces
254 * - 1 imposed flux at some boundary faces
255 * \param[in] inc indicator
256 * - 0 when solving an increment
257 * - 1 otherwise
258 * \param[in] ivisep indicator to take \f$ \divv
259 * \left(\mu \gradt \transpose{\vect{a}} \right)
260 * -2/3 \grad\left( \mu \dive \vect{a} \right)\f$
261 * - 1 take into account,
262 * - 0 otherwise
263 * \param[in] imasac take mass accumulation into account?
264 * \param[in] pvar solved velocity (current time step)
265 * \param[in] pvara solved velocity (previous time step)
266 * \param[in] icvfli boundary face indicator array of convection flux
267 * - 0 upwind scheme
268 * - 1 imposed flux
269 * \param[in] bc_coeffs boundary conditions structure for the variable
270 * \param[in] i_massflux mass flux at interior faces
271 * \param[in] b_massflux mass flux at boundary faces
272 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
273 * at interior faces for the r.h.s.
274 * \param[in] b_visc \f$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} \f$
275 * at border faces for the r.h.s.
276 * \param[in] i_secvis secondary viscosity at interior faces
277 * \param[in] b_secvis secondary viscosity at boundary faces
278 * \param[in] i_pvar velocity at interior faces
279 * \param[in] b_pvar velocity at boundary faces
280 * \param[in,out] rhs right hand side \f$ \vect{Rhs} \f$
281 */
282/*----------------------------------------------------------------------------*/
283
284void
286 int f_id,
287 const cs_equation_param_t eqp,
288 int icvflb,
289 int inc,
290 int ivisep,
291 int imasac,
292 cs_real_3_t *pvar,
293 const cs_real_3_t *pvara,
294 const int icvfli[],
295 cs_field_bc_coeffs_t *bc_coeffs,
296 const cs_real_t i_massflux[],
297 const cs_real_t b_massflux[],
298 const cs_real_t i_visc[],
299 const cs_real_t b_visc[],
300 const cs_real_t i_secvis[],
301 const cs_real_t b_secvis[],
302 cs_real_3_t *i_pvar,
303 cs_real_3_t *b_pvar,
304 cs_real_3_t *rhs);
305
306/*----------------------------------------------------------------------------*/
307/*
308 * \brief Add the explicit part of the convection/diffusion terms of a transport
309 * equation of a tensor field \f$ \tens{\varia} \f$.
310 *
311 * More precisely, the right hand side \f$ \tens{Rhs} \f$ is updated as
312 * follows:
313 * \f[
314 * \tens{Rhs} = \tens{Rhs} - \sum_{\fij \in \Facei{\celli}} \left(
315 * \dot{m}_\ij \left( \tens{\varia}_\fij - \tens{\varia}_\celli \right)
316 * - \mu_\fij \gradt_\fij \tens{\varia} \cdot \tens{S}_\ij \right)
317 * \f]
318 *
319 * Warning:
320 * - \f$ \tens{Rhs} \f$ has already been initialized before calling bilsc!
321 * - mind the sign minus
322 *
323 * \param[in] idtvar indicator of the temporal scheme
324 * \param[in] f_id index of the current variable
325 * \param[in] eqp equation parameters
326 * \param[in] icvflb global indicator of boundary convection flux
327 * - 0 upwind scheme at all boundary faces
328 * - 1 imposed flux at some boundary faces
329 * \param[in] inc indicator
330 * - 0 when solving an increment
331 * - 1 otherwise
332 * \param[in] imasac take mass accumulation into account?
333 * \param[in] pvar solved velocity (current time step)
334 * \param[in] pvara solved velocity (previous time step)
335 * \param[in] bc_coeffs boundary condition structure for the variable
336 * \param[in] i_massflux mass flux at interior faces
337 * \param[in] b_massflux mass flux at boundary faces
338 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
339 * at interior faces for the r.h.s.
340 * \param[in] b_visc \f$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} \f$
341 * at border faces for the r.h.s.
342 * \param[in,out] rhs right hand side \f$ \tens{Rhs} \f$
343 */
344/*----------------------------------------------------------------------------*/
345
346void
348 int f_id,
349 const cs_equation_param_t eqp,
350 int icvflb,
351 int inc,
352 int imasac,
353 cs_real_6_t *pvar,
354 const cs_real_6_t *pvara,
355 cs_field_bc_coeffs_t *bc_coeffs,
356 const cs_real_t i_massflux[],
357 const cs_real_t b_massflux[],
358 const cs_real_t i_visc[],
359 const cs_real_t b_visc[],
360 cs_real_6_t *rhs);
361
362/*----------------------------------------------------------------------------*/
363/*
364 * \brief Add the explicit part of the convection/diffusion terms of a transport
365 * equation of a scalar field \f$ \varia \f$ such as the temperature.
366 *
367 * More precisely, the right hand side \f$ Rhs \f$ is updated as
368 * follows:
369 * \f[
370 * Rhs = Rhs + \sum_{\fij \in \Facei{\celli}} \left(
371 * C_p\dot{m}_\ij \varia_\fij
372 * - \lambda_\fij \gradv_\fij \varia \cdot \vect{S}_\ij \right)
373 * \f]
374 *
375 * \warning \f$ Rhs \f$ must have been initialized before calling this function!
376 * \warning The ghost cell values of pvar must already have been synchronized.
377 *
378 * \param[in] f pointer to field, or null
379 * \param[in] eqp equation parameters)
380 * \param[in] inc indicator
381 * - 0 when solving an increment
382 * - 1 otherwise
383 * \param[in] imasac take mass accumulation into account?
384 * \param[in] pvar solved variable
385 * \param[in] bc_coeffs boundary condition structure for the variable
386 * \param[in] i_massflux mass flux at interior faces
387 * \param[in] b_massflux mass flux at boundary faces
388 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
389 * at interior faces for the r.h.s.
390 * \param[in] b_visc \f$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} \f$
391 * at border faces for the r.h.s.
392 * \param[in] c_weight gradient_weighting for diffusion
393 * \param[in] xcpp array of specific heat (\f$ C_p \f$)
394 * \param[in,out] rhs right hand side \f$ \vect{Rhs} \f$
395 */
396/*----------------------------------------------------------------------------*/
397
398void
400 const cs_equation_param_t eqp,
401 int inc,
402 int imasac,
403 const cs_real_t *pvar,
404 cs_field_bc_coeffs_t *bc_coeffs,
405 const cs_real_t i_massflux[],
406 const cs_real_t b_massflux[],
407 const cs_real_t i_visc[],
408 const cs_real_t b_visc[],
409 const cs_real_t *c_weight,
410 const cs_real_t xcpp[],
411 cs_real_t *rhs);
412
413/*----------------------------------------------------------------------------*/
414/*
415 * \brief Add the explicit part of the diffusion terms with a symmetric tensor
416 * diffusivity for a transport equation of a scalar field \f$ \varia \f$.
417 *
418 * More precisely, the right hand side \f$ Rhs \f$ is updated as
419 * follows:
420 * \f[
421 * Rhs = Rhs - \sum_{\fij \in \Facei{\celli}} \left(
422 * - \tens{\mu}_\fij \gradv_\fij \varia \cdot \vect{S}_\ij \right)
423 * \f]
424 *
425 * Warning:
426 * - \f$ Rhs \f$ has already been initialized before
427 * calling cs_anisotropic_diffusion_scalar!
428 * - mind the sign minus
429 * - the ghost cell values of pvar must already be synchronized
430 *
431 * \param[in] idtvar indicator of the temporal scheme
432 * \param[in] f_id index of the current variable
433 * \param[in] eqp equation parameters
434 * \param[in] inc indicator
435 * - 0 when solving an increment
436 * - 1 otherwise
437 * \param[in] pvar solved variable (current time step)
438 * \param[in] pvara solved variable (previous time step)
439 * \param[in] bc_coeffs boundary condition structure for the variable
440 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
441 * at interior faces for the r.h.s.
442 * \param[in] b_visc \f$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} \f$
443 * at border faces for the r.h.s.
444 * \param[in] viscel symmetric cell tensor \f$ \tens{\mu}_\celli \f$
445 * \param[in] weighf internal face weight between cells i j in case
446 * of tensor diffusion
447 * \param[in] weighb boundary face weight for cells i in case
448 * of tensor diffusion
449 * \param[in,out] rhs right hand side \f$ \vect{Rhs} \f$
450 */
451/*----------------------------------------------------------------------------*/
452
453void
455 int f_id,
456 const cs_equation_param_t eqp,
457 int inc,
458 const cs_real_t *pvar,
459 const cs_real_t *pvara,
460 cs_field_bc_coeffs_t *bc_coeffs,
461 const cs_real_t i_visc[],
462 const cs_real_t b_visc[],
463 cs_real_6_t *viscel,
464 const cs_real_2_t weighf[],
465 const cs_real_t weighb[],
466 cs_real_t *rhs);
467
468/*-----------------------------------------------------------------------------*/
469/*
470 * \brief Add explicit part of the terms of diffusion by a left-multiplying
471 * symmetric tensorial diffusivity for a transport equation of a vector field
472 * \f$ \vect{\varia} \f$.
473 *
474 * More precisely, the right hand side \f$ \vect{Rhs} \f$ is updated as
475 * follows:
476 * \f[
477 * \vect{Rhs} = \vect{Rhs} - \sum_{\fij \in \Facei{\celli}} \left(
478 * - \gradt_\fij \vect{\varia} \tens{\mu}_\fij \cdot \vect{S}_\ij \right)
479 * \f]
480 *
481 * Remark:
482 * if ivisep = 1, then we also take \f$ \mu \transpose{\gradt\vect{\varia}}
483 * + \lambda \trace{\gradt\vect{\varia}} \f$, where \f$ \lambda \f$ is
484 * the secondary viscosity, i.e. usually \f$ -\frac{2}{3} \mu \f$.
485 *
486 * Warning:
487 * - \f$ \vect{Rhs} \f$ has already been initialized before calling the present
488 * function
489 * - mind the sign minus
490 *
491 * \param[in] idtvar indicator of the temporal scheme
492 * \param[in] f_id index of the current variable
493 * \param[in] eqp equation parameters
494 * \param[in] inc indicator
495 * - 0 when solving an increment
496 * - 1 otherwise
497 * \param[in] ivisep indicator to take \f$ \divv
498 * \left(\mu \gradt \transpose{\vect{a}} \right)
499 * -2/3 \grad\left( \mu \dive \vect{a} \right)\f$
500 * - 1 take into account,
501 * \param[in] pvar solved variable (current time step)
502 * \param[in] pvara solved variable (previous time step)
503 * \param[in] bc_coeffs boundary condition structure for the variable
504 * \param[in] i_visc \f$ \tens{\mu}_\fij \dfrac{S_\fij}{\ipf\jpf} \f$
505 * at interior faces for the r.h.s.
506 * \param[in] b_visc \f$ \dfrac{S_\fib}{\ipf \centf} \f$
507 * at border faces for the r.h.s.
508 * \param[in] i_secvis secondary viscosity at interior faces
509 * \param[in,out] rhs right hand side \f$ \vect{Rhs} \f$
510 */
511/*----------------------------------------------------------------------------*/
512
513void
515 int f_id,
516 const cs_equation_param_t eqp,
517 int inc,
518 int ivisep,
519 cs_real_3_t *pvar,
520 const cs_real_3_t *pvara,
521 cs_field_bc_coeffs_t *bc_coeffs,
522 const cs_real_33_t i_visc[],
523 const cs_real_t b_visc[],
524 const cs_real_t i_secvis[],
525 cs_real_3_t *rhs);
526
527/*-----------------------------------------------------------------------------*/
528/*
529 * \brief Add explicit part of the terms of diffusion by a right-multiplying
530 * symmetric tensorial diffusivity for a transport equation of a vector field
531 * \f$ \vect{\varia} \f$.
532 *
533 * More precisely, the right hand side \f$ \vect{Rhs} \f$ is updated as
534 * follows:
535 * \f[
536 * \vect{Rhs} = \vect{Rhs} - \sum_{\fij \in \Facei{\celli}} \left(
537 * - \gradt_\fij \vect{\varia} \tens{\mu}_\fij \cdot \vect{S}_\ij \right)
538 * \f]
539 *
540 * Warning:
541 * - \f$ \vect{Rhs} \f$ has already been initialized before calling the present
542 * function
543 * - mind the sign minus
544 *
545 * \param[in] idtvar indicator of the temporal scheme
546 * \param[in] f_id index of the current variable
547 * \param[in] eqp equation parameters
548 * \param[in] inc indicator
549 * - 0 when solving an increment
550 * - 1 otherwise
551 * \param[in] pvar solved variable (current time step)
552 * \param[in] pvara solved variable (previous time step)
553 * \param[in] bc_coeffs boundary condition structure for the variable
554 * \param[in] i_visc \f$ \tens{\mu}_\fij \dfrac{S_\fij}{\ipf\jpf} \f$
555 * at interior faces for the r.h.s.
556 * \param[in] b_visc \f$ \dfrac{S_\fib}{\ipf \centf} \f$
557 * at border faces for the r.h.s.
558 * \param[in] viscel symmetric cell tensor \f$ \tens{\mu}_\celli \f$
559 * \param[in] weighf internal face weight between cells i j in case
560 * of tensor diffusion
561 * \param[in] weighb boundary face weight for cells i in case
562 * of tensor diffusion
563 * \param[in,out] rhs right hand side \f$ \vect{Rhs} \f$
564 */
565/*----------------------------------------------------------------------------*/
566
567void
569 int f_id,
570 const cs_equation_param_t eqp,
571 int inc,
572 cs_real_3_t *pvar,
573 const cs_real_3_t *pvara,
574 cs_field_bc_coeffs_t *bc_coeffs,
575 const cs_real_t i_visc[],
576 const cs_real_t b_visc[],
577 cs_real_6_t *viscel,
578 const cs_real_2_t weighf[],
579 const cs_real_t weighb[],
580 cs_real_3_t *rhs);
581
582/*----------------------------------------------------------------------------*/
583/*
584 * \brief Add the explicit part of the diffusion terms with a symmetric tensor
585 * diffusivity for a transport equation of a scalar field \f$ \varia \f$.
586 *
587 * More precisely, the right hand side \f$ Rhs \f$ is updated as
588 * follows:
589 * \f[
590 * Rhs = Rhs - \sum_{\fij \in \Facei{\celli}} \left(
591 * - \tens{\mu}_\fij \gradv_\fij \varia \cdot \vect{S}_\ij \right)
592 * \f]
593 *
594 * Warning:
595 * - \f$ Rhs \f$ has already been initialized before
596 * calling cs_anisotropic_diffusion_scalar!
597 * - mind the sign minus
598 *
599 * \param[in] idtvar indicator of the temporal scheme
600 * \param[in] f_id index of the current variable
601 * \param[in] eqp equation parameters
602 * \param[in] inc indicator
603 * - 0 when solving an increment
604 * - 1 otherwise
605 * \param[in] pvar solved variable (current time step)
606 * \param[in] pvara solved variable (previous time step)
607 * \param[in] bc_coeffs boundary condition structure for the variable
608 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
609 * at interior faces for the r.h.s.
610 * \param[in] b_visc \f$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} \f$
611 * at border faces for the r.h.s.
612 * \param[in] viscel symmetric cell tensor \f$ \tens{\mu}_\celli \f$
613 * \param[in] weighf internal face weight between cells i j in case
614 * of tensor diffusion
615 * \param[in] weighb boundary face weight for cells i in case
616 * of tensor diffusion
617 * \param[in,out] rhs right hand side \f$ \vect{Rhs} \f$
618 */
619/*----------------------------------------------------------------------------*/
620
621void
623 int f_id,
624 const cs_equation_param_t eqp,
625 int inc,
626 cs_real_6_t *pvar,
627 const cs_real_6_t *pvara,
628 cs_field_bc_coeffs_t *bc_coeffs,
629 const cs_real_t i_visc[],
630 const cs_real_t b_visc[],
631 cs_real_6_t *viscel,
632 const cs_real_2_t weighf[],
633 const cs_real_t weighb[],
634 cs_real_6_t *rhs);
635
636/*----------------------------------------------------------------------------*/
637/*
638 * \brief Update the face mass flux with the face pressure (or pressure
639 * increment, or pressure double increment) gradient.
640 *
641 * \f[
642 * \dot{m}_\ij = \dot{m}_\ij
643 * - \Delta t \grad_\fij \delta p \cdot \vect{S}_\ij
644 * \f]
645 *
646 * Please refer to the
647 * <a href="../../theory.pdf#cs_face_diffusion_potential">
648 <b>cs_face_diffusion_potential/cs_diffusion_potential</b></a>
649 * section of the theory guide for more information.
650 *
651 * \param[in] f pointer to field or nullptr
652 * \param[in] eqp equation parameters
653 * \param[in] m pointer to mesh
654 * \param[in] fvq pointer to finite volume quantities
655 * \param[in] init indicator
656 * - 1 initialize the mass flux to 0
657 * - 0 otherwise
658 * \param[in] inc indicator
659 * - 0 when solving an increment
660 * - 1 otherwise
661 * \param[in] iphydp hydrostatic pressure indicator
662 * \param[in] frcxt body force creating the hydrostatic pressure
663 * \param[in] pvar solved variable (current time step)
664 * \param[in] bc_coeffs boundary condition structure for the variable
665 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
666 * at interior faces for the r.h.s.
667 * \param[in] b_visc \f$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} \f$
668 * at border faces for the r.h.s.
669 * \param[in] visel viscosity by cell
670 * \param[in,out] i_massflux mass flux at interior faces
671 * \param[in,out] b_massflux mass flux at boundary faces
672 */
673/*----------------------------------------------------------------------------*/
674
675void
677 const cs_equation_param_t *eqp,
678 const cs_mesh_t *m,
680 int init,
681 int inc,
682 int iphydp,
683 cs_real_3_t *frcxt,
684 cs_real_t *pvar,
685 cs_field_bc_coeffs_t *bc_coeffs,
686 const cs_real_t i_visc[],
687 const cs_real_t b_visc[],
688 cs_real_t *visel,
689 cs_real_t *i_massflux,
690 cs_real_t *b_massflux);
691
692/*----------------------------------------------------------------------------*/
693/*
694 * \brief Add the explicit part of the pressure gradient term to the mass flux
695 * in case of anisotropic diffusion of the pressure field \f$ P \f$.
696 *
697 * More precisely, the mass flux side \f$ \dot{m}_\fij \f$ is updated as
698 * follows:
699 * \f[
700 * \dot{m}_\fij = \dot{m}_\fij -
701 * \left( \tens{\mu}_\fij \gradv_\fij P \cdot \vect{S}_\ij \right)
702 * \f]
703 *
704 * \param[in] f pointer to field or nullptr
705 * \param[in] eqp equation parameters
706 * \param[in] m pointer to mesh
707 * \param[in] fvq pointer to finite volume quantities
708 * \param[in] init indicator
709 * - 1 initialize the mass flux to 0
710 * - 0 otherwise
711 * \param[in] inc indicator
712 * - 0 when solving an increment
713 * - 1 otherwise
714 * \param[in] iphydp indicator
715 * - 1 hydrostatic pressure taken into account
716 * - 0 otherwise
717 * \param[in] frcxt body force creating the hydrostatic pressure
718 * \param[in] pvar solved variable (pressure)
719 * \param[in] bc_coeffs boundary condition structure for the variable
720 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
721 * at interior faces for the r.h.s.
722 * \param[in] b_visc \f$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} \f$
723 * at border faces for the r.h.s.
724 * \param[in] viscel symmetric cell tensor \f$ \tens{\mu}_\celli \f$
725 * \param[in] weighf internal face weight between cells i j in case
726 * of tensor diffusion
727 * \param[in] weighb boundary face weight for cells i in case
728 * of tensor diffusion
729 * \param[in,out] i_massflux mass flux at interior faces
730 * \param[in,out] b_massflux mass flux at boundary faces
731 */
732/*----------------------------------------------------------------------------*/
733
734void
736(
737 const cs_field_t *f,
738 const cs_equation_param_t *eqp,
739 const cs_mesh_t *m,
741 int init,
742 int inc,
743 int iphydp,
744 cs_real_3_t *frcxt,
745 cs_real_t *pvar,
746 cs_field_bc_coeffs_t *bc_coeffs,
747 const cs_real_t i_visc[],
748 const cs_real_t b_visc[],
749 cs_real_6_t *viscel,
750 const cs_real_2_t weighf[],
751 const cs_real_t weighb[],
752 cs_real_t *i_massflux,
753 cs_real_t *b_massflux
754);
755
756/*----------------------------------------------------------------------------*/
757/*
758 * \brief Update the cell mass flux divergence with the face pressure (or
759 * pressure increment, or pressure double increment) gradient.
760 *
761 * \f[
762 * \dot{m}_\ij = \dot{m}_\ij
763 * - \sum_j \Delta t \grad_\fij p \cdot \vect{S}_\ij
764 * \f]
765 *
766 * \param[in] f pointer to field or nullptr
767 * \param[in] eqp equation parameters
768 * \param[in] m pointer to mesh
769 * \param[in] fvq pointer to finite volume quantities
770 * \param[in] init indicator
771 * - 1 initialize the mass flux to 0
772 * - 0 otherwise
773 * \param[in] inc indicator
774 * - 0 when solving an increment
775 * - 1 otherwise
776 * \param[in] iphydp hydrostatic pressure indicator
777 * \param[in] frcxt body force creating the hydrostatic pressure
778 * \param[in] pvar solved variable (current time step)
779 * \param[in] bc_coeffs boundary condition structure for the variable
780 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
781 * at interior faces for the r.h.s.
782 * \param[in] b_visc \f$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} \f$
783 * at border faces for the r.h.s.
784 * \param[in] visel viscosity by cell
785 * \param[in,out] diverg mass flux divergence
786 */
787/*----------------------------------------------------------------------------*/
788
789void
791 const cs_equation_param_t *eqp,
792 const cs_mesh_t *m,
794 int init,
795 int inc,
796 int iphydp,
797 cs_real_3_t *frcxt,
798 cs_real_t *pvar,
799 cs_field_bc_coeffs_t *bc_coeffs,
800 const cs_real_t i_visc[],
801 const cs_real_t b_visc[],
802 cs_real_t visel[],
803 cs_real_t *diverg);
804
805/*----------------------------------------------------------------------------*/
806/*
807 * \brief Add the explicit part of the divergence of the mass flux due to the
808 * pressure gradient (analog to cs_anisotropic_diffusion_scalar).
809 *
810 * More precisely, the divergence of the mass flux side
811 * \f$ \sum_{\fij \in \Facei{\celli}} \dot{m}_\fij \f$ is updated as follows:
812 * \f[
813 * \sum_{\fij \in \Facei{\celli}} \dot{m}_\fij
814 * = \sum_{\fij \in \Facei{\celli}} \dot{m}_\fij
815 * - \sum_{\fij \in \Facei{\celli}}
816 * \left( \tens{\mu}_\fij \gradv_\fij P \cdot \vect{S}_\ij \right)
817 * \f]
818 *
819 * \param[in] f pointer to field or nullptr
820 * \param[in] eqp equation parameters
821 * \param[in] m pointer to mesh
822 * \param[in] fvq pointer to finite volume quantities
823 * \param[in] init indicator
824 * - 1 initialize the mass flux to 0
825 * - 0 otherwise
826 * \param[in] inc indicator
827 * - 0 when solving an increment
828 * - 1 otherwise
829 * \param[in] iphydp indicator
830 * - 1 hydrostatic pressure taken into account
831 * - 0 otherwise
832 * \param[in] frcxt body force creating the hydrostatic pressure
833 * \param[in] pvar solved variable (pressure)
834 * \param[in] bc_coeffs boundary condition structure for the variable
835 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
836 * at interior faces for the r.h.s.
837 * \param[in] b_visc \f$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} \f$
838 * at border faces for the r.h.s.
839 * \param[in] viscel symmetric cell tensor \f$ \tens{\mu}_\celli \f$
840 * \param[in] weighf internal face weight between cells i j in case
841 * of tensor diffusion
842 * \param[in] weighb boundary face weight for cells i in case
843 * of tensor diffusion
844 * \param[in,out] diverg divergence of the mass flux
845 */
846/*----------------------------------------------------------------------------*/
847
848void
850 const cs_equation_param_t *eqp,
851 const cs_mesh_t *m,
853 int init,
854 int inc,
855 int iphydp,
856 cs_real_3_t *restrict frcxt,
857 cs_real_t *restrict pvar,
858 cs_field_bc_coeffs_t *bc_coeffs,
859 const cs_real_t i_visc[],
860 const cs_real_t b_visc[],
861 cs_real_6_t *restrict viscel,
862 const cs_real_2_t weighf[],
863 const cs_real_t weighb[],
864 cs_real_t *restrict diverg);
865
866/*----------------------------------------------------------------------------*/
867/*
868 * \brief Compute the upwind gradient used in the slope tests.
869 *
870 * This function assumes the input gradient and pvar values have already
871 * been synchronized.
872 *
873 * \param[in] f_id field id
874 * \param[in] ctx Reference to dispatch context
875 * \param[in] grad standard gradient
876 * \param[out] grdpa upwind gradient
877 * \param[in] pvar values
878 * \param[in] val_f face values for gradient
879 * \param[in] i_massflux mass flux at interior faces
880 */
881/*----------------------------------------------------------------------------*/
882
883template <typename T>
884void
887 const T (*grad)[3],
888 T (*grdpa)[3],
889 const cs_real_t *pvar,
890 const cs_real_t val_f[],
891 const cs_real_t *i_massflux);
892
893/*----------------------------------------------------------------------------*/
894/*
895 * \brief Compute the upwind gradient used in the slope tests.
896 *
897 * template parameters:
898 * stride 1 for scalars, 3 for vectors, 6 for symmetric tensors
899 *
900 * This function assumes the input gradient and pvar values have already
901 * been synchronized.
902 *
903 * \param[in] ctx Reference to dispatch context
904 * \param[in] grad standard gradient
905 * \param[out] grdpa upwind gradient
906 * \param[in] pvar values
907 * \param[in] val_f face values for gradient
908 * \param[in] i_massflux mass flux at interior faces
909 */
910/*----------------------------------------------------------------------------*/
911
912template <cs_lnum_t stride, typename T>
913void
916 const T grad[][stride][3],
917 T (*restrict grdpa)[stride][3],
918 const cs_real_t pvar[][stride],
919 const cs_real_t val_f[][stride],
920 const cs_real_t *i_massflux);
921
922/*----------------------------------------------------------------------------*/
923/*
924 * \brief Compute the upwind gradient used in the pure SOLU schemes
925 * (observed in the litterature).
926 *
927 * \param[in] ctx Reference to dispatch context
928 * \param[in] inc Not an increment flag
929 * \param[in] halo_type halo type
930 * \param[in] bc_coeffs boundary condition structure for the variable
931 * \param[in] i_massflux mass flux at interior faces
932 * \param[in] b_massflux mass flux at boundary faces
933 * \param[in] pvar values
934 * \param[out] grdpa upwind gradient
935 */
936/*----------------------------------------------------------------------------*/
937
938template <typename T>
939void
941 const int inc,
942 const cs_halo_type_t halo_type,
943 const cs_field_bc_coeffs_t *bc_coeffs,
944 const cs_real_t i_massflux[],
945 const cs_real_t b_massflux[],
946 const cs_real_t *pvar,
947 T (*grdpa)[3]);
948
949/*----------------------------------------------------------------------------*/
950/*
951 * \brief Compute the upwind gradient used in the pure SOLU schemes
952 * (observed in the litterature) for a vector
953 *
954 * \param[in] ctx Reference to dispatch context
955 * \param[in] inc Not an increment flag
956 * \param[in] halo_type halo type
957 * \param[in] bc_coeffs boundary condition structure for the variable
958 * \param[in] i_massflux mass flux at interior faces
959 * \param[in] b_massflux mass flux at boundary faces
960 * \param[in] pvar values
961 * \param[out] grdpa upwind gradient
962 */
963/*----------------------------------------------------------------------------*/
964
965template <cs_lnum_t stride, typename T>
966void
968 const int inc,
969 const cs_halo_type_t halo_type,
970 const cs_field_bc_coeffs_t *bc_coeffs,
971 const cs_real_t i_massflux[],
972 const cs_real_t b_massflux[],
973 const cs_real_t *restrict pvar[stride],
974 T (*restrict grdpa)[stride][3]);
975
976/*----------------------------------------------------------------------------
977 * Compute the local cell Courant number as the maximum of all cell face based
978 * Courant number at each cell.
979 *
980 * parameters:
981 * f <-- pointer to field
982 * ctx <-- reference to dispatch context
983 * courant --> cell Courant number
984 */
985/*----------------------------------------------------------------------------*/
986
987void
990 cs_real_t *courant);
991
992/*----------------------------------------------------------------------------*/
993/*
994 * \brief Compute balance contribution of the transpose grad(vel) term
995 * and grad(-2/3 div(vel))
996 *
997 * Compute \f$ \mu \transpose{\gradt\vect{\varia}}
998 * + \lambda \trace{\gradt\vect{\varia}} \f$, where \f$ \lambda \f$ is
999 * the secondary viscosity, i.e. usually \f$ -\frac{2}{3} \mu \f$.
1000 *
1001 * \warning
1002 * - \f$ \vect{Rhs} \f$ must already have been initialized.
1003 * - mind the minus sign
1004 *
1005 * \param[in, out] ctx reference to dispatch context
1006 * \param[in] m pointer to mesh structure
1007 * \param[in] mq pointer to mesh quantities
1008 * \param[in] thetap theta-scheme value
1009 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
1010 * at interior faces for the r.h.s.
1011 * \param[in] i_secvis secondary viscosity at interior faces
1012 * \param[in] b_secvis secondary viscosity at boundary faces
1013 * \param[in] gradv velocity gradient
1014 * \param[in, out] rhs right hand side \f$ \vect{Rhs} \f$
1015 */
1016/*----------------------------------------------------------------------------*/
1017
1018void
1020(
1022 const cs_mesh_t *m,
1023 const cs_mesh_quantities_t *mq,
1024 cs_real_t thetap,
1025 const cs_real_t i_visc[],
1026 const cs_real_t i_secvis[],
1027 const cs_real_t b_secvis[],
1028 const cs_rreal_t gradv[][3][3],
1030);
1031
1032/*----------------------------------------------------------------------------*/
1033/*
1034 * \brief Compute balance contribution of the transpose grad(vel) term
1035 * and grad(-2/3 div(vel)) with anisotropic
1036 *
1037 * Compute \f$ \mu \transpose{\gradt\vect{\varia}}
1038 * + \lambda \trace{\gradt\vect{\varia}} \f$, where \f$ \lambda \f$ is
1039 * the secondary viscosity, i.e. usually \f$ -\frac{2}{3} \mu \f$.
1040 *
1041 * \warning
1042 * - \f$ \vect{Rhs} \f$ must already have been initialized.
1043 * - mind the minus sign
1044 *
1045 * \param[in, out] ctx reference to dispatch context
1046 * \param[in] m pointer to mesh structure
1047 * \param[in] mq pointer to mesh quantities
1048 * \param[in] i_visc \f$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} \f$
1049 * at interior faces for the r.h.s.
1050 * \param[in] i_secvis secondary viscosity at interior faces
1051 * \param[in] b_secvis secondary viscosity at boundary faces
1052 * \param[in] gradv velocity gradient
1053 * \param[in, out] rhs right hand side \f$ \vect{Rhs} \f$
1054 */
1055/*----------------------------------------------------------------------------*/
1056
1057void
1059(
1061 const cs_mesh_t *m,
1062 const cs_mesh_quantities_t *mq,
1063 const cs_real_33_t i_visc[],
1064 const cs_real_t i_secvis[],
1065 const cs_real_t gradv[][3][3],
1067);
1068
1069/*----------------------------------------------------------------------------*/
1070/*
1071 * \brief Query convection-diffusion scheme variants.
1072 *
1073 * \return specific scheme (i.e. 90 for v9.0) or -1 for current.
1074 */
1075/*----------------------------------------------------------------------------*/
1076
1077int
1079
1080/*----------------------------------------------------------------------------*/
1081/*
1082 * \brief Allow reverting to older convection-diffusion scheme variants.
1083 *
1084 * \param[in] version Scheme version (90 for v9.0) -1 for current)
1085 */
1086/*----------------------------------------------------------------------------*/
1087
1088void
1090
1091/*----------------------------------------------------------------------------*/
1092
1093#endif /* CS_CONVECTION_DIFFUSION_H */
Definition: cs_dispatch.h:2288
Field boundary condition descriptor (for variables)
Definition: cs_field.h:107
Field descriptor.
Definition: cs_field.h:275
void cs_convection_diffusion_secvis(cs_dispatch_context &ctx, const cs_mesh_t *m, const cs_mesh_quantities_t *mq, cs_real_t thetap, const cs_real_t i_visc[], const cs_real_t i_secvis[], const cs_real_t b_secvis[], const cs_rreal_t gradv[][3][3], cs_real_3_t *restrict rhs)
Compute balance contribution of the transpose grad(vel) term and grad(-2/3 div(vel))
Definition: cs_convection_diffusion.cpp:5318
void cs_anisotropic_diffusion_tensor(int idtvar, int f_id, const cs_equation_param_t eqp, int inc, cs_real_6_t *pvar, const cs_real_6_t *pvara, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_6_t *rhs)
void cs_upwind_gradient_strided(cs_dispatch_context &ctx, const int inc, const cs_halo_type_t halo_type, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t *restrict pvar[stride], T(*restrict grdpa)[stride][3])
void cs_anisotropic_diffusion_scalar(int idtvar, int f_id, const cs_equation_param_t eqp, int inc, const cs_real_t *pvar, const cs_real_t *pvara, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_t *rhs)
void cs_anisotropic_left_diffusion_vector(int idtvar, int f_id, const cs_equation_param_t eqp, int inc, int ivisep, cs_real_3_t *pvar, const cs_real_3_t *pvara, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_33_t i_visc[], const cs_real_t b_visc[], const cs_real_t i_secvis[], cs_real_3_t *rhs)
void cs_convection_diffusion_thermal(const cs_field_t *f, const cs_equation_param_t eqp, int inc, int imasac, const cs_real_t *pvar, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t *c_weight, const cs_real_t xcpp[], cs_real_t *rhs)
void cs_upwind_gradient(cs_dispatch_context &ctx, const int inc, const cs_halo_type_t halo_type, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t *pvar, T(*grdpa)[3])
cs_real_t * cs_get_v_slope_test(int f_id, const cs_equation_param_t eqp)
Definition: cs_convection_diffusion.cpp:4866
void cs_anisotropic_diffusion_potential(const cs_field_t *f, const cs_equation_param_t *eqp, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int iphydp, cs_real_3_t *restrict frcxt, cs_real_t *restrict pvar, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *restrict viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_t *restrict diverg)
Add the explicit part of the divergence of the mass flux due to the pressure gradient (analog to cs_a...
Definition: cs_convection_diffusion.cpp:9039
void cs_face_convection_scalar(int idtvar, int f_id, const cs_equation_param_t eqp, int icvflb, int inc, int imasac, cs_real_t *pvar, const cs_real_t *pvara, const int icvfli[], cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_massflux[], const cs_real_t b_massflux[], cs_real_2_t i_conv_flux[], cs_real_t b_conv_flux[])
void cs_slope_test_gradient(int f_id, cs_dispatch_context &ctx, const T(*grad)[3], T(*grdpa)[3], const cs_real_t *pvar, const cs_real_t val_f[], const cs_real_t *i_massflux)
Compute the upwind gradient used in the slope tests.
Definition: cs_convection_diffusion.cpp:9504
void cs_convection_diffusion_tensor(int idtvar, int f_id, const cs_equation_param_t eqp, int icvflb, int inc, int imasac, cs_real_6_t *pvar, const cs_real_6_t *pvara, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *rhs)
void cs_face_anisotropic_diffusion_potential(const cs_field_t *f, const cs_equation_param_t *eqp, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int iphydp, cs_real_3_t *frcxt, cs_real_t *pvar, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_t *i_massflux, cs_real_t *b_massflux)
void cs_anisotropic_right_diffusion_vector(int idtvar, int f_id, const cs_equation_param_t eqp, int inc, cs_real_3_t *pvar, const cs_real_3_t *pvara, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_3_t *rhs)
cs_nvd_type_t
Definition: cs_convection_diffusion.h:55
@ CS_NVD_SUPERBEE
Definition: cs_convection_diffusion.h:60
@ CS_NVD_SMART
Definition: cs_convection_diffusion.h:58
@ CS_NVD_CUBISTA
Definition: cs_convection_diffusion.h:59
@ CS_NVD_STOIC
Definition: cs_convection_diffusion.h:64
@ CS_NVD_WASEB
Definition: cs_convection_diffusion.h:66
@ CS_NVD_CLAM
Definition: cs_convection_diffusion.h:63
@ CS_NVD_OSHER
Definition: cs_convection_diffusion.h:65
@ CS_NVD_VOF_CICSAM
Definition: cs_convection_diffusion.h:68
@ CS_NVD_VOF_STACS
Definition: cs_convection_diffusion.h:69
@ CS_NVD_GAMMA
Definition: cs_convection_diffusion.h:57
@ CS_NVD_MINMOD
Definition: cs_convection_diffusion.h:62
@ CS_NVD_VOF_HRIC
Definition: cs_convection_diffusion.h:67
@ CS_NVD_MUSCL
Definition: cs_convection_diffusion.h:61
@ CS_NVD_N_TYPES
Definition: cs_convection_diffusion.h:70
void cs_convection_diffusion_vector(int idtvar, int f_id, const cs_equation_param_t eqp, int icvflb, int inc, int ivisep, int imasac, cs_real_3_t *pvar, const cs_real_3_t *pvara, const int icvfli[], cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t i_secvis[], const cs_real_t b_secvis[], cs_real_3_t *i_pvar, cs_real_3_t *b_pvar, cs_real_3_t *rhs)
void cs_convection_diffusion_scalar(const cs_field_t *f, const cs_equation_param_t eqp, int icvflb, int inc, int imasac, const cs_real_t *pvar, const int icvfli[], cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t *c_weight, cs_real_t *rhs, cs_real_2_t i_flux[], cs_real_t b_flux[])
void cs_diffusion_potential(const cs_field_t *f, const cs_equation_param_t *eqp, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int iphydp, cs_real_3_t *frcxt, cs_real_t *pvar, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t visel[], cs_real_t *diverg)
void cs_convection_diffusion_set_scheme_version(int version)
Allow reverting to older convection-diffusion scheme variants.
Definition: cs_convection_diffusion.cpp:10015
int cs_convection_diffusion_get_scheme_version(void)
Query convection-diffusion scheme variants.
Definition: cs_convection_diffusion.cpp:10001
void cs_beta_limiter_building(int f_id, int inc, const cs_real_t rovsdt[])
Compute the beta blending coefficient of the beta limiter (ensuring preservation of a given min/max p...
Definition: cs_convection_diffusion.cpp:4913
void cs_cell_courant_number(const cs_field_t *f, cs_dispatch_context &ctx, cs_real_t *courant)
Definition: cs_convection_diffusion.cpp:9418
void cs_convection_anisotropic_leff_diffusion_secvis(cs_dispatch_context &ctx, const cs_mesh_t *m, const cs_mesh_quantities_t *mq, const cs_real_33_t i_visc[], const cs_real_t i_secvis[], const cs_real_t gradv[][3][3], cs_real_3_t *restrict rhs)
Compute balance contribution of the transpose grad(vel) term and grad(-2/3 div(vel)) with anisotropic...
Definition: cs_convection_diffusion.cpp:5488
void cs_face_diffusion_potential(const cs_field_t *f, const cs_equation_param_t *eqp, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int iphydp, cs_real_3_t *frcxt, cs_real_t *pvar, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t *visel, cs_real_t *i_massflux, cs_real_t *b_massflux)
void cs_slope_test_gradient_strided(cs_dispatch_context &ctx, const T grad[][stride][3], T(*restrict grdpa)[stride][3], const cs_real_t pvar[][stride], const cs_real_t val_f[][stride], const cs_real_t *i_massflux)
Compute the upwind gradient used in the slope tests.
Definition: cs_convection_diffusion.cpp:9610
#define restrict
Definition: cs_defs.h:148
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:349
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition: cs_defs.h:348
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:351
double cs_rreal_t
Definition: cs_defs.h:338
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:358
cs_halo_type_t
Definition: cs_halo.h:53
integer(c_int), pointer, save idtvar
option for a variable time step
Definition: optcal.f90:70
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:190
Definition: cs_mesh_quantities.h:88
Definition: cs_mesh.h:85