Convection-diffusion operators. More...
#include "base/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 <mpi.h>#include "bft/bft_error.h"#include "bft/bft_printf.h"#include "base/cs_algorithm.h"#include "base/cs_array.h"#include "base/cs_boundary_conditions.h"#include "base/cs_boundary_conditions_set_coeffs.h"#include "base/cs_dispatch.h"#include "cdo/cs_equation_param.h"#include "base/cs_halo.h"#include "base/cs_log.h"#include "base/cs_internal_coupling.h"#include "base/cs_math.h"#include "base/cs_mem.h"#include "mesh/cs_mesh.h"#include "base/cs_field.h"#include "base/cs_field_default.h"#include "base/cs_field_operator.h"#include "base/cs_field_pointer.h"#include "base/cs_parall.h"#include "base/cs_parameters.h"#include "base/cs_porous_model.h"#include "base/cs_profiling.h"#include "base/cs_reducers.h"#include "base/cs_timer.h"#include "base/cs_velocity_pressure.h"#include "alge/cs_blas.h"#include "alge/cs_bad_cells_regularisation.h"#include "alge/cs_gradient.h"#include "alge/cs_gradient_boundary.h"#include "mesh/cs_mesh_quantities.h"#include "alge/cs_convection_diffusion.h"#include "alge/cs_convection_diffusion_priv.h"
Include dependency graph for cs_convection_diffusion.cpp:Functions | |
| template<typename T > | |
| void | cs_convection_diffusion_adjust_and_check_bounds_scalar (cs_dispatch_context &ctx, const char *var_name, const cs_equation_param_t &eqp, bool face_gradient, int ircflb, const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, const cs_real_t *restrict pvar, const T(*restrict grad)[3], const cs_real_t *df_limiter, cs_real_t(*restrict bounds)[2]) |
| Adust bounds if rc_clip_factor < or > 1, and check bounds if required by verbosity level or postprocessing. More... | |
| template<cs_lnum_t stride, typename T > | |
| void | cs_convection_diffusion_adjust_and_check_bounds_strided (cs_dispatch_context &ctx, const char *var_name, const cs_equation_param_t &eqp, bool face_gradient, int ircflb, const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, const T(*restrict grad)[stride][3], const cs_real_t *df_limiter, cs_real_t *restrict bounds) |
| Adust bounds if rc_clip_factor < or > 1, and check bounds if required by verbosity level or postprocessing. More... | |
| template void | cs_convection_diffusion_adjust_and_check_bounds_strided (cs_dispatch_context &ctx, const char *var_name, const cs_equation_param_t &eqp, bool face_gradient, int ircflb, const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, const double(*restrict grad)[6][3], const cs_real_t *df_limiter, cs_real_t *restrict bounds) |
| template void | cs_convection_diffusion_adjust_and_check_bounds_strided (cs_dispatch_context &ctx, const char *var_name, const cs_equation_param_t &eqp, bool face_gradient, int ircflb, const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, const double(*restrict grad)[3][3], const cs_real_t *df_limiter, cs_real_t *restrict bounds) |
| template void | cs_convection_diffusion_adjust_and_check_bounds_strided (cs_dispatch_context &ctx, const char *var_name, const cs_equation_param_t &eqp, bool face_gradient, int ircflb, const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, const float(*restrict grad)[6][3], const cs_real_t *df_limiter, cs_real_t *restrict bounds) |
| template void | cs_convection_diffusion_adjust_and_check_bounds_strided (cs_dispatch_context &ctx, const char *var_name, const cs_equation_param_t &eqp, bool face_gradient, int ircflb, const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, const float(*restrict grad)[3][3], const cs_real_t *df_limiter, cs_real_t *restrict bounds) |
| 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). More... | |
| 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 *restrict 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[]) |
| Add the explicit part of the convection/diffusion terms of a standard transport equation of a scalar field | |
| 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 *restrict rhs) |
| Add the explicit part of the convection/diffusion terms of a 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[], 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_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)) More... | |
| 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_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)) with anisotropic. More... | |
| 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[], 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 *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, 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 *restrict rhs) |
| Add the explicit part of the convection/diffusion terms of a transport equation of a tensor field | |
| void | cs_anisotropic_diffusion_scalar (int idtvar, int f_id, const cs_equation_param_t eqp, int inc, const cs_real_t *restrict pvar, const cs_real_t *restrict pvara, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *restrict c_weight, 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, 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 *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, 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_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, 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_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 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_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. More... | |
| 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 *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 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 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_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. More... | |
| 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_anisotropic_diffusion_scalar). More... | |
| void | cs_cell_courant_number (const cs_field_t *f, cs_dispatch_context &ctx, cs_real_t *courant) |
| template<typename T > | |
| 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. More... | |
| template void | cs_slope_test_gradient (int f_id, cs_dispatch_context &ctx, const cs_real_t(*grad)[3], cs_real_t(*grdpa)[3], const cs_real_t *pvar, const cs_real_t val_f[], const cs_real_t *i_massflux) |
| template void | cs_slope_test_gradient (int f_id, cs_dispatch_context &ctx, const float(*grad)[3], float(*grdpa)[3], const cs_real_t *pvar, const cs_real_t val_f[], const cs_real_t *i_massflux) |
| template<cs_lnum_t stride, typename T > | |
| 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. More... | |
| template void | cs_slope_test_gradient_strided (cs_dispatch_context &ctx, const float grad[][3][3], float(*restrict grdpa)[3][3], const cs_real_t pvar[][3], const cs_real_t val_f[][3], const cs_real_t *i_massflux) |
| template void | cs_slope_test_gradient_strided (cs_dispatch_context &ctx, const float grad[][6][3], float(*restrict grdpa)[6][3], const cs_real_t pvar[][6], const cs_real_t val_f[][6], const cs_real_t *i_massflux) |
| template void | cs_slope_test_gradient_strided (cs_dispatch_context &ctx, const double grad[][3][3], double(*restrict grdpa)[3][3], const cs_real_t pvar[][3], const cs_real_t val_f[][3], const cs_real_t *i_massflux) |
| template void | cs_slope_test_gradient_strided (cs_dispatch_context &ctx, const double grad[][6][3], double(*restrict grdpa)[6][3], const cs_real_t pvar[][6], const cs_real_t val_f[][6], const cs_real_t *i_massflux) |
| template<typename T > | |
| 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 *restrict pvar, T(*restrict grdpa)[3]) |
| Compute the upwind gradient used in the pure SOLU schemes (observed in the litterature). More... | |
| template 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 *restrict pvar, double(*restrict grdpa)[3]) |
| template 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 *restrict pvar, float(*restrict grdpa)[3]) |
| template<cs_lnum_t stride, typename T > | |
| 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 pvar[][stride], T grdpa[][stride][3]) |
| Compute the upwind gradient used in the pure SOLU schemes (observed in the litterature) for a vector. More... | |
| template 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 pvar[][3], double(*restrict grdpa)[3][3]) |
| template 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 pvar[][3], float(*restrict grdpa)[3][3]) |
| template 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 pvar[][6], double(*restrict grdpa)[6][3]) |
| template 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 pvar[][6], float(*restrict grdpa)[6][3]) |
| int | cs_convection_diffusion_get_scheme_version (void) |
| Query convection-diffusion scheme variants. More... | |
| void | cs_convection_diffusion_set_scheme_version (int version) |
| Allow reverting to older convection-diffusion scheme variants. More... | |
Convection-diffusion operators.
Convection-diffusion operators, v9 scheme.
Please refer to the convection-diffusion section of the theory guide for more information.
For non-orthogonal meshes, the diffusion scheme involves reconstruction of cell variables at points orthogonal to the associated face centers. Deactivating this reconstruction improves robustness, at the cost of the loss of the scheme's second order spatial accuracy and even consistency.
Since the reconstruction (based on 1st order Taylor expansion using the cell gradients or face gradients (mean or adjacent cell gradients) can lead to reconstructed values outside the range of values in neighboring cells, diffusion from a cell I with a given field value to a cell J with a higher value is possible if the reconstructed value at the I' location associated to face IJ is higher than the value in J, leading to loss of monotonicity.
To avoid this, using gradient limiters can reduce the reconstructed values range where computed gradients are detected as being too strong. It is now also possible to use bounded reconstruction, where the gradient value is not modified, but values outside the range of adjacent cell (and boundary face) values are clipped to values within this range.
For scalars, bounds are naturally based on the minimum and maximum values at adjacent cells and boundary faces. the actual upper bound applied in cell I is equal to
so using a reconstruction clipping factor of 0 is equivalent to disabling reconstruction, and using a clipping factor of 1 limits the reconstructed value to the exact bounds of adjacent cells (using face adjacency only or additional cell neighbors based on the cell neighborhood used for the matching reconstruction gradient. The lower bound is defined in a similar manner.
For vectors and tensors, bounds are not so straightforward, as component-based bounds are not invariant by rotation. So we choose a simpled dispersion bound for vectors, for which the Euclidean norm of the difference between the reconstructed vector and the non-reconstructed vector in cell I does not exceed that of if the norm of this difference with all adjacent cell and boundary face values. If this bound is exceeded, the reconstruction gradient is scaled so that the reconstructed value lies withing this bound (here again a reconstruction clipping factor multiplier may be used, so a factor of 0 disables reconstruction entirely, while a factor of 1 limits the reconstruction so as to exactly fit the bound).
This is illustrated in the following figures:
Placing vectors at the same origin, we can compute their dispersion:
Finally, the value reconstructed at I' should fir inside both circles:
Please refer to the convection-diffusion section of the theory guide for more information.
| 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_anisotropic_diffusion_scalar).
More precisely, the divergence of the mass flux side
is updated as follows:
| [in] | f | pointer to field or nullptr |
| [in] | eqp | equation parameters |
| [in] | m | pointer to mesh |
| [in] | fvq | pointer to finite volume quantities |
| [in] | init | indicator
|
| [in] | inc | indicator
|
| [in] | iphydp | indicator
|
| [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, | ||
| const cs_real_t *restrict | pvar, | ||
| const cs_real_t *restrict | pvara, | ||
| cs_field_bc_coeffs_t * | bc_coeffs, | ||
| const cs_real_t | i_visc[], | ||
| const cs_real_t | b_visc[], | ||
| cs_real_6_t *restrict | c_weight, | ||
| 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
is updated as follows:
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] | c_weight | 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, | ||
| 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_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
is updated as follows:
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_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, | ||
| 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 *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
is updated as follows:
Remark: if ivisep = 1, then we also take
, where
is the secondary viscosity, i.e. usually
.
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 | 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, | ||
| 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_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
is updated as follows:
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_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_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_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)) with anisotropic.
Compute
, where
is the secondary viscosity, i.e. usually
.
| [in,out] | ctx | reference to dispatch context |
| [in] | m | pointer to mesh structure |
| [in] | mq | pointer to mesh quantities |
| [in] | i_visc | |
| [in] | i_secvis | secondary viscosity at interior faces |
| [in] | b_secvis | secondary viscosity at boundary faces |
| [in] | grad | velocity gradient |
| [in,out] | rhs | right hand side |
| void cs_convection_diffusion_adjust_and_check_bounds_scalar | ( | cs_dispatch_context & | ctx, |
| const char * | var_name, | ||
| const cs_equation_param_t & | eqp, | ||
| bool | face_gradient, | ||
| int | ircflb, | ||
| const cs_mesh_t * | m, | ||
| const cs_mesh_quantities_t * | fvq, | ||
| const cs_real_t *restrict | pvar, | ||
| const T(*) | grad[3], | ||
| const cs_real_t * | df_limiter, | ||
| cs_real_t(*) | bounds[2] | ||
| ) |
Adust bounds if rc_clip_factor < or > 1, and check bounds if required by verbosity level or postprocessing.
parameters: ctx <-> dispatch context var_name <– associated variable name eqp <– equation parameters face_gradient <– use face averaged gradient (instead of cell gradient) for reconstruction ircflb <– if > 0, reconstruction at boundary faces m <– pointer to associated mesh structure fvq <– pointer to associated finite volume quantities ircflu <– 1 if reconstruction should be done at boundaries pvar <– variable grad <– gradient of pvar (du/dx_j : grad[][j]) df_limiter <– optional reconstruction limiter factor, or null bounds <-> variable bounds (min, max)
| template void cs_convection_diffusion_adjust_and_check_bounds_strided | ( | cs_dispatch_context & | ctx, |
| const char * | var_name, | ||
| const cs_equation_param_t & | eqp, | ||
| bool | face_gradient, | ||
| int | ircflb, | ||
| const cs_mesh_t * | m, | ||
| const cs_mesh_quantities_t * | fvq, | ||
| const double(*) | grad[3][3], | ||
| const cs_real_t * | df_limiter, | ||
| cs_real_t *restrict | bounds | ||
| ) |
| template void cs_convection_diffusion_adjust_and_check_bounds_strided | ( | cs_dispatch_context & | ctx, |
| const char * | var_name, | ||
| const cs_equation_param_t & | eqp, | ||
| bool | face_gradient, | ||
| int | ircflb, | ||
| const cs_mesh_t * | m, | ||
| const cs_mesh_quantities_t * | fvq, | ||
| const double(*) | grad[6][3], | ||
| const cs_real_t * | df_limiter, | ||
| cs_real_t *restrict | bounds | ||
| ) |
| template void cs_convection_diffusion_adjust_and_check_bounds_strided | ( | cs_dispatch_context & | ctx, |
| const char * | var_name, | ||
| const cs_equation_param_t & | eqp, | ||
| bool | face_gradient, | ||
| int | ircflb, | ||
| const cs_mesh_t * | m, | ||
| const cs_mesh_quantities_t * | fvq, | ||
| const float(*) | grad[3][3], | ||
| const cs_real_t * | df_limiter, | ||
| cs_real_t *restrict | bounds | ||
| ) |
| template void cs_convection_diffusion_adjust_and_check_bounds_strided | ( | cs_dispatch_context & | ctx, |
| const char * | var_name, | ||
| const cs_equation_param_t & | eqp, | ||
| bool | face_gradient, | ||
| int | ircflb, | ||
| const cs_mesh_t * | m, | ||
| const cs_mesh_quantities_t * | fvq, | ||
| const float(*) | grad[6][3], | ||
| const cs_real_t * | df_limiter, | ||
| cs_real_t *restrict | bounds | ||
| ) |
| void cs_convection_diffusion_adjust_and_check_bounds_strided | ( | cs_dispatch_context & | ctx, |
| const char * | var_name, | ||
| const cs_equation_param_t & | eqp, | ||
| bool | face_gradient, | ||
| int | ircflb, | ||
| const cs_mesh_t * | m, | ||
| const cs_mesh_quantities_t * | fvq, | ||
| const T(*) | grad[stride][3], | ||
| const cs_real_t * | df_limiter, | ||
| cs_real_t *restrict | bounds | ||
| ) |
Adust bounds if rc_clip_factor < or > 1, and check bounds if required by verbosity level or postprocessing.
template parameters: stride 3 for vectors, 6 for symmetric tensors
parameters: ctx <-> dispatch context var_name <– associated variable name eqp <– equation parameters face_gradient <– use face averaged gradient (instead of cell gradient) for reconstruction ircflb <– if > 0, reconstruction at boundary faces m <– pointer to associated mesh structure fvq <– pointer to associated finite volume quantities ircflu <– 1 if reconstruction should be done at boundaries grad <-> gradient of pvar (du/dx_j : grad[][j]) df_limiter <– optional reconstruction limiter factor, or null bounds <– bounds of pvar in neighboring cells
| int cs_convection_diffusion_get_scheme_version | ( | void | ) |
Query convection-diffusion scheme variants.
| 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 *restrict | 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[] | ||
| ) |
Add the explicit part of the convection/diffusion terms of a standard transport equation of a scalar field
.
More precisely, the right hand side
is updated as follows:
Warning:
Please refer to the bilsc2 section of the theory guide for more information.
| [in] | f | pointer to field, or null |
| [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 |
| [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] | c_weight | diffusion gradient weighting |
| [in,out] | rhs | right hand side |
| [in,out] | i_flux | interior flux (or nullptr) |
| [in,out] | b_flux | boundary flux (or nullptr) |
| 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))
Compute
, where
is the secondary viscosity, i.e. usually
.
| [in,out] | ctx | reference to dispatch context |
| [in] | m | pointer to mesh structure |
| [in] | mq | pointer to mesh quantities |
| [in] | thetap | theta-scheme value |
| [in] | i_visc | |
| [in] | i_secvis | secondary viscosity at interior faces |
| [in] | b_secvis | secondary viscosity at boundary faces |
| [in] | gradv | velocity gradient |
| [in,out] | rhs | right hand side |
| void cs_convection_diffusion_set_scheme_version | ( | int | version | ) |
Allow reverting to older convection-diffusion scheme variants.
| [in] | version | Scheme version (90 for v9.0) -1 for current) |
| 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, | ||
| 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 *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
is updated as follows:
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 | 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 | ( | 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 *restrict | rhs | ||
| ) |
Add the explicit part of the convection/diffusion terms of a transport equation of a scalar field
such as the temperature.
More precisely, the right hand side
is updated as follows:
| [in] | f | pointer to field, or null |
| [in] | eqp | equation parameters) |
| [in] | inc | indicator
|
| [in] | imasac | take mass accumulation into account? |
| [in] | pvar | solved variable |
| [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] | w_stride | stride for weighting coefficient |
| [in] | c_weight | diffusion gradient weighting |
| [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[], | ||
| 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 *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
is updated as follows:
Remark: if ivisep = 1, then we also take
, where
is the secondary viscosity, i.e. usually
.
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 | 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 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_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.
| [in] | f | pointer to field or nullptr |
| [in] | eqp | equation parameters |
| [in] | m | pointer to mesh |
| [in] | fvq | pointer to finite volume quantities |
| [in] | init | indicator
|
| [in] | inc | indicator
|
| [in] | iphydp | hydrostatic pressure indicator |
| [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 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 | 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
is updated as follows:
| [in] | f | pointer to field or nullptr |
| [in] | eqp | equation parameters |
| [in] | m | pointer to mesh |
| [in] | fvq | pointer to finite volume quantities |
| [in] | init | indicator
|
| [in] | inc | indicator
|
| [in] | iphydp | indicator
|
| [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[], | ||
| 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
.
| [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,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 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_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.
Please refer to the cs_face_diffusion_potential/cs_diffusion_potential section of the theory guide for more information.
| [in] | f | pointer to field or nullptr |
| [in] | eqp | equation parameters |
| [in] | m | pointer to mesh |
| [in] | fvq | pointer to finite volume quantities |
| [in] | init | indicator
|
| [in] | inc | indicator
|
| [in] | iphydp | hydrostatic pressure indicator |
| [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 | ||
| ) |
| template void cs_slope_test_gradient | ( | int | f_id, |
| cs_dispatch_context & | ctx, | ||
| const cs_real_t(*) | grad[3], | ||
| cs_real_t(*) | grdpa[3], | ||
| const cs_real_t * | pvar, | ||
| const cs_real_t | val_f[], | ||
| const cs_real_t * | i_massflux | ||
| ) |
| template void cs_slope_test_gradient | ( | int | f_id, |
| cs_dispatch_context & | ctx, | ||
| const float(*) | grad[3], | ||
| float(*) | grdpa[3], | ||
| const cs_real_t * | pvar, | ||
| const cs_real_t | val_f[], | ||
| const cs_real_t * | i_massflux | ||
| ) |
| 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.
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] | grad | standard gradient |
| [out] | grdpa | upwind gradient |
| [in] | pvar | values |
| [in] | val_f | face values for gradient |
| [in] | i_massflux | mass flux at interior faces |
| template void cs_slope_test_gradient_strided | ( | cs_dispatch_context & | ctx, |
| const double | grad[][3][3], | ||
| double(*) | grdpa[3][3], | ||
| const cs_real_t | pvar[][3], | ||
| const cs_real_t | val_f[][3], | ||
| const cs_real_t * | i_massflux | ||
| ) |
| template void cs_slope_test_gradient_strided | ( | cs_dispatch_context & | ctx, |
| const double | grad[][6][3], | ||
| double(*) | grdpa[6][3], | ||
| const cs_real_t | pvar[][6], | ||
| const cs_real_t | val_f[][6], | ||
| const cs_real_t * | i_massflux | ||
| ) |
| template void cs_slope_test_gradient_strided | ( | cs_dispatch_context & | ctx, |
| const float | grad[][3][3], | ||
| float(*) | grdpa[3][3], | ||
| const cs_real_t | pvar[][3], | ||
| const cs_real_t | val_f[][3], | ||
| const cs_real_t * | i_massflux | ||
| ) |
| template void cs_slope_test_gradient_strided | ( | cs_dispatch_context & | ctx, |
| const float | grad[][6][3], | ||
| float(*) | grdpa[6][3], | ||
| const cs_real_t | pvar[][6], | ||
| const cs_real_t | val_f[][6], | ||
| const cs_real_t * | i_massflux | ||
| ) |
| void cs_slope_test_gradient_strided | ( | cs_dispatch_context & | ctx, |
| const T | grad[][stride][3], | ||
| T(*) | 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.
template parameters: stride 1 for scalars, 3 for vectors, 6 for symmetric tensors
This function assumes the input gradient and pvar values have already been synchronized.
| [in] | ctx | Reference to dispatch context |
| [in] | grad | standard gradient |
| [out] | grdpa | upwind gradient |
| [in] | pvar | values |
| [in] | val_f | face values for gradient |
| [in] | i_massflux | mass flux at interior faces |
| template 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 *restrict | pvar, | ||
| double(*) | grdpa[3] | ||
| ) |
| template 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 *restrict | pvar, | ||
| float(*) | grdpa[3] | ||
| ) |
| 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 *restrict | pvar, | ||
| T(*) | grdpa[3] | ||
| ) |
Compute the upwind gradient used in the pure SOLU schemes (observed in the litterature).
| [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 |
| template 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 | pvar[][3], | ||
| double(*) | grdpa[3][3] | ||
| ) |
| template 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 | pvar[][3], | ||
| float(*) | grdpa[3][3] | ||
| ) |
| template 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 | pvar[][6], | ||
| double(*) | grdpa[6][3] | ||
| ) |
| template 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 | pvar[][6], | ||
| float(*) | grdpa[6][3] | ||
| ) |
| 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 | pvar[][stride], | ||
| T | grdpa[][stride][3] | ||
| ) |
Compute the upwind gradient used in the pure SOLU schemes (observed in the litterature) for a vector.
| [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 |