Appearance
adam_flume_ic_object
ADAM, FLUME initial conditions class definition.
Accepted [initial_conditions].(type):
uniform: the state of region 1 everywhere, density and pressure perturbed by the signed relative amplitudes,rho (1 + s h1),p (1 + s h2), withh1, h2in [-1, 1) hashed from the block Morton code and the cell indexes: the same on every rank decomposition and on every backend (no random generator state);isentropic-vortex: the free stream of region 1 plus an isentropic vortex of axis z centred at(x0, y0), of radiusradiusand velocity strengthstrength(Shu 1998, ICASE 97-65, section 5.1, written for any free stream):du = -strength/(2 pi) (y-y0)/radius exp((1-r^2)/2),dv = strength/(2 pi) (x-x0)/radius exp((1-r^2)/2),d(p/rho) = -(gamma-1)/gamma strength^2/(8 pi^2) exp(1-r^2), isentropic,r = |x-x0| / radius; an exact steady solution convected by the free stream;riemann-problem: piecewise-constant axis-aligned regions, a cell belongs to a region iffemin < center <= emaxon every axis. A cell covered by no region is fatal: leaving it at zero density would divide by zero downstream;glm-pulse(MHD only, the GLM d'Alembert test, issue #41, MV-3): the state of region 1 plus a Gaussian pulse in the magnetic field alongpulse_axis(x, y or z),B_axis += pulse_amplitude exp(-((s - pulse_center) / pulse_width)^2),sthe cell coordinate along the axis; pressure and velocity unchanged (psizero);divb-peak(MHD only, the Dedner et al. 2002 peak inB_x, issue #41, MV-10): the state of region 1 plusB_x += peak_amplitude (1 - (s / peak_radius)^2)^2fors < peak_radius,sthe distance in the x-y plane from(peak_x0, peak_y0)(Dedner:peak_amplitude = 1 / sqrt(4 pi),peak_radius = 1/8); a non-zero initial div(B);mhd-linear-wave(MHD only, issue #41, MV-5; Stone et al. 2008, section 8.2): the stateq0of region 1 (global frame) pluswave_amplitude R sin(2 pi (x cos a + y sin a) / wavelength),a = wave_angle(degrees, in the x-y plane),Rthe right eigenvector of the right-goingwave(fast,alfven,sloworentropy) of the conservative system atq0in the frame of the wave normal (the library Roe-Balsara core,mhd_eigenvectors), rotated back to x, y, z; after one periodwavelength / |u_n + c|the exact solution is the initial state;mhd-cpaw(MHD only, issue #41, MV-6; Toth 2000, J. Comput. Phys. 161): the circularly polarised Alfven wave, an exact nonlinear solution of any amplitude. Density and pressure of region 1 (whose velocity and field must be zero), the fieldb_par n + wave_amplitude (sin(phi) t1 + h cos(phi) t2)and the velocity-sign(b_par) B_perp / sqrt(rho),phi = 2 pi (x cos a + y sin a) / wavelength,a = wave_angle(degrees),n = (cos a, sin a, 0),t1 = (-sin a, cos a, 0),t2 = z,h = +1(polarisation = right) or-1(left, the mirror image underz -> -z);|B_perp|is uniform, so the total pressure is too, and the wave travels along+nunchanged at|b_par| / sqrt(rho): after one periodwavelength sqrt(rho) / |b_par|the exact solution is the initial state;mhd-vortex(MHD only, issue #41, MV-7; Balsara 2004, ApJS 151): the free stream of region 1 (bx = by = 0, fatal otherwise) plus a magnetised vortex of axis z centred at(x0, y0), of radiusradius:dv = kappa/(2 pi) e (-(y-y0), x-x0) / radius,dB = mu/(2 pi) e (-(y-y0), x-x0) / radius,dp = (mu^2 (1-r^2) - rho kappa^2) / (8 pi^2) e^2,e = exp((1-r^2)/2),r = |x-x0| / radius, density uniform: the radial balancedp/dr = rho v^2/r - B^2/r - d(B^2/2)/dr(rationalised units) holds exactly, so the vortex is a steady solution convected by the free stream, with a divergence-free field;orszag-tang(MHD only, issue #41, MV-12; Stone et al. 2008, section 8.4): the Orszag-Tang vortex on the unit period, keyless and with no region sections:rho = 25/(36 pi),p = 5/(12 pi),u = -sin(2 pi y),v = sin(2 pi x),bx = -sin(2 pi y) / sqrt(4 pi),by = sin(4 pi x) / sqrt(4 pi),w = bz = 0(divergence-free pointwise, symmetric under the 180 degrees rotation about(1/2, 1/2)). Evaluated as odd functions ofs = 2 x - 1,t = 2 y - 1(u = sin(pi t),v = -sin(pi s),by = sin(2 pi s) / sqrt(4 pi)): on cell centres that are exact binary fractions the rotated cell has exactly-s, -t, so the initial state is bitwise symmetric;mhd-rotor(MHD only, issue #41, MV-13; Balsara and Spicer 1999, Toth 2000 first rotor): the ambient state of region 1 plus a dense disc centred at(x0, y0)in rigid rotation: forr < r0densityrho_inand velocityv0 (-(y-y0), x-x0) / r0(speedv0atr0); forr0 <= r < r1the linear taperf = (r1 - r) / (r1 - r0), densityrho + (rho_in - rho) f, velocityf v0 (-(y-y0), x-x0) / r; pressure and field of region 1 everywhere; the velocities add to the ambient one;field-loop(MHD only, issue #41, MV-9; Gardiner and Stone 2005, Mignone and Tzeferacos 2010 section 4.4.1): the state of region 1 plus the field of the vector potentialA_z = loop_amplitude (loop_radius - r)forr < loop_radius,r = |x - (x0, y0)|in the x-y plane:dB = loop_amplitude (-(y-y0), x-x0) / rinside the loop, zero outside (divergence-free pointwise, discontinuous atr = loop_radius); with a uniformwthe discrete div(B) feedsB_z(d B_z / dt = w div(B));rotated-riemann(issue #41, MV-8; Toth 2000, J. Comput. Phys. 161, section 6.3.2): a one-dimensional Riemann problem rotated in the x-y plane, periodic along its normal. The normal is(normal_x, normal_y), the coordinates = normal_x x + normal_y y(unnormalised), and withf = modulo(s - interface_1, period),d = interface_2 - interface_1andw = interface_2_widtha cell is in region 2 iff0 < f <= d, in the linear ramp of the primitive variables from region 2 to region 1 iffd < f <= d + w(atf = d + wregion 1), in region 1 otherwise: a jump atinterface_1, and atinterface_2a jump (w = 0) or a ramp. On a periodic line the velocity jump of a shock tube must be undone somewhere: a second jump is the mirror problem, an expansion that may approach vacuum (for Ryu-Jones 1a: density ~2e-4, Alfven speed ~100); the ramp spreads it. The region states are given in the frame of the normal (u, v= normal and tangential velocity,bx, by= normal and tangential field,w, bzalong z) and rotated to x, y. With integer normal components on a square periodic domain of sideperiod, the state is periodic in x and in y (Toth's shifted-periodic strip is not needed).shu-osher(Euler only, issue #47, RV-3; Shu & Osher 1989, J. Comput. Phys. 83, example 8): a shock running into a density wave alongaxis(x, y or z), coordinates: the state of region 1 fors <= interface, else the state of region 2 with densityr + rho_amplitude sin(rho_wavenumber s)(the classic problem: region 13.857143, 2.629369, 10.33333, region 21, 0, 1, interface -4, amplitude 0.2, wavenumber 5 on [-5, 5], t = 1.8). The regions take no extent keys;linear(verification, issue #65 P0): every conservative variable linear in space,q = q_1 (1 + g . x)withq_1the state of region 1 and the relative gradientg = (gradient_x, gradient_y, gradient_z). The same-level copy, the 2:1 restriction (mean of the fine cells) and the tricubic coarse->fine fill reproduce it exactly, so the ghost cells of a step-0 checkpoint can be checked against it (verification/ghosts/ghost_probe.py). The state is admissible only while1 + g . x > 0over the domain; the probe runs no step.polynomial(verification, issue #68 D1):q = q_1 (1 + sum_d g_d x_d^n),n = degree(an integer >= 1; n = 1 islinear). Per-direction degree n: exact under the same-level copy and the boundary conditions (copies of cells), under the 2:1 restriction when it is exact on degree n (lagrange6: n <= 5; the mean: n = 1) and under the coarse->fine fill likewise (tricubic: n <= 3,quintic: n <= 5), soghost_probe.pychecks the high-order seam operators in situ. Not available under a non-dimensional reference.
The primitive keys of a region follow the physical model: r, u, v, w, p (Euler), plus bx, by, bz (MHD; psi is zero). isentropic-vortex is Euler only (issue #41, section 3.7).
isothermal-atmosphere,polytropic-atmosphere(issue #73, M7-G0): the hydrostatic equilibrium of the constant gravitygof[gravity](required), with the state of region 1 at the origin (its velocity and field uniform): isothermal,rho = rho_1 exp(g . x / T_1),p = rho T_1,T_1 = p_1 / rho_1; polytropic,p = p_1 (rho / rho_1)^GwithG = polytropic_gamma > 1,rho = rho_1 (1 + (G - 1) / G rho_1 / p_1 g . x)^(1 / (G - 1)), fatal where the bracket is not positive (the atmosphere's top lies inside the domain). Point values at the cell centres.rayleigh-taylor(issue #73, M7-G3, GV-4): two isothermal layers under the constant gravitygof[gravity](required, along one axis), cold and dense over hot and light, joined by a tanh temperature at the heightrt_height(h = -g . x / |g|):T = a + b tanh((h - h_0) / rt_width),a = (T_l + T_h) / 2,b = (T_h - T_l) / 2,T_l = p_1 / rho_1(region 1, the light layer),T_h = T_l / rt_density_ratio; hydrostatic,p = p_1 exp(-|g| int_{h_0}^h dh / T)in closed form (p(h_0) = p_1),rho = p / T, at rest with region 1's field. Seeded with a solenoidal single mode,v_h = A cos(k x_t) f(h)along -g andu_t = -A / k sin(k x_t) f'(h)along x_t (the first axis other than g's),A = rt_amplitude,k = 2 pi / rt_wavelength,f = exp(-((h - h_0) / rt_seed_width)^2): divergence-free, so the seed starts no sound waves. Every layer is stably stratified, so the interface is the only instability; the linear growth rate isverification/gravity/rt_oracle.py.polytrope(issue #81, M8-P4, SV-7/SV-8; Euler,[gravity].(self_gravity)required): an n = 1 polytrope star of radiusstar_radius(a) and central densitystar_density(rho_c), centred at (star_x0,star_y0,star_z0) (default the origin), in a light atmosphere set by region 1: inside,rho = rho_1 + rho_s,p = p_1 + f K rho_s^2,rho_s = rho_c sin(k r) / (k r)(k = pi / a),K = 2 G a^2 / pi(the star alone is then in equilibrium: Lane-Emden n = 1) andf = star_pressure_factor(default 1; f < 1 collapses it); outside, the atmosphere is isothermal atT = p_1 / rho_1and hydrostatic in the star's field,rho = rho_1 exp(G M / T (1/r - 1/a)),p = rho T,M = 4 rho_c a^3 / pi(a uniform atmosphere would fall onto the star and thin at its surface, which only the positivity limiter survives); region 1's velocity. Density and pressure are continuous at the surface.
Source: src/app/flume/common/adam_flume_ic_object.F90
Dependencies
Contents
- flume_ic_object
- initialize
- load_from_file
- set_equilibrium
- set_initial_conditions
- hash_cell
- linear_wave_eigenvector
- mhd_vortex
- mhd_rotor
- atmosphere_state
- rotate_to_global
- isentropic_vortex
- becker_shock
- description
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
INI_SECTION_NAME | character(len=18) | parameter | INI section name. |
IC_UNIFORM_STR | character(len=7) | parameter | Uniform state. |
IC_ISENTROPIC_VORTEX_STR | character(len=17) | parameter | Isentropic vortex in a free stream. |
IC_RIEMANN_PROBLEM_STR | character(len=15) | parameter | Piecewise-constant regions. |
IC_GLM_PULSE_STR | character(len=9) | parameter | Gaussian pulse in B along an axis (MHD). |
PULSE_KEY | character(len=15) | parameter | GLM pulse keys. |
IC_DIVB_PEAK_STR | character(len=9) | parameter | Dedner peak in B_x (MHD). |
PEAK_KEY | character(len=14) | parameter | div(B) peak keys. |
IC_MHD_LINEAR_WAVE_STR | character(len=15) | parameter | MHD linear wave (MHD). |
WAVE_KEY | character(len=14) | parameter | Linear wave and CPAW keys. |
IC_MHD_CPAW_STR | character(len=8) | parameter | Circularly polarised Alfven wave (MHD). |
IC_MHD_VORTEX_STR | character(len=10) | parameter | Magnetised vortex in a free stream (MHD). |
IC_ORSZAG_TANG_STR | character(len=11) | parameter | Orszag-Tang vortex (MHD). |
IC_MHD_ROTOR_STR | character(len=9) | parameter | MHD rotor (MHD). |
IC_FIELD_LOOP_STR | character(len=10) | parameter | Advected field loop (MHD). |
LOOP_KEY | character(len=14) | parameter | Field loop keys. |
IC_ROTATED_RIEMANN_STR | character(len=15) | parameter | Rotated periodic Riemann problem. |
IC_SHU_OSHER_STR | character(len=9) | parameter | Shock-density wave interaction (Euler). |
IC_LINEAR_STR | character(len=6) | parameter | Linear field (verification of ghost fills). |
IC_POLYNOMIAL_STR | character(len=10) | parameter | Polynomial field (verification, #68 D1). |
IC_SINE_WAVE_STR | character(len=9) | parameter | Small sine wave on a uniform state (issue #65). |
SINE_MODE_SHEAR | character(len=5) | parameter | Sine wave: transverse velocity (shear) wave. |
SINE_MODE_ACOUSTIC | character(len=8) | parameter | Sine wave: right-running acoustic wave. |
SINE_MODE_MAGNETIC | character(len=8) | parameter | Sine wave: transverse field (MHD). |
SINE_MODE_ENTROPY | character(len=7) | parameter | Sine wave: density (entropy) wave. |
SINE_MODE_JEANS | character(len=5) | parameter | Sine wave: Jeans mode (self-gravity, #81). |
ATM_PULSE_KEY | character(len=15) | parameter | Atmosphere pulse keys. |
IC_COUETTE_STR | character(len=7) | parameter | Exact compressible Couette flow (issue #65). |
COUETTE_KEY | character(len=16) | parameter | Couette keys. |
IC_BECKER_STR | character(len=12) | parameter | Becker's exact viscous shock (issue #65). |
IC_ISOTHERMAL_ATM_STR | character(len=21) | parameter | Isothermal atmosphere (issue #73). |
IC_POLYTROPIC_ATM_STR | character(len=21) | parameter | Polytropic atmosphere (issue #73). |
IC_RAYLEIGH_TAYLOR_STR | character(len=15) | parameter | Two isothermal layers, heavy over light (#73). |
IC_POLYTROPE_STR | character(len=9) | parameter | n = 1 polytrope star, self-gravity (#81). |
STAR_KEY | character(len=20) | parameter | Polytrope keys. |
RT_KEY | character(len=16) | parameter | RT keys. |
BECKER_KEY | character(len=8) | parameter | Becker shock keys. |
LINEAR_KEY | character(len=10) | parameter | Linear field gradient keys. |
SHU_OSHER_KEY | character(len=14) | parameter | Shu-Osher keys. |
ROTATED_KEY | character(len=17) | parameter | Rotated Riemann keys. |
ROTOR_KEY | character(len=6) | parameter | MHD rotor keys. |
MHD_VORTEX_KEY | character(len=6) | parameter | Magnetised vortex keys. |
VORTEX_KEY | character(len=8) | parameter | Vortex keys. |
PI | real(kind=R8P) | parameter | Pi greek. |
PRIM_KEY | character(len=2) | parameter | Region primitive state keys (MHD: all 8). |
EXTENT_KEY | character(len=6) | parameter | Region extents keys. |
Derived Types
flume_ic_object
FLUME initial conditions class definition.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
amr_iterations | integer(kind=I4P) | AMR iterations performed while imposing the initial conditions. | |
ic_type | character(len=:) | allocatable | Initial conditions type. |
regions_number | integer(kind=I4P) | Regions number. | |
model | integer(kind=I4P) | Physical model id. | |
nprim | integer(kind=I4P) | Primitive keys number of a region: 5 (Euler) or 8 (MHD). | |
q_region | real(kind=R8P) | allocatable | Conservative state of each region [nv, regions_number]. |
emin | real(kind=R8P) | allocatable | Minimum corner of each region [3, regions_number]. |
emax | real(kind=R8P) | allocatable | Maximum corner of each region [3, regions_number]. |
gamma | real(kind=R8P) | Specific heats ratio. | |
prim_1 | real(kind=R8P) | Primitive state of region 1, the free stream (first nprim used). | |
s | real(kind=R8P) | Uniform: relative amplitude of the seeded perturbation. | |
vortex | real(kind=R8P) | Isentropic vortex: x0, y0, radius, strength. | |
pulse_axis | integer(kind=I4P) | GLM pulse: axis, 1=x, 2=y, 3=z. | |
pulse | real(kind=R8P) | GLM pulse: center, width, amplitude. | |
peak | real(kind=R8P) | div(B) peak: x0, y0, radius, amplitude. | |
wave | character(len=:) | allocatable | Linear wave family: fast, alfven, slow, entropy. |
wave_par | real(kind=R8P) | Linear wave, CPAW: angle (degrees), amplitude, wavelength. | |
wave_r | real(kind=R8P) | Linear wave: right eigenvector, global frame. | |
b_par | real(kind=R8P) | CPAW: field along the wave normal. | |
polarisation | real(kind=R8P) | CPAW: +1 right, -1 left. | |
mvortex | real(kind=R8P) | Magnetised vortex: x0, y0, radius, kappa, mu. | |
rotor | real(kind=R8P) | MHD rotor: x0, y0, r0, r1, rho_in, v0. | |
loop | real(kind=R8P) | Field loop: x0, y0, radius, amplitude. | |
rotated | real(kind=R8P) | Rotated Riemann: normal x, y, interface 1, 2, period, width 2. | |
prim_2 | real(kind=R8P) | Primitive state of region 2 (global frame, first nprim used). | |
shu_osher_axis | integer(kind=I4P) | Shu-Osher: axis, 1=x, 2=y, 3=z. | |
shu_osher | real(kind=R8P) | Shu-Osher: interface, density amplitude, density wavenumber. | |
gradient | real(kind=R8P) | Linear: relative gradient g, q = q_1 (1 + g . x). | |
degree | integer(kind=I4P) | Polynomial: degree n, q = q_1 (1 + sum_d g_d x_d^n). | |
sine_mode | character(len=:) | allocatable | Sine wave: shear, acoustic, entropy, magnetic or jeans. |
four_pi_g | real(kind=R8P) | Sine wave, jeans: 4 pi G of the self-gravity. | |
couette | real(kind=R8P) | Couette: fixed wall y, height, moving wall velocity, T_wall. | |
couette_heat | real(kind=R8P) | Couette: mu U^2 / (k H), the temperature rise scale. | |
R | real(kind=R8P) | Gas constant. | |
becker | real(kind=R8P) | Becker shock: upstream Mach number, shock position. | |
becker_mu | real(kind=R8P) | Becker shock: viscosity. | |
cp | real(kind=R8P) | Specific heat at constant pressure. | |
g | real(kind=R8P) | Atmospheres: gravity. | |
polytropic_gamma | real(kind=R8P) | Polytropic atmosphere: exponent G of p ~ rho^G. | |
atm_pulse | real(kind=R8P) | Atmospheres: pressure pulse amplitude (relative), centre, width. | |
rt | real(kind=R8P) | seed amplitude, seed width. | |
rt_axis | integer(kind=I4P) | Rayleigh-Taylor: axis of the gravity. | |
rt_t1 | integer(kind=I4P) | Rayleigh-Taylor: axis of the seeded mode. | |
star | real(kind=R8P) | Polytrope: radius, central density, centre, pressure factor. | |
star_k | real(kind=R8P) | Polytrope: K of p = K rho^2 in equilibrium, 2 G a^2 / pi. | |
star_gm | real(kind=R8P) | Polytrope: G M of the star, 4 G rho_c a^3 / pi. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
description | pass(self) | Return pretty-printed object description. |
initialize | pass(self) | Initialize initial conditions. |
load_from_file | pass(self) | Load config from file. |
set_initial_conditions | pass(self) | Set initial conditions on the blocks interior. |
set_equilibrium | pass(self) | Set the hydrostatic equilibrium on the blocks interior. |
atmosphere_state | pass(self) | Primitive state of the atmosphere at a point. |
Subroutines
initialize
Initialize initial conditions.
fortran
subroutine initialize(self, file_parameters, physics)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_ic_object) | inout | Initial conditions. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. | |
physics | type(flume_physics_object) | in | Physics (for the regions state conversion). |
Call graph
load_from_file
Load config from file; every key used by the selected type is required and an unknown type is fatal.
fortran
subroutine load_from_file(self, file_parameters, physics)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_ic_object) | inout | Initial conditions. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. | |
physics | type(flume_physics_object) | in | Physics (for the regions state conversion). |
Call graph
set_equilibrium
Set the hydrostatic equilibrium of the well-balanced mode on the blocks interior (issue #73, M7-G2b): the atmosphere of the initial conditions at rest (zero velocity, region 1's field, no pulse or seed); the ghost cells are filled by the residual's ghost update. Fatal if the initial conditions are not an atmosphere.
fortran
subroutine set_equilibrium(self, field, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_ic_object) | in | Initial conditions. | |
field | type(field_object) | in | Field (realm component, threaded in). | |
q | real(kind=R8P) | inout | Conservative variables. |
Call graph
set_initial_conditions
Set initial conditions on the blocks interior; ghost cells are filled by the following ghost update.
fortran
subroutine set_initial_conditions(self, field, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_ic_object) | in | Initial conditions. | |
field | type(field_object) | in | Field (realm component, threaded in). | |
q | real(kind=R8P) | inout | Conservative variables. |
Call graph
hash_cell
Return two pseudo-random numbers in [-1, 1) that depend only on the block Morton code and the cell indexes.
Integer mixing with no integer overflow, so the same bits on every compiler; the cell key never depends on the rank that owns the block. The key is chained (mix the code, then fold in i, j, k one at a time and mix again), so keys whose bits overlap, such as small codes and small indexes, do not collide. Xorshift alone is linear over GF(2), which would make the numbers an affine function of the key bits (exactly equidistributed, spatially structured): each mix also multiplies by an odd constant modulo 2^52 (xorshift* idea, Vigna 2016), in 26-bit limbs to stay in range.
Attributes: pure
fortran
subroutine hash_cell(code, i, j, k, h)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
code | integer(kind=I8P) | in | Block Morton code. | |
i | integer(kind=I4P) | in | Cell indexes. | |
j | integer(kind=I4P) | in | Cell indexes. | |
k | integer(kind=I4P) | in | Cell indexes. | |
h | real(kind=R8P) | out | Pseudo-random numbers in [-1, 1). |
Call graph
linear_wave_eigenvector
Return the right eigenvector of the right-going wave of the conservative MHD system at the primitive state prim (global frame), for the wave normal at angle degrees in the x-y plane: the state is rotated into the frame of the normal, R is the column of mhd_eigenvectors (x direction of that frame; waves ordered u_n - c_f, u_n - c_a, u_n - c_s, u_n, u_n + c_s, u_n + c_a, u_n + c_f, B_n), and its momentum and field are rotated back to x, y, z.
Attributes: pure
fortran
subroutine linear_wave_eigenvector(gamma, R, prim, wave, angle, r_global)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
R | real(kind=R8P) | in | Gas constant. | |
prim | real(kind=R8P) | in | Primitive state, global frame (r, u, v, w, p, bx, by, bz). | |
wave | character(len=*) | in | Wave family: fast, alfven, slow, entropy. | |
angle | real(kind=R8P) | in | Wave normal angle in the x-y plane (degrees). | |
r_global | real(kind=R8P) | out | Right eigenvector, global frame. |
Call graph
mhd_vortex
Return the primitive state of the magnetised vortex at (x, y) (formulas in the module documentation).
Attributes: pure
fortran
subroutine mhd_vortex(prim0, mvortex, x, y, prim)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
prim0 | real(kind=R8P) | in | Free stream primitive state (r, u, v, w, p, bx, by, bz), bx = by = 0. | |
mvortex | real(kind=R8P) | in | Vortex x0, y0, radius, kappa, mu. | |
x | real(kind=R8P) | in | Point coordinates. | |
y | real(kind=R8P) | in | Point coordinates. | |
prim | real(kind=R8P) | out | Primitive state. |
Call graph
mhd_rotor
Return the primitive state of the MHD rotor at (x, y) (formulas in the module documentation).
Attributes: pure
fortran
subroutine mhd_rotor(prim0, rotor, x, y, prim)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
prim0 | real(kind=R8P) | in | Ambient primitive state (r, u, v, w, p, bx, by, bz). | |
rotor | real(kind=R8P) | in | Rotor x0, y0, r0, r1, rho_in, v0. | |
x | real(kind=R8P) | in | Point coordinates. | |
y | real(kind=R8P) | in | Point coordinates. | |
prim | real(kind=R8P) | out | Primitive state. |
Call graph
atmosphere_state
Primitive state of the atmosphere at rest at the point center (issue #73): isothermal, rho = rho_1 exp(g . x / T_1), p = rho T_1; polytropic, rho = rho_1 s^(1/(G-1)), p = p_1 s^(G/(G-1)), s = 1 + (G - 1) / G rho_1 / p_1 g . x; Rayleigh-Taylor, the two layers of the module header, with int_0^z dz / (a + b tanh z) = (a z - b ln(a cosh z + b sinh z) + b ln a) / (a^2 - b^2); zero velocity, region 1's field. Fatal where the polytrope has no mass.
fortran
subroutine atmosphere_state(self, center, prim)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_ic_object) | in | Initial conditions. | |
center | real(kind=R8P) | in | Point. | |
prim | real(kind=R8P) | out | Primitive state (first nprim used). |
Call graph
rotate_to_global
Rotate the velocity and (MHD) the field of a primitive state from the frame of normal (normal, tangential, z) to x, y, z: v = v_n n + v_t t, n = normal / |normal|, t = (-n_y, n_x).
Attributes: pure
fortran
subroutine rotate_to_global(normal, nprim, prim)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
normal | real(kind=R8P) | in | Normal, (x, y), not normalised. | |
nprim | integer(kind=I4P) | in | Primitive keys number: 5 (Euler) or 8 (MHD). | |
prim | real(kind=R8P) | inout | Primitive state (r, u, v, w, p, bx, by, bz). |
Call graph
isentropic_vortex
Return the conservative state of the isentropic vortex at (x, y) (formulas in the module documentation).
Attributes: pure
fortran
subroutine isentropic_vortex(gamma, prim, vortex, x, y, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
prim | real(kind=R8P) | in | Free stream primitive state (r, u, v, w, p). | |
vortex | real(kind=R8P) | in | Vortex x0, y0, radius, strength. | |
x | real(kind=R8P) | in | Point coordinates. | |
y | real(kind=R8P) | in | Point coordinates. | |
q | real(kind=R8P) | out | Conservative variables. |
Call graph
becker_shock
Set Becker's exact viscous shock (Becker 1922, Z. Phys. 8, 321): steady 1-D Navier-Stokes along x, constant mu, Prandtl number 3/4 (the total enthalpy H = cp T + u^2 / 2 is then uniform), upstream state prim1 moving at u1 = mach a1 towards +x, shock centred at x0 (where u = (u1 + u2) / 2). With m = rho1 u1, the momentum integral is 4/3 mu u u' = m (gamma+1) / (2 gamma) (u - u1) (u - u2), whose solution is the implicit K (x - x0) = F(u) - F((u1 + u2) / 2), F(u) = A ln(u1 - u) + B ln(u - u2), K = 3 m (gamma+1) / (8 gamma mu), A = u1 / (u1 - u2), B = -u2 / (u1 - u2); F decreases monotonically, so bisection finds u.
fortran
subroutine becker_shock(gamma, R, cp, mu, prim1, mach, x0, x, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio, gas constant, cp. | |
R | real(kind=R8P) | in | Specific heats ratio, gas constant, cp. | |
cp | real(kind=R8P) | in | Specific heats ratio, gas constant, cp. | |
mu | real(kind=R8P) | in | Viscosity. | |
prim1 | real(kind=R8P) | in | Upstream primitive state (rho, p used; velocity from the Mach number). | |
mach | real(kind=R8P) | in | Upstream Mach number. | |
x0 | real(kind=R8P) | in | Shock position. | |
x | real(kind=R8P) | in | Abscissa. | |
q | real(kind=R8P) | out | Conservative variables. |
Call graph
Functions
description
Return a pretty-formatted object description.
Returns: character(len=:)
fortran
function description(self) result(desc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_ic_object) | in | Initial conditions. |
Call graph