Scrambler
1
|
Module for managing various source terms. More...
Data Types | |
interface | CreateSrc |
Generic interface for creating sources. More... | |
Public Member Functions | |
subroutine, public | SrcInit (isrcsolvetype, iverbosity) |
Read in and initialize parameters for source terms. | |
subroutine, public | SrcFinalizeInit |
Finalize source term(s) initialization. | |
subroutine, public | Src (Info, mb, tnow, hdt) |
Calculate source terms and update q. | |
subroutine, public | SourceCell (q, Info, ip, tnow, hdt, dv, lForm) |
subroutine, public | SrcInitTracers |
Initialize indices and fields for source tracers NrVars number of variables NrTracerVars number of tracer fields. | |
subroutine, public | SrcInitElliptics () |
Initialize indices and fields for source tracers NrVars number of variables NrEllipticVars number of elliptic fields. | |
subroutine, public | ReadSourceObjects (nframe) |
Reads source-term objects from a Chombo file. Currently, only cooling is implemented. | |
subroutine | CreateSourcesObj (sources, isrcsolvetype, iverbosity) |
Create a new sources object and initialize it sources The sources object to be created in the sources module isrcsolvetype integer setting kind of source integration iverbosity integer setting verbosity level of source. | |
Private Member Functions | |
subroutine | ExplicitSrc (Info, mb, tnow, hdt) |
Use subcycling algorithm to calculate source terms. | |
subroutine | RKOrder2 (q, dq, pos, t, dt, error, Info, ip, lform) |
2nd order Runge-Kutta scheme q Fluid variables for this cell dq Change in q from source terms pos Location of cell dt Timestep to integrate over | |
subroutine | RKOrder45 (q, pos, hdt, htnow, htnext, Info, ip, success, lform) |
Combination 5th/4th order Runge-Kutta scheme. | |
subroutine | ImplicitSrc (Info, mb, tnow, hdt) |
Use implicit algorithm for calculating source terms. | |
subroutine | ExactSrc (Info, mb, tnow, hdt) |
Use the exact scheme (for cooling only?) of Townsend, 2009. | |
REAL(KIND=qPrec) function | SrcDerivs (q, pos, t, Info, ip, lform) |
Changes to q (dqdt) for all source terms q Fluid variables for this cell pos Location of cell. | |
subroutine | DestroySourcesObj |
Empty subroutine at present, anticipating only ever needing one sources object. | |
Private Attributes | |
TYPE(SourcesDef), pointer | sources |
TYPE(LevelDef) | currlevel |
INTEGER | vb = 0 |
Module for managing various source terms.
Definition at line 38 of file source_control.f90.
subroutine, public SrcInit | ( | INTEGER, optional | isrcsolvetype, |
INTEGER, optional | iverbosity | ||
) |
Read in and initialize parameters for source terms.
Definition at line 72 of file source_control.f90.
subroutine, public SrcFinalizeInit | ( | ) |
Finalize source term(s) initialization.
All source terms should be set up by user at this point, and all hyperbolic, elliptic, etc., variables defined. Now, set up any additional tables, etc. [BDS][20110106]: Do not initialize cooling source objects on restarts--use the I/O routines for that.
Definition at line 86 of file source_control.f90.
subroutine, public Src | ( | TYPE(InfoDef) | Info, |
INTEGER, dimension(3,2), intent(in) | mb, | ||
REAL(KIND=qPrec), intent(in) | tnow, | ||
REAL(KIND=qPrec), intent(in) | hdt | ||
) |
Calculate source terms and update q.
Take in an Info structure, range, and hydro time step to integrate source term(s).
Info | Info structure |
mb | Restricted range to calculate source on grid |
hdt | Timestep from the hydro calculation |
Definition at line 99 of file source_control.f90.
subroutine ExplicitSrc | ( | TYPE(InfoDef) | Info, |
INTEGER, dimension(3,2), intent(in) | mb, | ||
REAL(KIND=qPrec) | tnow, | ||
REAL(KIND=qPrec), intent(in) | hdt | ||
) | [private] |
Use subcycling algorithm to calculate source terms.
When there are no strong source terms present, algorithm uses 2nd order RK to quickly update q. When stiff source terms present, it switches to 4th/5th order RK.
Info | Info structure |
mb | Restricted range to calculate source on grid |
hdt | Timestep from the hydro calculation |
Definition at line 150 of file source_control.f90.
subroutine, public SourceCell | ( | REAL(KIND=qPrec), dimension(:) | q, |
TYPE(InfoDef) | Info, | ||
INTEGER, dimension(3) | ip, | ||
REAL(KIND=qPrec) | tnow, | ||
REAL(KIND=qPrec), intent(in) | hdt, | ||
REAL(KIND=qPrec) | dv, | ||
LOGICAL | lForm | ||
) |
Definition at line 218 of file source_control.f90.
subroutine RKOrder2 | ( | REAL(KIND=qPrec), dimension(:) | q, |
REAL(KIND=qPrec), dimension(nrhydrovars) | dq, | ||
REAL(KIND=qPrec), dimension(3) | pos, | ||
REAL(KIND=qPrec) | t, | ||
REAL(KIND=qPrec) | dt, | ||
REAL(KIND=qPrec) | error, | ||
TYPE(InfoDef) | Info, | ||
INTEGER, dimension(3) | ip, | ||
LOGICAL | lform | ||
) | [private] |
2nd order Runge-Kutta scheme q Fluid variables for this cell dq Change in q from source terms pos Location of cell dt Timestep to integrate over
Definition at line 276 of file source_control.f90.
subroutine RKOrder45 | ( | REAL(KIND=qPrec), dimension(:) | q, |
REAL(KIND=qPrec), dimension(3) | pos, | ||
REAL(KIND=qPrec) | hdt, | ||
REAL(KIND=qPrec) | htnow, | ||
REAL(KIND=qPrec) | htnext, | ||
TYPE(InfoDef) | Info, | ||
INTEGER, dimension(3) | ip, | ||
LOGICAL | success, | ||
LOGICAL | lform | ||
) | [private] |
Combination 5th/4th order Runge-Kutta scheme.
Algorithm adjusts timestep to subcycle until full timestep is integrated over. Method is based on the Cash-Karp RK algorithm in Numerical Recipes (1992), 710ff. It takes advantage of the fact that six function calls results in formulas for both 4th and 5th order integration, allowing quick ability to measure error and adjust timestep as appropriate. Once the error is acceptable, it uses the 5th order result to update q and continue. q Fluid variables for this cell pos Location of cell hdt Timestep to integrate over htnow Time at beginning of timestep htnext Time at end of timestep
Definition at line 341 of file source_control.f90.
subroutine ImplicitSrc | ( | TYPE(InfoDef) | Info, |
INTEGER, dimension(3,2), intent(in) | mb, | ||
REAL(KIND=qPrec), intent(in) | tnow, | ||
REAL(KIND=qPrec), intent(in) | hdt | ||
) | [private] |
Use implicit algorithm for calculating source terms.
In certain cases, the equations for the source terms may be cast in an implicit formalism. This requires some manner of iterative scheme to converge.
Info | Info structure |
mb | Restricted range to calculate source on grid |
hdt | Timestep from the hydro calculation |
Definition at line 470 of file source_control.f90.
subroutine ExactSrc | ( | TYPE(InfoDef) | Info, |
INTEGER, dimension(3,2), intent(in) | mb, | ||
REAL(KIND=qPrec), intent(in) | tnow, | ||
REAL(KIND=qPrec), intent(in) | hdt | ||
) | [private] |
Use the exact scheme (for cooling only?) of Townsend, 2009.
For simple (piecewise-power-law) cooling, the evolution may be integrated exactly.
Info | Info structure |
mb | Restricted range to calculate source on grid |
hdt | Timestep from the hydro calculation |
Definition at line 489 of file source_control.f90.
REAL(KIND=qPrec) function SrcDerivs | ( | REAL(KIND=qPrec), dimension(:) | q, |
REAL(KIND=qPrec), dimension(3) | pos, | ||
REAL(KIND=qPrec) | t, | ||
TYPE(InfoDef) | Info, | ||
INTEGER, dimension(3) | ip, | ||
LOGICAL | lform | ||
) | [private] |
Changes to q (dqdt) for all source terms q Fluid variables for this cell pos Location of cell.
Definition at line 506 of file source_control.f90.
subroutine, public SrcInitTracers | ( | ) |
Initialize indices and fields for source tracers NrVars number of variables NrTracerVars number of tracer fields.
Definition at line 544 of file source_control.f90.
subroutine, public SrcInitElliptics | ( | ) |
Initialize indices and fields for source tracers NrVars number of variables NrEllipticVars number of elliptic fields.
Definition at line 557 of file source_control.f90.
subroutine, public ReadSourceObjects | ( | INTEGER | nframe | ) |
Reads source-term objects from a Chombo file. Currently, only cooling is implemented.
nframe | The number of the restart frame. |
Definition at line 570 of file source_control.f90.
subroutine CreateSourcesObj | ( | TYPE(SourcesDef), pointer | sources, |
INTEGER, optional | isrcsolvetype, | ||
INTEGER, optional | iverbosity | ||
) |
Create a new sources object and initialize it sources The sources object to be created in the sources module isrcsolvetype integer setting kind of source integration iverbosity integer setting verbosity level of source.
Definition at line 657 of file source_control.f90.
subroutine DestroySourcesObj | ( | ) | [private] |
Empty subroutine at present, anticipating only ever needing one sources object.
Definition at line 692 of file source_control.f90.
TYPE(SourcesDef), pointer sources [private] |
Definition at line 56 of file source_control.f90.
TYPE(LevelDef) currlevel [private] |
Definition at line 57 of file source_control.f90.
INTEGER vb = 0 [private] |
Definition at line 60 of file source_control.f90.