version 0.6.0
Loading...
Searching...
No Matches
Generic transport equations

It discretizes and solves the generic transport (advection/diffusion) equation. More...

Functions

subroutine mod_solve_cell_transport_equation::solve_cell_transport_equation (coefficient, diffusion_coefficient, velocity_nm1, velocity_n, velocity, divergence, equation_source_term, scalar_field, scalar_field_n, scalar_field_nm1, scalar_field_nm2, linear_term, equation_bc, ibc_variable, equation_isd_target, equation_time_step, equation_time_step_n, equation_time_step_nm1, equation_time_order, equation_explicit_time_order, equation_flux_type, equation_has_source_term, equation_has_temporal_term, equation_has_advection_term, equation_has_div_u_advection_term, equation_has_diffusion_term, equation_has_linear_term, equation_has_ghost_boundary_cells, equation_has_immersed_boundaries, equation_ib_has_one_sided_inner_discretization, equation_ib_inner_discretization_order, equation_fully_explicit, equation_use_explicit_terms_accumulator, equation_advection_term_discretization_type, equation_advection_term_scheme, equation_diffusion_term_discretization_type, equation_diffusion_term_scheme, equation_diffusion_explicit_time_order_discretization, equation_advection_term_splitting_scheme, equation_splitting_time_coef, equation_advection_term_dir_split, equation_stencil, equation_solver, equation_ls_map, is_matrix_invertible_local, equation_name, equation_variables_name, equation_explicit_term_accumulators_n, equation_explicit_term_accumulators_nm1, equation_explicit_term_accumulators_nm2)
 It discretizes and solves the transport (or advection/diffusion) equation defined on cell grid.
 

Detailed Description

This routine solves a generic transport (advection/diffusion) equation, discretized in time as follow:

\[ \mathrm{coef} \left( \frac {\alpha \mathbf{\phi}^{n+1} + \beta \mathbf{\phi}^n + \gamma \mathbf{\phi}^{n-1}} {\Delta t} + \mathrm{div}(\mathbf{u^{n+1}} \tilde{\phi}) \right) = \mathrm{div}\left( D \mathrm{\mathbf{grad}}(\phi^{n+1}) \right) + s \]

where values of \( \alpha, \beta, \gamma \) helps to switch from Euler time discretization scheme of the 1st order to the 2nd order backward differential:

The advection term can be treated explicitly ( \( \tilde{\phi}=\phi^{n} \)) or implicitly ( \( \tilde{\phi}=\phi^{n+1} \))

Function Documentation

◆ solve_cell_transport_equation()

subroutine mod_solve_cell_transport_equation::solve_cell_transport_equation ( double precision, dimension(:,:,:), intent(in) coefficient,
double precision, dimension(:,:,:), intent(in) diffusion_coefficient,
type(t_face_field), intent(in) velocity_nm1,
type(t_face_field), intent(in) velocity_n,
type(t_face_field), intent(in) velocity,
double precision, dimension(:,:,:), intent(in) divergence,
double precision, dimension(:,:,:), intent(in) equation_source_term,
double precision, dimension(:,:,:), intent(inout) scalar_field,
double precision, dimension(:,:,:), intent(in) scalar_field_n,
double precision, dimension(:,:,:), intent(in) scalar_field_nm1,
double precision, dimension(:,:,:), intent(in), allocatable scalar_field_nm2,
double precision, dimension(:,:,:), intent(in) linear_term,
type(t_boundary_condition), intent(in) equation_bc,
type(t_immersed_boundary_condition), dimension(:), intent(in) ibc_variable,
integer, dimension(:), intent(in) equation_isd_target,
double precision, intent(in) equation_time_step,
double precision, intent(in) equation_time_step_n,
double precision, intent(in) equation_time_step_nm1,
integer, intent(in) equation_time_order,
integer, intent(in) equation_explicit_time_order,
type(t_fv_flux), intent(in) equation_flux_type,
logical, intent(in) equation_has_source_term,
logical, intent(in) equation_has_temporal_term,
logical, intent(in) equation_has_advection_term,
logical, intent(in) equation_has_div_u_advection_term,
logical, intent(in) equation_has_diffusion_term,
logical, intent(in) equation_has_linear_term,
logical, intent(in) equation_has_ghost_boundary_cells,
logical, intent(in) equation_has_immersed_boundaries,
logical, intent(in) equation_ib_has_one_sided_inner_discretization,
integer, dimension(:), intent(in) equation_ib_inner_discretization_order,
logical, intent(in) equation_fully_explicit,
logical, intent(in) equation_use_explicit_terms_accumulator,
integer, intent(in) equation_advection_term_discretization_type,
integer, intent(in) equation_advection_term_scheme,
integer, intent(in) equation_diffusion_term_discretization_type,
integer, intent(in) equation_diffusion_term_scheme,
integer, intent(in) equation_diffusion_explicit_time_order_discretization,
integer, intent(in) equation_advection_term_splitting_scheme,
double precision, dimension (3), intent(inout) equation_splitting_time_coef,
logical, intent(in) equation_advection_term_dir_split,
type(t_cell_stencil), intent(in) equation_stencil,
class(t_linear_solver), intent(inout) equation_solver,
type(t_ls_map), intent(in) equation_ls_map,
logical, intent(in) is_matrix_invertible_local,
character(len=*), intent(in) equation_name,
character(len=*), intent(in) equation_variables_name,
double precision, dimension(:,:,:), intent(inout) equation_explicit_term_accumulators_n,
double precision, dimension(:,:,:), intent(inout) equation_explicit_term_accumulators_nm1,
double precision, dimension(:,:,:), intent(inout) equation_explicit_term_accumulators_nm2 )
Parameters
[in]coefficientCoefficient in front of the time and advection term.
[in]diffusion_coefficientCoefficient of diffusion.
[in]velocity_nm1velocity field at \( t^{n-1} \)
[in]velocity_nvelocity field at \( t^n \)
[in]velocityvelocity field at \( t^{n+1} \)
[in]divergenceDivergence of the velocity.
[in]equation_source_termSource term added to the right-hand side.
[in,out]scalar_fieldScalar field of the transport equation. Contains the result.
[in]scalar_field_nScalar field at previous time iteration.
[in]scalar_field_nm1Scalar field at time iteration n-1.
[in]scalar_field_nm2Scalar field at time iteration n-2.
[in]linear_termContains the coefficient in front of the linear term.
[in]equation_bcValues for boundary conditions.
[in]ibc_variableboundary conditions on immersed boundaries.
[in]equation_isd_targetSubset of immersed boundaries.
[in]equation_time_stepCurrent time step.
[in]equation_time_step_nPrevious time step.
[in]equation_time_step_nm1Previous time step.
[in]equation_time_orderTime discretization order.
[in]equation_explicit_time_orderthe time discretization order for computing the advection with the explicit scheme (Euler, NSSP32, NSSP53)
[in]equation_flux_typethe flux type to use for the explicit advection (type_fv_flux)
[in]equation_has_source_termFlag to enable the source term.
[in]equation_has_temporal_termFlag to enable the temporal term.
[in]equation_has_advection_termFlag to enable the advection term.
[in]equation_has_div_u_advection_termFlag to enable the \( div(\mathbf{u}) \) advection term.
[in]equation_has_diffusion_termFlag to enable the diffusion term.
[in]equation_has_linear_termFlag to enable the linear term.
[in]equation_has_ghost_boundary_cellsFlag to enable the ghost cells into the linear system.
[in]equation_has_immersed_boundariesFlag to enable immersed boundaries.
[in]equation_ib_has_one_sided_inner_discretization
[in]equation_ib_inner_discretization_order
[in]equation_fully_explicit
[in]equation_use_explicit_terms_accumulatorequation use (or not) an accumulator in case of implicit/explicit mixing
[in]equation_advection_term_discretization_typeType of discretization (implicit/explicit) the advection term.
[in]equation_advection_term_schemeNumerical scheme of the advection term (upwind, etc.).
[in]equation_diffusion_term_discretization_typeType of discretization (implicit/explicit) the diffusion term.
[in]equation_diffusion_term_schemeNumerical scheme of the diffusion term (centered, etc.).
[in]equation_diffusion_explicit_time_order_discretization
[in]equation_advection_term_splitting_scheme
[in,out]equation_splitting_time_coef
[in]equation_advection_term_dir_split
[in]equation_stencilStencil description.
[in,out]equation_solverLinear system solver.
[in]equation_ls_mapStructure used to map the general numbering to the linear system numbering.
[in]is_matrix_invertible_localFlag to require a null right-hand side integral.
[in]equation_nameName of the equation used to display a message.
[in]equation_variables_nameName of the variable of the solved equation.
[in,out]equation_explicit_term_accumulators_nthe current accumulator of explicit terms at time \( t^{n+1/2} \) (mean)
[in,out]equation_explicit_term_accumulators_nm1the accumulator of explicit terms at time \( t^{n-1/2} \) (mean)
[in,out]equation_explicit_term_accumulators_nm2the accumulator of explicit terms at time \( t^{n-3/2} \) (mean)