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. | |
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} \))
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 ) |
[in] | coefficient | Coefficient in front of the time and advection term. |
[in] | diffusion_coefficient | Coefficient of diffusion. |
[in] | velocity_nm1 | velocity field at \( t^{n-1} \) |
[in] | velocity_n | velocity field at \( t^n \) |
[in] | velocity | velocity field at \( t^{n+1} \) |
[in] | divergence | Divergence of the velocity. |
[in] | equation_source_term | Source term added to the right-hand side. |
[in,out] | scalar_field | Scalar field of the transport equation. Contains the result. |
[in] | scalar_field_n | Scalar field at previous time iteration. |
[in] | scalar_field_nm1 | Scalar field at time iteration n-1. |
[in] | scalar_field_nm2 | Scalar field at time iteration n-2. |
[in] | linear_term | Contains the coefficient in front of the linear term. |
[in] | equation_bc | Values for boundary conditions. |
[in] | ibc_variable | boundary conditions on immersed boundaries. |
[in] | equation_isd_target | Subset of immersed boundaries. |
[in] | equation_time_step | Current time step. |
[in] | equation_time_step_n | Previous time step. |
[in] | equation_time_step_nm1 | Previous time step. |
[in] | equation_time_order | Time discretization order. |
[in] | equation_explicit_time_order | the time discretization order for computing the advection with the explicit scheme (Euler, NSSP32, NSSP53) |
[in] | equation_flux_type | the flux type to use for the explicit advection (type_fv_flux) |
[in] | equation_has_source_term | Flag to enable the source term. |
[in] | equation_has_temporal_term | Flag to enable the temporal term. |
[in] | equation_has_advection_term | Flag to enable the advection term. |
[in] | equation_has_div_u_advection_term | Flag to enable the \( div(\mathbf{u}) \) advection term. |
[in] | equation_has_diffusion_term | Flag to enable the diffusion term. |
[in] | equation_has_linear_term | Flag to enable the linear term. |
[in] | equation_has_ghost_boundary_cells | Flag to enable the ghost cells into the linear system. |
[in] | equation_has_immersed_boundaries | Flag 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_accumulator | equation use (or not) an accumulator in case of implicit/explicit mixing |
[in] | equation_advection_term_discretization_type | Type of discretization (implicit/explicit) the advection term. |
[in] | equation_advection_term_scheme | Numerical scheme of the advection term (upwind, etc.). |
[in] | equation_diffusion_term_discretization_type | Type of discretization (implicit/explicit) the diffusion term. |
[in] | equation_diffusion_term_scheme | Numerical 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_stencil | Stencil description. |
[in,out] | equation_solver | Linear system solver. |
[in] | equation_ls_map | Structure used to map the general numbering to the linear system numbering. |
[in] | is_matrix_invertible_local | Flag to require a null right-hand side integral. |
[in] | equation_name | Name of the equation used to display a message. |
[in] | equation_variables_name | Name of the variable of the solved equation. |
[in,out] | equation_explicit_term_accumulators_n | the current accumulator of explicit terms at time \( t^{n+1/2} \) (mean) |
[in,out] | equation_explicit_term_accumulators_nm1 | the accumulator of explicit terms at time \( t^{n-1/2} \) (mean) |
[in,out] | equation_explicit_term_accumulators_nm2 | the accumulator of explicit terms at time \( t^{n-3/2} \) (mean) |