Convection-diffusion operators. More...
#include "cs_defs.h"#include <cmath>#include <chrono>#include <assert.h>#include <errno.h>#include <stdio.h>#include <stdarg.h>#include <string.h>#include <math.h>#include <float.h>#include "bft_error.h"#include "bft_mem.h"#include "bft_printf.h"#include "cs_array.h"#include "cs_blas.h"#include "cs_bad_cells_regularisation.h"#include "cs_boundary_conditions.h"#include "cs_dispatch.h"#include "cs_equation_param.h"#include "cs_halo.h"#include "cs_log.h"#include "cs_internal_coupling.h"#include "cs_math.h"#include "cs_mesh.h"#include "cs_field.h"#include "cs_field_default.h"#include "cs_field_operator.h"#include "cs_field_pointer.h"#include "cs_gradient.h"#include "cs_mesh_quantities.h"#include "cs_parall.h"#include "cs_parameters.h"#include "cs_porous_model.h"#include "cs_prototypes.h"#include "cs_timer.h"#include "cs_velocity_pressure.h"#include "cs_convection_diffusion.h"#include "cs_convection_diffusion_priv.h"Functions | |
| cs_real_t * | cs_get_v_slope_test (int f_id, const cs_equation_param_t eqp) |
| 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 pair of values). | |
| void | cs_convection_diffusion_scalar (int idtvar, int f_id, const cs_equation_param_t eqp, int icvflb, int inc, int imasac, cs_real_t *restrict pvar, const cs_real_t *restrict pvara, const int icvfli[], const 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_t *restrict rhs) |
| Add the explicit part of the convection/diffusion terms of a standard transport equation of a scalar field | |
| 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 *restrict pvar, const cs_real_t *restrict pvara, const int icvfli[], const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_massflux[], const cs_real_t b_massflux[], cs_real_t i_conv_flux[][2], cs_real_t b_conv_flux[]) |
| Update face flux with convection contribution of a standard transport equation of a scalar field | |
| 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 *restrict pvar, const cs_real_3_t *restrict pvara, const int icvfli[], const cs_field_bc_coeffs_t *bc_coeffs_v, 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 *restrict i_pvar, cs_real_3_t *restrict b_pvar, cs_real_3_t *restrict rhs) |
| Add the explicit part of the convection/diffusion terms of a transport equation of a vector field | |
| 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 *restrict pvar, const cs_real_6_t *restrict pvara, const cs_field_bc_coeffs_t *bc_coeffs_ts, 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 *restrict rhs) |
| Add the explicit part of the convection/diffusion terms of a transport equation of a tensor field | |
| void | cs_convection_diffusion_thermal (int idtvar, int f_id, const cs_equation_param_t eqp, int inc, int imasac, cs_real_t *restrict pvar, const cs_real_t *restrict pvara, const 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 xcpp[], cs_real_t *restrict rhs) |
| Add the explicit part of the convection/diffusion terms of a transport equation of a scalar field | |
| void | cs_anisotropic_diffusion_scalar (int idtvar, int f_id, const cs_equation_param_t eqp, int inc, cs_real_t *restrict pvar, const cs_real_t *restrict pvara, const 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 rhs) |
| Add the explicit part of the diffusion terms with a symmetric tensor diffusivity for a transport equation of a scalar field | |
| 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 *restrict pvar, const cs_real_3_t *restrict pvara, const cs_field_bc_coeffs_t *bc_coeffs_v, const cs_real_33_t i_visc[], const cs_real_t b_visc[], const cs_real_t i_secvis[], cs_real_3_t *restrict rhs) |
| Add explicit part of the terms of diffusion by a left-multiplying symmetric tensorial diffusivity for a transport equation of a vector field | |
| void | cs_anisotropic_right_diffusion_vector (int idtvar, int f_id, const cs_equation_param_t eqp, int inc, cs_real_3_t *restrict pvar, const cs_real_3_t *restrict pvara, const cs_field_bc_coeffs_t *bc_coeffs_v, 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_3_t *restrict rhs) |
| Add explicit part of the terms of diffusion by a right-multiplying symmetric tensorial diffusivity for a transport equation of a vector field | |
| void | cs_anisotropic_diffusion_tensor (int idtvar, int f_id, const cs_equation_param_t eqp, int inc, cs_real_6_t *restrict pvar, const cs_real_6_t *restrict pvara, const cs_field_bc_coeffs_t *bc_coeffs_ts, 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_6_t *restrict rhs) |
| Add the explicit part of the diffusion terms with a symmetric tensor diffusivity for a transport equation of a scalar field | |
| void | cs_face_diffusion_potential (const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int nswrgp, int imligp, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *restrict frcxt, cs_real_t *restrict pvar, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t *restrict visel, cs_real_t *restrict i_massflux, cs_real_t *restrict b_massflux) |
| Update the face mass flux with the face pressure (or pressure increment, or pressure double increment) gradient. | |
| void | cs_face_anisotropic_diffusion_potential (const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int nswrgp, int imligp, int ircflp, int ircflb, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *restrict frcxt, cs_real_t *restrict pvar, const 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 i_massflux, cs_real_t *restrict b_massflux) |
| Add the explicit part of the pressure gradient term to the mass flux in case of anisotropic diffusion of the pressure field | |
| void | cs_diffusion_potential (const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int nswrgp, int imligp, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *restrict frcxt, cs_real_t *restrict pvar, const 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 *restrict diverg) |
| Update the cell mass flux divergence with the face pressure (or pressure increment, or pressure double increment) gradient. | |
| void | cs_anisotropic_diffusion_potential (const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int nswrgp, int imligp, int ircflp, int ircflb, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *restrict frcxt, cs_real_t *restrict pvar, const 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_anisotropic_diffusion_scalar). | |
| void | cs_cell_courant_number (const cs_field_t *f, cs_dispatch_context &ctx, cs_real_t *courant) |
| void | cs_slope_test_gradient (int f_id, cs_dispatch_context &ctx, int inc, cs_halo_type_t halo_type, const cs_real_3_t *grad, cs_real_3_t *grdpa, const cs_real_t *pvar, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t *i_massflux) |
| Compute the upwind gradient used in the slope tests. | |
| void | cs_upwind_gradient (const int f_id, 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, cs_real_3_t *restrict grdpa) |
| Compute the upwind gradient used in the pure SOLU schemes (observed in the litterature). | |
Convection-diffusion operators.
Please refer to the convection-diffusion section of the theory guide for more informations.
| void cs_anisotropic_diffusion_potential | ( | const int | f_id, |
| const cs_mesh_t * | m, | ||
| cs_mesh_quantities_t * | fvq, | ||
| int | init, | ||
| int | inc, | ||
| int | imrgra, | ||
| int | nswrgp, | ||
| int | imligp, | ||
| int | ircflp, | ||
| int | ircflb, | ||
| int | iphydp, | ||
| int | iwgrp, | ||
| int | iwarnp, | ||
| double | epsrgp, | ||
| double | climgp, | ||
| cs_real_3_t *restrict | frcxt, | ||
| cs_real_t *restrict | pvar, | ||
| const 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_anisotropic_diffusion_scalar).
More precisely, the divergence of the mass flux side 
![\[\sum_{\fij \in \Facei{\celli}} \dot{m}_\fij
= \sum_{\fij \in \Facei{\celli}} \dot{m}_\fij
- \sum_{\fij \in \Facei{\celli}}
\left( \tens{\mu}_\fij \gradv_\fij P \cdot \vect{S}_\ij \right)
\]](form_31.png)
| [in] | f_id | field id (or -1) |
| [in] | m | pointer to mesh |
| [in] | fvq | pointer to finite volume quantities |
| [in] | init | indicator
|
| [in] | inc | indicator
|
| [in] | imrgra | indicator
|
| [in] | nswrgp | number of reconstruction sweeps for the gradients |
| [in] | imligp | clipping gradient method
|
| [in] | ircflp | indicator
|
| [in] | ircflb | indicator
|
| [in] | iphydp | indicator
|
| [in] | iwgrp | indicator
|
| [in] | iwarnp | verbosity |
| [in] | epsrgp | relative precision for the gradient reconstruction |
| [in] | climgp | clipping coeffecient for the computation of the gradient |
| [in] | frcxt | body force creating the hydrostatic pressure |
| [in] | pvar | solved variable (pressure) |
| [in] | bc_coeffs | boundary condition structure for the variable |
| [in] | i_visc | |
| [in] | b_visc | |
| [in] | viscel | symmetric cell tensor |
| [in] | weighf | internal face weight between cells i j in case of tensor diffusion |
| [in] | weighb | boundary face weight for cells i in case of tensor diffusion |
| [in,out] | diverg | divergence of the mass flux |
| void cs_anisotropic_diffusion_scalar | ( | int | idtvar, |
| int | f_id, | ||
| const cs_equation_param_t | eqp, | ||
| int | inc, | ||
| cs_real_t *restrict | pvar, | ||
| const cs_real_t *restrict | pvara, | ||
| const 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 | rhs ) |
Add the explicit part of the diffusion terms with a symmetric tensor diffusivity for a transport equation of a scalar field 
More precisely, the right hand side 
![\[Rhs = Rhs - \sum_{\fij \in \Facei{\celli}} \left(
- \tens{\mu}_\fij \gradv_\fij \varia \cdot \vect{S}_\ij \right)
\]](form_21.png)
Warning:

| [in] | idtvar | indicator of the temporal scheme |
| [in] | f_id | index of the current variable |
| [in] | eqp | equation parameters |
| [in] | inc | indicator
|
| [in] | pvar | solved variable (current time step) |
| [in] | pvara | solved variable (previous time step) |
| [in] | bc_coeffs | boundary condition structure for the variable |
| [in] | i_visc | |
| [in] | b_visc | |
| [in] | viscel | symmetric cell tensor |
| [in] | weighf | internal face weight between cells i j in case of tensor diffusion |
| [in] | weighb | boundary face weight for cells i in case of tensor diffusion |
| [in,out] | rhs | right hand side |
| void cs_anisotropic_diffusion_tensor | ( | int | idtvar, |
| int | f_id, | ||
| const cs_equation_param_t | eqp, | ||
| int | inc, | ||
| cs_real_6_t *restrict | pvar, | ||
| const cs_real_6_t *restrict | pvara, | ||
| const cs_field_bc_coeffs_t * | bc_coeffs_ts, | ||
| 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_6_t *restrict | rhs ) |
Add the explicit part of the diffusion terms with a symmetric tensor diffusivity for a transport equation of a scalar field 
More precisely, the right hand side 
![\[Rhs = Rhs - \sum_{\fij \in \Facei{\celli}} \left(
- \tens{\mu}_\fij \gradv_\fij \varia \cdot \vect{S}_\ij \right)
\]](form_21.png)
Warning:

| [in] | idtvar | indicator of the temporal scheme |
| [in] | f_id | index of the current variable |
| [in] | eqp | equation parameters |
| [in] | inc | indicator
|
| [in] | pvar | solved variable (current time step) |
| [in] | pvara | solved variable (previous time step) |
| [in] | bc_coeffs_ts | boundary condition structure for the variable |
| [in] | i_visc | |
| [in] | b_visc | |
| [in] | viscel | symmetric cell tensor |
| [in] | weighf | internal face weight between cells i j in case of tensor diffusion |
| [in] | weighb | boundary face weight for cells i in case of tensor diffusion |
| [in,out] | rhs | right hand side |
| 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 *restrict | pvar, | ||
| const cs_real_3_t *restrict | pvara, | ||
| const cs_field_bc_coeffs_t * | bc_coeffs_v, | ||
| const cs_real_33_t | i_visc[], | ||
| const cs_real_t | b_visc[], | ||
| const cs_real_t | i_secvis[], | ||
| cs_real_3_t *restrict | rhs ) |
Add explicit part of the terms of diffusion by a left-multiplying symmetric tensorial diffusivity for a transport equation of a vector field 
More precisely, the right hand side 
![\[\vect{Rhs} = \vect{Rhs} - \sum_{\fij \in \Facei{\celli}} \left(
- \gradt_\fij \vect{\varia} \tens{\mu}_\fij \cdot \vect{S}_\ij \right)
\]](form_22.png)
Remark: if ivisep = 1, then we also take 


Warning:

| [in] | idtvar | indicator of the temporal scheme |
| [in] | f_id | index of the current variable |
| [in] | eqp | equation parameters |
| [in] | inc | indicator
|
| [in] | ivisep | indicator to take
|
| [in] | pvar | solved variable (current time step) |
| [in] | pvara | solved variable (previous time step) |
| [in] | bc_coeffs_v | boundary condition structure for the variable |
| [in] | i_visc | |
| [in] | b_visc | |
| [in] | i_secvis | secondary viscosity at interior faces |
| [in,out] | rhs | right hand side |
| void cs_anisotropic_right_diffusion_vector | ( | int | idtvar, |
| int | f_id, | ||
| const cs_equation_param_t | eqp, | ||
| int | inc, | ||
| cs_real_3_t *restrict | pvar, | ||
| const cs_real_3_t *restrict | pvara, | ||
| const cs_field_bc_coeffs_t * | bc_coeffs_v, | ||
| 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_3_t *restrict | rhs ) |
Add explicit part of the terms of diffusion by a right-multiplying symmetric tensorial diffusivity for a transport equation of a vector field 
More precisely, the right hand side 
![\[\vect{Rhs} = \vect{Rhs} - \sum_{\fij \in \Facei{\celli}} \left(
- \gradt_\fij \vect{\varia} \tens{\mu}_\fij \cdot \vect{S}_\ij \right)
\]](form_22.png)
Warning:

| [in] | idtvar | indicator of the temporal scheme |
| [in] | f_id | index of the current variable |
| [in] | eqp | equation parameters |
| [in] | inc | indicator
|
| [in] | pvar | solved variable (current time step) |
| [in] | pvara | solved variable (previous time step) |
| [in] | bc_coeffs_v | boundary condition structure for the variable |
| [in] | i_visc | |
| [in] | b_visc | |
| [in] | viscel | symmetric cell tensor |
| [in] | weighf | internal face weight between cells i j in case of tensor diffusion |
| [in] | weighb | boundary face weight for cells i in case of tensor diffusion |
| [in,out] | rhs | right hand side |
| 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 pair of values).
| [in] | f_id | field id |
| [in] | inc | "not an increment" flag |
| [in] | rovsdt | rho * volume / dt |
| void cs_cell_courant_number | ( | const cs_field_t * | f, |
| cs_dispatch_context & | ctx, | ||
| cs_real_t * | courant ) |
| void cs_convection_diffusion_scalar | ( | int | idtvar, |
| int | f_id, | ||
| const cs_equation_param_t | eqp, | ||
| int | icvflb, | ||
| int | inc, | ||
| int | imasac, | ||
| cs_real_t *restrict | pvar, | ||
| const cs_real_t *restrict | pvara, | ||
| const int | icvfli[], | ||
| const 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_t *restrict | rhs ) |
Add the explicit part of the convection/diffusion terms of a standard transport equation of a scalar field 
More precisely, the right hand side 
![\[Rhs = Rhs - \sum_{\fij \in \Facei{\celli}} \left(
\dot{m}_\ij \left( \varia_\fij - \varia_\celli \right)
- \mu_\fij \gradv_\fij \varia \cdot \vect{S}_\ij \right)
\]](form_2.png)
Warning:

Please refer to the bilsc2 section of the theory guide for more informations.
| [in] | idtvar | indicator of the temporal scheme |
| [in] | f_id | field id (or -1) |
| [in] | eqp | equation parameters |
| [in] | icvflb | global indicator of boundary convection flux
|
| [in] | inc | indicator
|
| [in] | imasac | take mass accumulation into account? |
| [in] | pvar | solved variable (current time step) |
| [in] | pvara | solved variable (previous time step) |
| [in] | icvfli | boundary face indicator array of convection flux
|
| [in] | bc_coeffs | boundary condition structure for the variable |
| [in] | i_massflux | mass flux at interior faces |
| [in] | b_massflux | mass flux at boundary faces |
| [in] | i_visc | |
| [in] | b_visc | |
| [in,out] | rhs | right hand side |
| 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 *restrict | pvar, | ||
| const cs_real_6_t *restrict | pvara, | ||
| const cs_field_bc_coeffs_t * | bc_coeffs_ts, | ||
| 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 *restrict | rhs ) |
Add the explicit part of the convection/diffusion terms of a transport equation of a tensor field 
More precisely, the right hand side 
![\[ \tens{Rhs} = \tens{Rhs} - \sum_{\fij \in \Facei{\celli}} \left(
\dot{m}_\ij \left( \tens{\varia}_\fij - \tens{\varia}_\celli \right)
- \mu_\fij \gradt_\fij \tens{\varia} \cdot \tens{S}_\ij \right)
\]](form_19.png)
Warning:

| [in] | idtvar | indicator of the temporal scheme |
| [in] | f_id | index of the current variable |
| [in] | eqp | equation parameters |
| [in] | icvflb | global indicator of boundary convection flux
|
| [in] | inc | indicator
|
| [in] | imasac | take mass accumulation into account? |
| [in] | pvar | solved velocity (current time step) |
| [in] | pvara | solved velocity (previous time step) |
| [in] | bc_coeffs_ts | boundary condition structure for the variable |
| [in] | i_massflux | mass flux at interior faces |
| [in] | b_massflux | mass flux at boundary faces |
| [in] | i_visc | |
| [in] | b_visc | |
| [in,out] | rhs | right hand side |
| void cs_convection_diffusion_thermal | ( | int | idtvar, |
| int | f_id, | ||
| const cs_equation_param_t | eqp, | ||
| int | inc, | ||
| int | imasac, | ||
| cs_real_t *restrict | pvar, | ||
| const cs_real_t *restrict | pvara, | ||
| const 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 | xcpp[], | ||
| cs_real_t *restrict | rhs ) |
Add the explicit part of the convection/diffusion terms of a transport equation of a scalar field 
More precisely, the right hand side 
![\[Rhs = Rhs + \sum_{\fij \in \Facei{\celli}} \left(
C_p\dot{m}_\ij \varia_\fij
- \lambda_\fij \gradv_\fij \varia \cdot \vect{S}_\ij \right)
\]](form_20.png)
Warning: 
| [in] | idtvar | indicator of the temporal scheme |
| [in] | f_id | index of the current variable |
| [in] | eqp | equation parameters) |
| [in] | inc | indicator
|
| [in] | imasac | take mass accumulation into account? |
| [in] | pvar | solved variable (current time step) |
| [in] | pvara | solved variable (previous time step) |
| [in] | bc_coeffs | boundary condition structure for the variable |
| [in] | i_massflux | mass flux at interior faces |
| [in] | b_massflux | mass flux at boundary faces |
| [in] | i_visc | |
| [in] | b_visc | |
| [in] | xcpp | array of specific heat ( |
| [in,out] | rhs | right hand side |
| 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 *restrict | pvar, | ||
| const cs_real_3_t *restrict | pvara, | ||
| const int | icvfli[], | ||
| const cs_field_bc_coeffs_t * | bc_coeffs_v, | ||
| 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 *restrict | i_pvar, | ||
| cs_real_3_t *restrict | b_pvar, | ||
| cs_real_3_t *restrict | rhs ) |
Add the explicit part of the convection/diffusion terms of a transport equation of a vector field 
More precisely, the right hand side 
![\[ \vect{Rhs} = \vect{Rhs} - \sum_{\fij \in \Facei{\celli}} \left(
\dot{m}_\ij \left( \vect{\varia}_\fij - \vect{\varia}_\celli \right)
- \mu_\fij \gradt_\fij \vect{\varia} \cdot \vect{S}_\ij \right)
\]](form_18.png)
Remark: if ivisep = 1, then we also take 


Warning:

| [in] | idtvar | indicator of the temporal scheme |
| [in] | f_id | index of the current variable |
| [in] | eqp | equation parameters |
| [in] | icvflb | global indicator of boundary convection flux
|
| [in] | inc | indicator
|
| [in] | ivisep | indicator to take
|
| [in] | imasac | take mass accumulation into account? |
| [in] | pvar | solved velocity (current time step) |
| [in] | pvara | solved velocity (previous time step) |
| [in] | icvfli | boundary face indicator array of convection flux
|
| [in] | bc_coeffs_v | boundary conditions structure for the variable |
| [in] | i_massflux | mass flux at interior faces |
| [in] | b_massflux | mass flux at boundary faces |
| [in] | i_visc | |
| [in] | b_visc | |
| [in] | i_secvis | secondary viscosity at interior faces |
| [in] | b_secvis | secondary viscosity at boundary faces |
| [in] | i_pvar | velocity at interior faces |
| [in] | b_pvar | velocity at boundary faces |
| [in,out] | rhs | right hand side |
| void cs_diffusion_potential | ( | const int | f_id, |
| const cs_mesh_t * | m, | ||
| cs_mesh_quantities_t * | fvq, | ||
| int | init, | ||
| int | inc, | ||
| int | imrgra, | ||
| int | nswrgp, | ||
| int | imligp, | ||
| int | iphydp, | ||
| int | iwgrp, | ||
| int | iwarnp, | ||
| double | epsrgp, | ||
| double | climgp, | ||
| cs_real_3_t *restrict | frcxt, | ||
| cs_real_t *restrict | pvar, | ||
| const 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 *restrict | diverg ) |
Update the cell mass flux divergence with the face pressure (or pressure increment, or pressure double increment) gradient.
![\[\dot{m}_\ij = \dot{m}_\ij
- \sum_j \Delta t \grad_\fij p \cdot \vect{S}_\ij
\]](form_29.png)
| [in] | f_id | field id (or -1) |
| [in] | m | pointer to mesh |
| [in] | fvq | pointer to finite volume quantities |
| [in] | init | indicator
|
| [in] | inc | indicator
|
| [in] | imrgra | indicator
|
| [in] | nswrgp | number of reconstruction sweeps for the gradients |
| [in] | imligp | clipping gradient method
|
| [in] | iphydp | hydrostatic pressure indicator |
| [in] | iwarnp | verbosity |
| [in] | iwgrp | indicator
|
| [in] | epsrgp | relative precision for the gradient reconstruction |
| [in] | climgp | clipping coeffecient for the computation of the gradient |
| [in] | frcxt | body force creating the hydrostatic pressure |
| [in] | pvar | solved variable (current time step) |
| [in] | bc_coeffs | boundary condition structure for the variable |
| [in] | i_visc | |
| [in] | b_visc | |
| [in] | visel | viscosity by cell |
| [in,out] | diverg | mass flux divergence |
| void cs_face_anisotropic_diffusion_potential | ( | const int | f_id, |
| const cs_mesh_t * | m, | ||
| cs_mesh_quantities_t * | fvq, | ||
| int | init, | ||
| int | inc, | ||
| int | imrgra, | ||
| int | nswrgp, | ||
| int | imligp, | ||
| int | ircflp, | ||
| int | ircflb, | ||
| int | iphydp, | ||
| int | iwgrp, | ||
| int | iwarnp, | ||
| double | epsrgp, | ||
| double | climgp, | ||
| cs_real_3_t *restrict | frcxt, | ||
| cs_real_t *restrict | pvar, | ||
| const 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 | i_massflux, | ||
| cs_real_t *restrict | b_massflux ) |
Add the explicit part of the pressure gradient term to the mass flux in case of anisotropic diffusion of the pressure field 
More precisely, the mass flux side 
![\[\dot{m}_\fij = \dot{m}_\fij -
\left( \tens{\mu}_\fij \gradv_\fij P \cdot \vect{S}_\ij \right)
\]](form_28.png)
| [in] | f_id | field id (or -1) |
| [in] | m | pointer to mesh |
| [in] | fvq | pointer to finite volume quantities |
| [in] | init | indicator
|
| [in] | inc | indicator
|
| [in] | imrgra | indicator
|
| [in] | nswrgp | number of reconstruction sweeps for the gradients |
| [in] | imligp | clipping gradient method
|
| [in] | ircflp | indicator
|
| [in] | ircflb | indicator
|
| [in] | iphydp | indicator
|
| [in] | iwgrp | indicator
|
| [in] | iwarnp | verbosity |
| [in] | epsrgp | relative precision for the gradient reconstruction |
| [in] | climgp | clipping coeffecient for the computation of the gradient |
| [in] | frcxt | body force creating the hydrostatic pressure |
| [in] | pvar | solved variable (pressure) |
| [in] | bc_coeffs | boundary condition structure for the variable |
| [in] | i_visc | |
| [in] | b_visc | |
| [in] | viscel | symmetric cell tensor |
| [in] | weighf | internal face weight between cells i j in case of tensor diffusion |
| [in] | weighb | boundary face weight for cells i in case of tensor diffusion |
| [in,out] | i_massflux | mass flux at interior faces |
| [in,out] | b_massflux | mass flux at boundary faces |
| 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 *restrict | pvar, | ||
| const cs_real_t *restrict | pvara, | ||
| const int | icvfli[], | ||
| const cs_field_bc_coeffs_t * | bc_coeffs, | ||
| const cs_real_t | i_massflux[], | ||
| const cs_real_t | b_massflux[], | ||
| cs_real_t | i_conv_flux[][2], | ||
| cs_real_t | b_conv_flux[] ) |
Update face flux with convection contribution of a standard transport equation of a scalar field 
![\[C_\ij = \dot{m}_\ij \left( \varia_\fij - \varia_\celli \right)
\]](form_17.png)
| [in] | f_id | pointer to field |
| [in] | eqp | equation parameters |
| [in] | icvflb | global indicator of boundary convection flux
|
| [in] | inc | indicator
|
| [in] | imasac | take mass accumulation into account? |
| [in] | pvar | solved variable (current time step) |
| [in] | pvara | solved variable (previous time step) |
| [in] | icvfli | boundary face indicator array of convection flux
|
| [in] | bc_coeffs | boundary condition structure for the variable |
| [in] | i_massflux | mass flux at interior faces |
| [in] | b_massflux | mass flux at boundary faces |
| [in,out] | i_conv_flux | scalar convection flux at interior faces |
| [in,out] | b_conv_flux | scalar convection flux at boundary faces |
| void cs_face_diffusion_potential | ( | const int | f_id, |
| const cs_mesh_t * | m, | ||
| cs_mesh_quantities_t * | fvq, | ||
| int | init, | ||
| int | inc, | ||
| int | imrgra, | ||
| int | nswrgp, | ||
| int | imligp, | ||
| int | iphydp, | ||
| int | iwgrp, | ||
| int | iwarnp, | ||
| double | epsrgp, | ||
| double | climgp, | ||
| cs_real_3_t *restrict | frcxt, | ||
| cs_real_t *restrict | pvar, | ||
| const cs_field_bc_coeffs_t * | bc_coeffs, | ||
| const cs_real_t | i_visc[], | ||
| const cs_real_t | b_visc[], | ||
| cs_real_t *restrict | visel, | ||
| cs_real_t *restrict | i_massflux, | ||
| cs_real_t *restrict | b_massflux ) |
Update the face mass flux with the face pressure (or pressure increment, or pressure double increment) gradient.
![\[\dot{m}_\ij = \dot{m}_\ij
- \Delta t \grad_\fij \delta p \cdot \vect{S}_\ij
\]](form_25.png)
Please refer to the cs_face_diffusion_potential/cs_diffusion_potential section of the theory guide for more information.
| [in] | f_id | field id (or -1) |
| [in] | m | pointer to mesh |
| [in] | fvq | pointer to finite volume quantities |
| [in] | init | indicator
|
| [in] | inc | indicator
|
| [in] | imrgra | indicator
|
| [in] | nswrgp | number of reconstruction sweeps for the gradients |
| [in] | imligp | clipping gradient method
|
| [in] | iphydp | hydrostatic pressure indicator |
| [in] | iwgrp | indicator
|
| [in] | iwarnp | verbosity |
| [in] | epsrgp | relative precision for the gradient reconstruction |
| [in] | climgp | clipping coeffecient for the computation of the gradient |
| [in] | frcxt | body force creating the hydrostatic pressure |
| [in] | pvar | solved variable (current time step) |
| [in] | bc_coeffs | boundary condition structure for the variable |
| [in] | i_visc | |
| [in] | b_visc | |
| [in] | visel | viscosity by cell |
| [in,out] | i_massflux | mass flux at interior faces |
| [in,out] | b_massflux | mass flux at boundary faces |
| cs_real_t * cs_get_v_slope_test | ( | int | f_id, |
| const cs_equation_param_t | eqp ) |
| void cs_slope_test_gradient | ( | int | f_id, |
| cs_dispatch_context & | ctx, | ||
| int | inc, | ||
| cs_halo_type_t | halo_type, | ||
| const cs_real_3_t * | grad, | ||
| cs_real_3_t * | grdpa, | ||
| const cs_real_t * | pvar, | ||
| const cs_field_bc_coeffs_t * | bc_coeffs, | ||
| const cs_real_t * | i_massflux ) |
Compute the upwind gradient used in the slope tests.
This function assumes the input gradient and pvar values have already been synchronized.
| [in] | f_id | field id |
| [in] | ctx | Reference to dispatch context |
| [in] | inc | Not an increment flag |
| [in] | halo_type | halo type |
| [in] | grad | standard gradient |
| [out] | grdpa | upwind gradient |
| [in] | pvar | values |
| [in] | bc_coeffs | boundary condition structure for the variable |
| [in] | i_massflux | mass flux at interior faces |
| void cs_upwind_gradient | ( | const int | f_id, |
| 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, | ||
| cs_real_3_t *restrict | grdpa ) |
Compute the upwind gradient used in the pure SOLU schemes (observed in the litterature).
| [in] | f_id | field index |
| [in] | ctx | Reference to dispatch context |
| [in] | inc | Not an increment flag |
| [in] | halo_type | halo type |
| [in] | bc_coeffs | boundary condition structure for the variable |
| [in] | i_massflux | mass flux at interior faces |
| [in] | b_massflux | mass flux at boundary faces |
| [in] | pvar | values |
| [out] | grdpa | upwind gradient |