My Project
programmer's documentation
|
This file gathers functions that solve advection diffusion equations with source terms for one time step for a scalar, vector or tensor variable. More...
#include "cs_defs.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <mpi.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_blas.h"
#include "cs_halo.h"
#include "cs_halo_perio.h"
#include "cs_log.h"
#include "cs_math.h"
#include "cs_mesh.h"
#include "cs_field.h"
#include "cs_gradient.h"
#include "cs_gradient_perio.h"
#include "cs_ext_neighborhood.h"
#include "cs_mesh_quantities.h"
#include "cs_parameters.h"
#include "cs_prototypes.h"
#include "cs_timer.h"
#include "cs_join_perio.h"
#include "cs_parall.h"
#include "cs_field_pointer.h"
#include "cs_matrix_building.h"
#include "cs_matrix_default.h"
#include "cs_convection_diffusion.h"
#include "cs_sles.h"
#include "cs_sles_default.h"
#include "cs_preprocessor_data.h"
#include "cs_balance.h"
#include "cs_equation_iterative_solve.h"
Functions | |
void | cs_equation_iterative_solve_scalar (int idtvar, int iterns, int f_id, const char *name, int iescap, int imucpp, cs_real_t normp, cs_var_cal_opt_t *var_cal_opt, const cs_real_t pvara[], const cs_real_t pvark[], const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_viscm[], const cs_real_t b_viscm[], 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[], int icvflb, const int icvfli[], const cs_real_t rovsdt[], cs_real_t smbrp[], cs_real_t pvar[], cs_real_t dpvar[], const cs_real_t xcpp[], cs_real_t eswork[]) |
This function solves an advection diffusion equation with source terms for one time step for the variable . More... | |
void | cs_equation_iterative_solve_vector (int idtvar, int iterns, int f_id, const char *name, int ivisep, int iescap, cs_var_cal_opt_t *var_cal_opt, const cs_real_3_t pvara[], const cs_real_3_t pvark[], const cs_real_3_t coefav[], const cs_real_33_t coefbv[], const cs_real_3_t cofafv[], const cs_real_33_t cofbfv[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], cs_real_t i_viscm[], const cs_real_t b_viscm[], 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_6_t viscel[], const cs_real_2_t weighf[], const cs_real_t weighb[], int icvflb, const int icvfli[], const cs_real_33_t fimp[], cs_real_3_t smbrp[], cs_real_3_t pvar[], cs_real_3_t eswork[]) |
This function solves an advection diffusion equation with source terms for one time step for the vector variable . More... | |
void | cs_equation_iterative_solve_tensor (int idtvar, int f_id, const char *name, cs_var_cal_opt_t *var_cal_opt, const cs_real_6_t pvara[], const cs_real_6_t pvark[], const cs_real_6_t coefats[], const cs_real_66_t coefbts[], const cs_real_6_t cofafts[], const cs_real_66_t cofbfts[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_viscm[], const cs_real_t b_viscm[], 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[], int icvflb, const int icvfli[], const cs_real_66_t fimp[], cs_real_6_t smbrp[], cs_real_6_t pvar[]) |
This function solves an advection diffusion equation with source terms for one time step for the symmetric tensor variable . More... | |
This file gathers functions that solve advection diffusion equations with source terms for one time step for a scalar, vector or tensor variable.
void cs_equation_iterative_solve_scalar | ( | int | idtvar, |
int | iterns, | ||
int | f_id, | ||
const char * | name, | ||
int | iescap, | ||
int | imucpp, | ||
cs_real_t | normp, | ||
cs_var_cal_opt_t * | var_cal_opt, | ||
const cs_real_t | pvara[], | ||
const cs_real_t | pvark[], | ||
const cs_real_t | coefap[], | ||
const cs_real_t | coefbp[], | ||
const cs_real_t | cofafp[], | ||
const cs_real_t | cofbfp[], | ||
const cs_real_t | i_massflux[], | ||
const cs_real_t | b_massflux[], | ||
const cs_real_t | i_viscm[], | ||
const cs_real_t | b_viscm[], | ||
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[], | ||
int | icvflb, | ||
const int | icvfli[], | ||
const cs_real_t | rovsdt[], | ||
cs_real_t | smbrp[], | ||
cs_real_t | pvar[], | ||
cs_real_t | dpvar[], | ||
const cs_real_t | xcpp[], | ||
cs_real_t | eswork[] | ||
) |
This function solves an advection diffusion equation with source terms for one time step for the variable .
The equation reads:
This equation is rewritten as:
where and
It is in fact solved with the following iterative process:
where
Be careful, it is forbidden to modify here!
Please refer to the codits section of the theory guide for more informations.
[in] | idtvar | indicator of the temporal scheme |
[in] | iterns | external sub-iteration number |
[in] | f_id | field id (or -1) |
[in] | name | associated name if f_id < 0, or NULL |
[in] | iescap | compute the predictor indicator if 1 |
[in] | imucpp | indicator
|
[in] | normp | Reference norm to solve the system (optional) if negative: recomputed here |
[in] | var_cal_opt | pointer to a cs_var_cal_opt_t structure which contains variable calculation options |
[in] | pvara | variable at the previous time step |
[in] | pvark | variable at the previous sub-iteration . If you sub-iter on Navier-Stokes, then it allows to initialize by something else than pvara (usually pvar=pvara) |
[in] | coefap | boundary condition array for the variable (explicit part) |
[in] | coefbp | boundary condition array for the variable (implicit part) |
[in] | cofafp | boundary condition array for the diffusion of the variable (explicit part) |
[in] | cofbfp | boundary condition array for the diffusion of the variable (implicit part) |
[in] | i_massflux | mass flux at interior faces |
[in] | b_massflux | mass flux at boundary faces |
[in] | i_viscm | at interior faces for the matrix |
[in] | b_viscm | at boundary faces for the matrix |
[in] | i_visc | at interior faces for the r.h.s. |
[in] | b_visc | at boundary faces for the r.h.s. |
[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] | icvflb | global indicator of boundary convection flux
|
[in] | icvfli | boundary face indicator array of convection flux
|
[in] | rovsdt | |
[in] | smbrp | Right hand side |
[in,out] | pvar | current variable |
[in,out] | dpvar | last variable increment |
[in] | xcpp | array of specific heat (Cp) |
[out] | eswork | prediction-stage error estimator (if iescap > 0) |
void cs_equation_iterative_solve_tensor | ( | int | idtvar, |
int | f_id, | ||
const char * | name, | ||
cs_var_cal_opt_t * | var_cal_opt, | ||
const cs_real_6_t | pvara[], | ||
const cs_real_6_t | pvark[], | ||
const cs_real_6_t | coefats[], | ||
const cs_real_66_t | coefbts[], | ||
const cs_real_6_t | cofafts[], | ||
const cs_real_66_t | cofbfts[], | ||
const cs_real_t | i_massflux[], | ||
const cs_real_t | b_massflux[], | ||
const cs_real_t | i_viscm[], | ||
const cs_real_t | b_viscm[], | ||
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[], | ||
int | icvflb, | ||
const int | icvfli[], | ||
const cs_real_66_t | fimp[], | ||
cs_real_6_t | smbrp[], | ||
cs_real_6_t | pvar[] | ||
) |
This function solves an advection diffusion equation with source terms for one time step for the symmetric tensor variable .
The equation reads:
This equation is rewritten as:
where and
It is in fact solved with the following iterative process:
where
Be careful, it is forbidden to modify here!
[in] | idtvar | indicator of the temporal scheme |
[in] | f_id | field id (or -1) |
[in] | name | associated name if f_id < 0, or NULL |
[in] | var_cal_opt | pointer to a cs_var_cal_opt_t structure which contains variable calculation options |
[in] | pvara | variable at the previous time step |
[in] | pvark | variable at the previous sub-iteration . If you sub-iter on Navier-Stokes, then it allows to initialize by something else than pvara (usually pvar=pvara) |
[in] | coefats | boundary condition array for the variable (Explicit part) |
[in] | coefbts | boundary condition array for the variable (Impplicit part) |
[in] | cofafts | boundary condition array for the diffusion of the variable (Explicit part) |
[in] | cofbfts | boundary condition array for the diffusion of the variable (Implicit part) |
[in] | i_massflux | mass flux at interior faces |
[in] | b_massflux | mass flux at boundary faces |
[in] | i_viscm | at interior faces for the matrix |
[in] | b_viscm | at boundary faces for the matrix |
[in] | i_visc | at interior faces for the r.h.s. |
[in] | b_visc | at boundary faces for the r.h.s. |
[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] | icvflb | global indicator of boundary convection flux
|
[in] | icvfli | boundary face indicator array of convection flux
|
[in] | fimp | |
[in] | smbrp | Right hand side |
[in,out] | pvar | current variable |
void cs_equation_iterative_solve_vector | ( | int | idtvar, |
int | iterns, | ||
int | f_id, | ||
const char * | name, | ||
int | ivisep, | ||
int | iescap, | ||
cs_var_cal_opt_t * | var_cal_opt, | ||
const cs_real_3_t | pvara[], | ||
const cs_real_3_t | pvark[], | ||
const cs_real_3_t | coefav[], | ||
const cs_real_33_t | coefbv[], | ||
const cs_real_3_t | cofafv[], | ||
const cs_real_33_t | cofbfv[], | ||
const cs_real_t | i_massflux[], | ||
const cs_real_t | b_massflux[], | ||
cs_real_t | i_viscm[], | ||
const cs_real_t | b_viscm[], | ||
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_6_t | viscel[], | ||
const cs_real_2_t | weighf[], | ||
const cs_real_t | weighb[], | ||
int | icvflb, | ||
const int | icvfli[], | ||
const cs_real_33_t | fimp[], | ||
cs_real_3_t | smbrp[], | ||
cs_real_3_t | pvar[], | ||
cs_real_3_t | eswork[] | ||
) |
This function solves an advection diffusion equation with source terms for one time step for the vector variable .
The equation reads:
This equation is rewritten as:
where and
It is in fact solved with the following iterative process:
where
Be careful, it is forbidden to modify here!
[in] | idtvar | indicator of the temporal scheme |
[in] | iterns | external sub-iteration number |
[in] | f_id | field id (or -1) |
[in] | name | associated name if f_id < 0, or NULL |
[in] | ivisep | indicator to take
|
[in] | iescap | compute the predictor indicator if 1 |
[in] | var_cal_opt | pointer to a cs_var_cal_opt_t structure which contains variable calculation options |
[in] | pvara | variable at the previous time step |
[in] | pvark | variable at the previous sub-iteration . If you sub-iter on Navier-Stokes, then it allows to initialize by something else than pvara (usually pvar= pvara) |
[in] | coefav | boundary condition array for the variable (explicit part) |
[in] | coefbv | boundary condition array for the variable (implicit part) |
[in] | cofafv | boundary condition array for the diffusion of the variable (Explicit part) |
[in] | cofbfv | boundary condition array for the diffusion of the variable (Implicit part) |
[in] | i_massflux | mass flux at interior faces |
[in] | b_massflux | mass flux at boundary faces |
[in] | i_viscm | at interior faces for the matrix |
[in] | b_viscm | at boundary faces for the matrix |
[in] | i_visc | at interior faces for the r.h.s. |
[in] | b_visc | at boundary faces for the r.h.s. |
[in] | i_secvis | secondary viscosity at interior faces |
[in] | b_secvis | secondary viscosity at boundary faces |
[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] | icvflb | global indicator of boundary convection flux
|
[in] | icvfli | boundary face indicator array of convection flux
|
[in] | fimp | |
[in] | smbrp | Right hand side |
[in,out] | pvar | current variable |
[out] | eswork | prediction-stage error estimator (if iescap > 0) |