MPI-AMRVAC  3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
Functions/Subroutines | Variables
mod_ard_phys Module Reference

Module containing the physics routines for advection-reaction-diffusion equations. More...

Functions/Subroutines

subroutine ard_write_info (fh)
 Write this modules parameters to a snapshot. More...
 
subroutine, public ard_phys_init ()
 
subroutine ard_check_params
 
subroutine ard_to_conserved (ixIL, ixOL, w, x)
 
subroutine ard_to_primitive (ixIL, ixOL, w, x)
 
subroutine ard_get_cmax (w, x, ixIL, ixOL, idim, cmax)
 
subroutine ard_get_cbounds (wLC, wRC, wLp, wRp, x, ixIL, ixOL, idim, Hspeed, cmax, cmin)
 
subroutine ard_get_dt (w, ixIL, ixOL, dtnew, dxD, x)
 
subroutine ard_get_flux (wC, w, x, ixIL, ixOL, idim, f)
 
subroutine ard_add_source_geom (qdt, dtfactor, ixIL, ixOL, wCT, w, x)
 
subroutine ard_add_source (qdt, dtfactor, ixIL, ixOL, wCT, wCTprim, w, x, qsourcesplit, active)
 
subroutine ard_laplacian (ixIL, ixOL, var, lpl)
 Compute the Laplacian using a standard second order scheme. For now this method only works in slab geometries. Requires one ghost cell only. More...
 
subroutine put_laplacians_onegrid (ixIL, ixOL, w)
 
subroutine ard_evaluate_implicit (qtC, psa)
 inplace update of psa==>F_im(psa) More...
 
subroutine ard_implicit_update (dtfactor, qdt, qtC, psa, psb)
 Implicit solve of psa=psb+dtfactor*dt*F_im(psa) More...
 

Variables

integer, public, protected u_ = 1
 Indices of the unknowns. More...
 
integer, public, protected v_ = 2
 For 2 or more equations. More...
 
integer, public, protected w_ = 3
 For 3 or more equations. More...
 
logical, public, protected ard_particles = .false.
 Whether particles module is added. More...
 
double precision, public, protected dtreacpar = 0.5d0
 Parameter with which to multiply the reaction timestep restriction. More...
 
character(len=20), public, protected equation_name = "gray-scott"
 Name of the system to be solved. More...
 
double precision, public, protected d1 = 0.05d0
 Diffusion coefficient for first species (u) More...
 
double precision, public, protected d2 = 1.0d0
 Diffusion coefficient for second species (v) (if applicable) More...
 
double precision, public, protected d3 = 1.0d0
 Diffusion coefficient for third species (w) (if applicable) More...
 
integer, public, protected adv_pow = 1
 Power of the unknown in the advection term (1 for linear) More...
 
double precision, dimension(^nd), public, protected a1 = 0.0d0
 Advection coefficients for first species (u) More...
 
double precision, dimension(^nd), public, protected a2 = 0.0d0
 Advection coefficients for second species (v) (if applicable) More...
 
double precision, dimension(^nd), public, protected a3 = 0.0d0
 Advection coefficients for third species (w) (if applicable) More...
 
double precision, public, protected sb_alpha = 0.1305d0
 Parameters for Schnakenberg model. More...
 
double precision, public, protected sb_beta = 0.7695d0
 
double precision, public, protected sb_kappa = 100.0d0
 
double precision, public, protected gs_f = 0.046d0
 Feed rate for Gray-Scott model. More...
 
double precision, public, protected gs_k = 0.063d0
 Kill rate for Gray-Scott model. More...
 
double precision, public, protected br_a = 4.5d0
 Parameters for Brusselator model. More...
 
double precision, public, protected br_b = 8.0d0
 
double precision, public, protected br_c = 1.0d0
 
double precision, public, protected br_d = 1.0d0
 
double precision, public, protected lg_lambda = 1.0d0
 Parameter for logistic model (Fisher / KPP equation) More...
 
double precision, public, protected bzfn_epsilon = 1.0d0
 Parameters for the Field-Noyes model of the Belousov-Zhabotinsky reaction. More...
 
double precision, public, protected bzfn_delta = 1.0d0
 
double precision, public, protected bzfn_lambda = 1.0d0
 
double precision, public, protected bzfn_mu = 1.0d0
 
double precision, public, protected lor_r = 28.0d0
 Parameter for Lorenz system (Rayleigh number) More...
 
double precision, public, protected lor_sigma = 10.0d0
 Parameter for Lorenz system (Prandtl number) More...
 
double precision, public, protected lor_b = 8.0d0 / 3.0d0
 Parameter for Lorenz system (aspect ratio of the convection rolls) More...
 
type(mg_bc_t), dimension(3, mg_num_neighbors), public ard_mg_bc
 Boundary condition information for the multigrid method. More...
 

Detailed Description

Module containing the physics routines for advection-reaction-diffusion equations.

This module can be seen as an extension of the reaction-diffusion (rd) module and includes the same reaction systems and more: the Gray-Scott model, the Schnakenberg model, the Brusselator model, the diffusive logistic equation, an analytical testcase from "Numerical solution of time-dependent advection- diffusion-reaction equations" by Hundsdorfer & Verwer, the Oregonator model, the extended Brusselator model, the diffusive Lorenz system and the advection- diffusion equation. See the documentation of the advection-reaction-diffusion module for more information.

An advection term can be aplied to these systems of the form: nabla( (A1/adv_pow) * u^(adv_pow) ) (for the first unknown) nabla( (A2/adv_pow) * v^(adv_pow) ) (for the second unknown, if applicable) nabla( (A3/adv_pow) * w^(adv_pow) ) (for the third unknown, if applicable)

IMEX methods are also supported. The implicit system is solved by a multigrid solver coupled into MPI-AMRVAC.

Function/Subroutine Documentation

◆ ard_add_source()

subroutine mod_ard_phys::ard_add_source ( double precision, intent(in)  qdt,
double precision, intent(in)  dtfactor,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s, 1:nw), intent(in)  wCT,
double precision, dimension(ixi^s,1:nw), intent(in)  wCTprim,
double precision, dimension(ixi^s, 1:nw), intent(inout)  w,
double precision, dimension(ixi^s, 1:ndim), intent(in)  x,
logical, intent(in)  qsourcesplit,
logical, intent(inout)  active 
)

Definition at line 470 of file mod_ard_phys.t.

Here is the call graph for this function:

◆ ard_add_source_geom()

subroutine mod_ard_phys::ard_add_source_geom ( double precision, intent(in)  qdt,
double precision, intent(in)  dtfactor,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s, 1:nw), intent(inout)  wCT,
double precision, dimension(ixi^s, 1:nw), intent(inout)  w,
double precision, dimension(ixi^s, 1:^nd), intent(in)  x 
)

Definition at line 456 of file mod_ard_phys.t.

◆ ard_check_params()

subroutine mod_ard_phys::ard_check_params

Definition at line 236 of file mod_ard_phys.t.

◆ ard_evaluate_implicit()

subroutine mod_ard_phys::ard_evaluate_implicit ( double precision, intent(in)  qtC,
type(state), dimension(max_blocks), target  psa 
)

inplace update of psa==>F_im(psa)

Definition at line 617 of file mod_ard_phys.t.

Here is the call graph for this function:

◆ ard_get_cbounds()

subroutine mod_ard_phys::ard_get_cbounds ( double precision, dimension(ixi^s, nw), intent(in)  wLC,
double precision, dimension(ixi^s,nw), intent(in)  wRC,
double precision, dimension(ixi^s, nw), intent(in)  wLp,
double precision, dimension(ixi^s,nw), intent(in)  wRp,
double precision, dimension(ixi^s, 1:^nd), intent(in)  x,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
integer, intent(in)  idim,
double precision, dimension(ixi^s,1:number_species), intent(in)  Hspeed,
double precision, dimension(ixi^s,1:number_species), intent(inout)  cmax,
double precision, dimension(ixi^s,1:number_species), intent(inout), optional  cmin 
)

Definition at line 335 of file mod_ard_phys.t.

◆ ard_get_cmax()

subroutine mod_ard_phys::ard_get_cmax ( double precision, dimension(ixi^s, nw), intent(in)  w,
double precision, dimension(ixi^s, 1:^nd), intent(in)  x,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
integer, intent(in)  idim,
double precision, dimension(ixi^s), intent(inout)  cmax 
)

Definition at line 319 of file mod_ard_phys.t.

◆ ard_get_dt()

subroutine mod_ard_phys::ard_get_dt ( double precision, dimension(ixi^s, 1:nw), intent(in)  w,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, intent(inout)  dtnew,
double precision, intent(in)  dx,
double precision, intent(in)  D,
double precision, dimension(ixi^s, 1:^nd), intent(in)  x 
)

Definition at line 375 of file mod_ard_phys.t.

◆ ard_get_flux()

subroutine mod_ard_phys::ard_get_flux ( double precision, dimension(ixi^s, 1:nw), intent(in)  wC,
double precision, dimension(ixi^s, 1:nw), intent(in)  w,
double precision, dimension(ixi^s, 1:^nd), intent(in)  x,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
integer, intent(in)  idim,
double precision, dimension(ixi^s, nwflux), intent(out)  f 
)

Definition at line 438 of file mod_ard_phys.t.

◆ ard_implicit_update()

subroutine mod_ard_phys::ard_implicit_update ( double precision, intent(in)  dtfactor,
double precision, intent(in)  qdt,
double precision, intent(in)  qtC,
type(state), dimension(max_blocks), target  psa,
type(state), dimension(max_blocks), target  psb 
)

Implicit solve of psa=psb+dtfactor*dt*F_im(psa)

Definition at line 637 of file mod_ard_phys.t.

◆ ard_laplacian()

subroutine mod_ard_phys::ard_laplacian ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s), intent(in)  var,
double precision, dimension(ixo^s), intent(out)  lpl 
)

Compute the Laplacian using a standard second order scheme. For now this method only works in slab geometries. Requires one ghost cell only.

Definition at line 568 of file mod_ard_phys.t.

◆ ard_phys_init()

subroutine, public mod_ard_phys::ard_phys_init

Definition at line 176 of file mod_ard_phys.t.

Here is the call graph for this function:

◆ ard_to_conserved()

subroutine mod_ard_phys::ard_to_conserved ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s, nw), intent(inout)  w,
double precision, dimension(ixi^s, 1:^nd), intent(in)  x 
)

Definition at line 301 of file mod_ard_phys.t.

◆ ard_to_primitive()

subroutine mod_ard_phys::ard_to_primitive ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s, nw), intent(inout)  w,
double precision, dimension(ixi^s, 1:^nd), intent(in)  x 
)

Definition at line 310 of file mod_ard_phys.t.

◆ ard_write_info()

subroutine mod_ard_phys::ard_write_info ( integer, intent(in)  fh)

Write this modules parameters to a snapshot.

Definition at line 165 of file mod_ard_phys.t.

◆ put_laplacians_onegrid()

subroutine mod_ard_phys::put_laplacians_onegrid ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s, 1:nw), intent(inout)  w 
)

Definition at line 591 of file mod_ard_phys.t.

Here is the call graph for this function:

Variable Documentation

◆ a1

double precision, dimension(^nd), public, protected mod_ard_phys::a1 = 0.0d0

Advection coefficients for first species (u)

Definition at line 63 of file mod_ard_phys.t.

◆ a2

double precision, dimension(^nd), public, protected mod_ard_phys::a2 = 0.0d0

Advection coefficients for second species (v) (if applicable)

Definition at line 65 of file mod_ard_phys.t.

◆ a3

double precision, dimension(^nd), public, protected mod_ard_phys::a3 = 0.0d0

Advection coefficients for third species (w) (if applicable)

Definition at line 67 of file mod_ard_phys.t.

◆ adv_pow

integer, public, protected mod_ard_phys::adv_pow = 1

Power of the unknown in the advection term (1 for linear)

Definition at line 60 of file mod_ard_phys.t.

◆ ard_mg_bc

type(mg_bc_t), dimension(3, mg_num_neighbors), public mod_ard_phys::ard_mg_bc

Boundary condition information for the multigrid method.

Definition at line 105 of file mod_ard_phys.t.

◆ ard_particles

logical, public, protected mod_ard_phys::ard_particles = .false.

Whether particles module is added.

Definition at line 33 of file mod_ard_phys.t.

◆ br_a

double precision, public, protected mod_ard_phys::br_a = 4.5d0

Parameters for Brusselator model.

Definition at line 80 of file mod_ard_phys.t.

◆ br_b

double precision, public, protected mod_ard_phys::br_b = 8.0d0

Definition at line 81 of file mod_ard_phys.t.

◆ br_c

double precision, public, protected mod_ard_phys::br_c = 1.0d0

Definition at line 82 of file mod_ard_phys.t.

◆ br_d

double precision, public, protected mod_ard_phys::br_d = 1.0d0

Definition at line 83 of file mod_ard_phys.t.

◆ bzfn_delta

double precision, public, protected mod_ard_phys::bzfn_delta = 1.0d0

Definition at line 90 of file mod_ard_phys.t.

◆ bzfn_epsilon

double precision, public, protected mod_ard_phys::bzfn_epsilon = 1.0d0

Parameters for the Field-Noyes model of the Belousov-Zhabotinsky reaction.

Definition at line 89 of file mod_ard_phys.t.

◆ bzfn_lambda

double precision, public, protected mod_ard_phys::bzfn_lambda = 1.0d0

Definition at line 91 of file mod_ard_phys.t.

◆ bzfn_mu

double precision, public, protected mod_ard_phys::bzfn_mu = 1.0d0

Definition at line 92 of file mod_ard_phys.t.

◆ d1

double precision, public, protected mod_ard_phys::d1 = 0.05d0

Diffusion coefficient for first species (u)

Definition at line 53 of file mod_ard_phys.t.

◆ d2

double precision, public, protected mod_ard_phys::d2 = 1.0d0

Diffusion coefficient for second species (v) (if applicable)

Definition at line 55 of file mod_ard_phys.t.

◆ d3

double precision, public, protected mod_ard_phys::d3 = 1.0d0

Diffusion coefficient for third species (w) (if applicable)

Definition at line 57 of file mod_ard_phys.t.

◆ dtreacpar

double precision, public, protected mod_ard_phys::dtreacpar = 0.5d0

Parameter with which to multiply the reaction timestep restriction.

Definition at line 36 of file mod_ard_phys.t.

◆ equation_name

character(len=20), public, protected mod_ard_phys::equation_name = "gray-scott"

Name of the system to be solved.

Definition at line 39 of file mod_ard_phys.t.

◆ gs_f

double precision, public, protected mod_ard_phys::gs_f = 0.046d0

Feed rate for Gray-Scott model.

Definition at line 75 of file mod_ard_phys.t.

◆ gs_k

double precision, public, protected mod_ard_phys::gs_k = 0.063d0

Kill rate for Gray-Scott model.

Definition at line 77 of file mod_ard_phys.t.

◆ lg_lambda

double precision, public, protected mod_ard_phys::lg_lambda = 1.0d0

Parameter for logistic model (Fisher / KPP equation)

Definition at line 86 of file mod_ard_phys.t.

◆ lor_b

double precision, public, protected mod_ard_phys::lor_b = 8.0d0 / 3.0d0

Parameter for Lorenz system (aspect ratio of the convection rolls)

Definition at line 99 of file mod_ard_phys.t.

◆ lor_r

double precision, public, protected mod_ard_phys::lor_r = 28.0d0

Parameter for Lorenz system (Rayleigh number)

Definition at line 95 of file mod_ard_phys.t.

◆ lor_sigma

double precision, public, protected mod_ard_phys::lor_sigma = 10.0d0

Parameter for Lorenz system (Prandtl number)

Definition at line 97 of file mod_ard_phys.t.

◆ sb_alpha

double precision, public, protected mod_ard_phys::sb_alpha = 0.1305d0

Parameters for Schnakenberg model.

Definition at line 70 of file mod_ard_phys.t.

◆ sb_beta

double precision, public, protected mod_ard_phys::sb_beta = 0.7695d0

Definition at line 71 of file mod_ard_phys.t.

◆ sb_kappa

double precision, public, protected mod_ard_phys::sb_kappa = 100.0d0

Definition at line 72 of file mod_ard_phys.t.

◆ u_

integer, public, protected mod_ard_phys::u_ = 1

Indices of the unknowns.

Definition at line 28 of file mod_ard_phys.t.

◆ v_

integer, public, protected mod_ard_phys::v_ = 2

For 2 or more equations.

Definition at line 29 of file mod_ard_phys.t.

◆ w_

integer, public, protected mod_ard_phys::w_ = 3

For 3 or more equations.

Definition at line 30 of file mod_ard_phys.t.