27 character(len=*),
intent(in) :: files(:)
34 open(
unitpar,file=trim(files(n)),status=
'old')
35 read(
unitpar,bfield_list,
end=111)
57 allocate(start_indices(number_species),stop_indices(number_species))
58 start_indices(1)=
mag(1)
59 stop_indices(1)=nwflux
64 allocate(iw_vector(nvector))
71 call mpistop(
'bfield physics: flux_type has wrong shape')
94 write(*,*)
'====B-only field construction settings==============='
96 write(*,*)
'Dimensionality=',
ndim,
' vector components=',
ndir
97 write(*,*)
'number of variables nw=',nw
98 write(*,*)
'start index iwstart=',iwstart
99 write(*,*)
'number of variables with BCs=',nwgc
100 write(*,*)
'number of variables with fluxes=',nwflux
103 write(*,*)
'======================================================='
109 integer,
intent(in) :: ixI^L,ixO^L
110 double precision,
intent(inout) :: w(ixI^S,nw)
111 double precision,
intent(in) :: x(ixI^S,1:^ND)
116 integer,
intent(in) :: ixI^L,ixO^L
117 double precision,
intent(inout) :: w(ixI^S,nw)
118 double precision,
intent(in) :: x(ixI^S,1:^ND)
123 integer,
intent(in) :: ixI^L,ixO^L,idim
124 double precision,
intent(in) :: w(ixI^S,nw),x(ixI^S,1:^ND)
125 double precision,
intent(inout) :: cmax(ixI^S)
133 integer,
intent(in) :: ixI^L,ixO^L,idim
134 double precision,
intent(in) :: wLC(ixI^S,nw),wRC(ixI^S,nw)
135 double precision,
intent(in) :: wLp(ixI^S,nw),wRp(ixI^S,nw)
136 double precision,
intent(in) :: x(ixI^S,1:^ND)
137 double precision,
intent(in) :: Hspeed(ixI^S,1:number_species)
138 double precision,
intent(inout) :: cmax(ixI^S,1:number_species)
139 double precision,
intent(inout),
optional :: cmin(ixI^S,1:number_species)
142 if(
present(cmin)) cmin(ixo^s,1)=zero
147 integer,
intent(in) :: ixI^L,ixO^L,idim
148 double precision,
intent(in) :: wC(ixI^S,nw),w(ixI^S,nw)
149 double precision,
intent(in) :: x(ixI^S,1:^ND)
150 double precision,
intent(out) :: f(ixI^S,nwflux)
152 f(ixo^s,1:nwflux)=zero
157 integer,
intent(in) :: ixI^L,ixO^L
158 double precision,
intent(in) :: dx^D,x(ixI^S,1:^ND)
159 double precision,
intent(in) :: w(ixI^S,1:nw)
160 double precision,
intent(inout) :: dtnew
167 integer,
intent(in) :: ixI^L,ixO^L
168 double precision,
intent(in) :: qdt,dtfactor,x(ixI^S,1:^ND)
169 double precision,
intent(inout) :: wCT(ixI^S,1:nw),wprim(ixI^S,1:nw),&
177 double precision :: mp,kB,miu0,c_lightspeed
178 double precision :: a,b,he
179 character(len=std_len) :: eos_type
197 if(
allocated(
eos))
then
199 eos_type=
eos%eos_type
202 if(eos_type==
'LTE')
then
207 if(eos_type==
'PI')
then
Minimal magnetic-field-only state for static field construction.
subroutine bfield_get_cmax(w, x, ixil, ixol, idim, cmax)
subroutine bfield_get_dt(w, ixil, ixol, dtnew, dxd, x)
subroutine bfield_read_params(files)
subroutine bfield_get_cbounds(wlc, wrc, wlp, wrp, x, ixil, ixol, idim, hspeed, cmax, cmin)
double precision bfield_he_ion_fr
subroutine bfield_get_flux(wc, w, x, ixil, ixol, idim, f)
subroutine bfield_check_params
subroutine bfield_to_conserved(ixil, ixol, w, x)
subroutine bfield_phys_init()
double precision bfield_he_ion_fr2
subroutine bfield_to_primitive(ixil, ixol, w, x)
subroutine bfield_add_source_geom(qdt, dtfactor, ixil, ixol, wct, wprim, w, x)
subroutine bfield_activate()
Activate the B-only physics/state path.
double precision bfield_h_ion_fr
Optional ionisation fractions used only by the unit normalisation.
subroutine bfield_physical_units()
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
EoS state container – the single thermodynamic authority for AMRVAC.
type(eos_container), allocatable, public eos
The single EoS state object, allocated in eos_init and shared (read-mostly) across all EoS sub-module...
integer, dimension(:), allocatable, public mag
Indices of the magnetic field.
Module with geometry-related routines (e.g., divergence, curl)
This module contains definitions of global parameters and variables and some generic functions/subrou...
double precision unit_charge
Physical scaling factor for charge.
double precision unit_time
Physical scaling factor for time.
double precision unit_density
Physical scaling factor for density.
integer, parameter unitpar
file handle for IO
double precision unit_mass
Physical scaling factor for mass.
double precision unit_numberdensity
Physical scaling factor for number density.
double precision unit_pressure
Physical scaling factor for pressure.
integer, parameter ndim
Number of spatial dimensions for grid variables.
double precision unit_length
Physical scaling factor for length.
logical stagger_grid
True for using stagger grid.
character(len=std_len), dimension(:), allocatable par_files
Which par files are used as input.
integer mype
The rank of the current MPI task.
integer ndir
Number of spatial dimensions (components) for vector variables.
logical slab
Cartesian geometry or not.
double precision unit_magneticfield
Physical scaling factor for magnetic field.
double precision const_sigmasb
double precision unit_velocity
Physical scaling factor for velocity.
double precision c_norm
Normalised speed of light.
double precision unit_temperature
Physical scaling factor for temperature.
logical si_unit
Use SI units (.true.) or use cgs units (.false.)
This module defines the procedures of a physics module. It contains function pointers for the various...
procedure(sub_convert), pointer phys_to_primitive
procedure(sub_get_flux), pointer phys_get_flux
procedure(sub_get_cbounds), pointer phys_get_cbounds
procedure(sub_get_dt), pointer phys_get_dt
procedure(sub_add_source_geom), pointer phys_add_source_geom
procedure(sub_check_params), pointer phys_check_params
integer, parameter flux_default
Indicates a normal flux.
integer, dimension(:, :), allocatable flux_type
Array per direction per variable, which can be used to specify that certain fluxes have to be treated...
procedure(sub_convert), pointer phys_to_conserved
character(len=name_len) physics_type
String describing the physics type of the simulation.
procedure(sub_get_cmax), pointer phys_get_cmax
logical phys_energy
Solve energy equation or not.