Skip to content

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 amplitude s, rho (1 + s h1), p (1 + s h2), with h1, h2 in [-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 radius radius and velocity strength strength (Shu 1998, ICASE 97-65, section 5.1, written for any free stream); optional shock_x: past it the Rankine-Hugoniot state of a stationary shock, region 1 upstream and supersonic: 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 iff emin < center <= emax on 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 along pulse_axis (x, y or z), B_axis += pulse_amplitude exp(-((s - pulse_center) / pulse_width)^2), s the cell coordinate along the axis; pressure and velocity unchanged (psi zero);

  • divb-peak (MHD only, the Dedner et al. 2002 peak in B_x, issue #41, MV-10): the state of region 1 plus B_x += peak_amplitude (1 - (s / peak_radius)^2)^2 for s < peak_radius, s the 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 state q0 of region 1 (global frame) plus wave_amplitude R sin(2 pi (x cos a + y sin a) / wavelength), a = wave_angle (degrees, in the x-y plane), R the right eigenvector of the right-going wave (fast, alfven, slow or entropy) of the conservative system at q0 in the frame of the wave normal (the library Roe-Balsara core, mhd_eigenvectors), rotated back to x, y, z; after one period wavelength / |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 field b_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 under z -> -z); |B_perp| is uniform, so the total pressure is too, and the wave travels along +n unchanged at |b_par| / sqrt(rho): after one period wavelength 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 radius radius: 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 balance dp/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 of s = 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: for r < r0 density rho_in and velocity v0 (-(y-y0), x-x0) / r0 (speed v0 at r0); for r0 <= r < r1 the linear taper f = (r1 - r) / (r1 - r0), density rho + (rho_in - rho) f, velocity f 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 potential A_z = loop_amplitude (loop_radius - r) for r < loop_radius, r = |x - (x0, y0)| in the x-y plane: dB = loop_amplitude (-(y-y0), x-x0) / r inside the loop, zero outside (divergence-free pointwise, discontinuous at r = loop_radius); with a uniform w the discrete div(B) feeds B_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 coordinate s = normal_x x + normal_y y (unnormalised), and with f = modulo(s - interface_1, period), d = interface_2 - interface_1 and w = interface_2_width a cell is in region 2 iff 0 < f <= d, in the linear ramp of the primitive variables from region 2 to region 1 iff d < f <= d + w (at f = d + w region 1), in region 1 otherwise: a jump at interface_1, and at interface_2 a 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, bz along z) and rotated to x, y. With integer normal components on a square periodic domain of side period, the state is periodic in x and in y (Toth's shifted-periodic strip is not needed).

  • channel (issue #119, T3.1; euler): a plane channel between y = +-ch_h, ch_rho, bulk velocity ch_ub, wall Mach ch_mach, ch_lx, ch_lz, perturbation ch_pert.

  • boundary-layer (issue #119, T3.7; euler): the mean profile of a table (the format of the digital-filter inflow, adam_flume_inflow_df_object) over a wall at y = bl_wall (default 0), flow along +x: bl_profile, bl_delta, free stream bl_rho, bl_u, bl_p; uniform along x and z.

  • taylor-green (issue #119, T0.2; euler, euler-de): the compressible Taylor-Green vortex of DeBonis (2013), tg_density (rho_0), tg_velocity (V_0), tg_mach (M_0), tg_length (L, default 1), no regions: u = V_0 sin(x/L) cos(y/L) cos(z/L), v = -V_0 cos(x/L) sin(y/L) cos(z/L), w = 0, p = p_0 + rho_0 V_0^2 / 16 (cos(2x/L) + cos(2y/L)) (cos(2z/L) + 2), p_0 = rho_0 V_0^2 / (gamma M_0^2), at uniform temperature, rho = rho_0 p / p_0. The box is [0, 2 pi L]^3, periodic; the initial condition does not check it.

  • isotropic-turbulence (issue #119, T0.5; euler, euler-de): the decaying compressible isotropic turbulence of Johnsen et al. (2010), hit_density (rho_0), hit_urms (u_rms), hit_mach (M_t = sqrt(3) u_rms / c_0), hit_k0 (k_0), hit_seed (default 1), no regions: uniform density and pressure, p_0 = rho_0 c_0^2 / gamma, and a solenoidal velocity u = sum 2 Re(a_k exp(i k.x)) over the integer wavevectors of a half space with |k| <= 3 k_0, of random phases (Rogallo 1981), each shell s = nint(|k|) holding E(s) = 16 sqrt(2/pi) u_rms^2 / k_0 (s/k_0)^4 exp(-2 (s/k_0)^2), the sum rescaled so that the mean of |u|^2 is exactly 3 u_rms^2. The sequence depends on the seed alone (MINSTD, its own state), so the field is the same on any rank count, block layout and resolution. The box is [0, 2 pi]^3, periodic; the initial condition does not check it, nor that 3 k_0 is below the Nyquist wavenumber of the grid.

  • shu-osher (Euler only, issue #47, RV-3; Shu & Osher 1989, J. Comput. Phys. 83, example 8): a shock running into a density wave along axis (x, y or z), coordinate s: the state of region 1 for s <= interface, else the state of region 2 with density r + rho_amplitude sin(rho_wavenumber s) (the classic problem: region 1 3.857143, 2.629369, 10.33333, region 2 1, 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) with q_1 the state of region 1 and the relative gradient g = (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 while 1 + g . x > 0 over 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 is linear). 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), so ghost_probe.py checks 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 gravity g of [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)^G with G = 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 gravity g of [gravity] (required, along one axis), cold and dense over hot and light, joined by a tanh temperature at the height rt_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 and u_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 is verification/gravity/rt_oracle.py.
  • polytrope (issue #81, M8-P4, SV-7/SV-8; Euler, [gravity].(self_gravity) required): an n = 1 polytrope star of radius star_radius (a) and central density star_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) and f = star_pressure_factor (default 1; f < 1 collapses it); outside, the atmosphere is isothermal at T = p_1 / rho_1 and 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.
  • singular-isothermal-sphere (issue #94, M12-P4, SI si11; Euler, [gravity].(self_gravity) required): the singular isothermal sphere at rest centred at (sis_x0, sis_y0, sis_z0) (default the origin), rho = A a^2 / (4 pi G r^2) (the cell mean), p = rho a^2, a^2 = p_1 / rho_1 (region 1's temperature: only the ratio is used), region 1's velocity, A = sis_overdensity (default 2, > 0): A = 2 is the hydrostatic sphere of Shu (1977), whose inside-out collapse accretes at 0.975 a^3 / G; A > 2 collapses everywhere at m_0(A) a^3 / G (Shu's A-family; A = 29.3 is the run of Federrath et al. 2010, section 3.4). Fatal at a cell centre on the centre (place it on a cell corner). With [eos] type = isothermal (issue #100, P4) a^2 = c0^2, the gas's own sound speed.
  • bonnor-ebert (issue #100, P4; [eos] type = isothermal and [gravity].(self_gravity) required): the isothermal Lane-Emden sphere at rest centred at (be_x0, be_y0, be_z0) (default the origin), rho = rho_c exp(-psi(xi)), xi = r / r_0, r_0 = c0 / sqrt(4 pi G rho_c), rho_c = be_density (> 0), psi'' + 2 psi' / xi = exp(-psi), psi(0) = psi'(0) = 0 (RK4 on xi steps of 1e-3, read by cubic Hermite interpolation), region 1's velocity. It fills the domain: closed walls confine it, and the sphere inscribed in the box is a Bonnor-Ebert sphere of its xi, stable below 6.45 (Bonnor 1956, Ebert 1955). be_overdensity (default 1, > 0) multiplies the density everywhere (above 1 the sphere is no equilibrium and collapses: a supercritical sphere left exactly in equilibrium may as well expand).
  • boss-bodenheimer (issue #100, P4; [eos] isothermal or barotropic, [gravity].(self_gravity) required): the rotating cloud of Boss & Bodenheimer (1979) as set by Burkert & Bodenheimer (1993): a sphere of radius bb_radius centred at (bb_x0, bb_y0, bb_z0) (default the origin), rho = bb_density (1 + bb_amplitude cos(2 phi)) (bb_amplitude default 0.1, phi the azimuth about z), in solid-body rotation about z at bb_omega; outside, region 1's density and velocity (the light ambient medium). The density and velocity only: the pressure is the gas's own P(rho).

Source: src/app/flume/common/adam_flume_ic_object.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
INI_SECTION_NAMEcharacter(len=18)parameterINI section name.
IC_UNIFORM_STRcharacter(len=7)parameterUniform state.
IC_ISENTROPIC_VORTEX_STRcharacter(len=17)parameterIsentropic vortex in a free stream.
IC_RIEMANN_PROBLEM_STRcharacter(len=15)parameterPiecewise-constant regions.
IC_GLM_PULSE_STRcharacter(len=9)parameterGaussian pulse in B along an axis (MHD).
PULSE_KEYcharacter(len=15)parameterGLM pulse keys.
IC_DIVB_PEAK_STRcharacter(len=9)parameterDedner peak in B_x (MHD).
PEAK_KEYcharacter(len=14)parameterdiv(B) peak keys.
IC_MHD_LINEAR_WAVE_STRcharacter(len=15)parameterMHD linear wave (MHD).
WAVE_KEYcharacter(len=14)parameterLinear wave and CPAW keys.
IC_MHD_CPAW_STRcharacter(len=8)parameterCircularly polarised Alfven wave (MHD).
IC_MHD_VORTEX_STRcharacter(len=10)parameterMagnetised vortex in a free stream (MHD).
IC_ORSZAG_TANG_STRcharacter(len=11)parameterOrszag-Tang vortex (MHD).
IC_MHD_ROTOR_STRcharacter(len=9)parameterMHD rotor (MHD).
IC_FIELD_LOOP_STRcharacter(len=10)parameterAdvected field loop (MHD).
LOOP_KEYcharacter(len=14)parameterField loop keys.
IC_ROTATED_RIEMANN_STRcharacter(len=15)parameterRotated periodic Riemann problem.
IC_CHANNEL_STRcharacter(len=7)parameterPlane channel, parabolic with a perturbation (issue #119, T3.1).
IC_BOUNDARY_LAYER_STRcharacter(len=14)parameterMean profile of a boundary layer (issue #119, T3.7).
BL_KEYcharacter(len=8)parameterBoundary-layer keys.
IC_TAYLOR_GREEN_STRcharacter(len=12)parameterCompressible Taylor-Green vortex (issue #119).
CHANNEL_KEYcharacter(len=7)parameterChannel keys.
TG_KEYcharacter(len=11)parameterTaylor-Green required keys.
IC_ISOTROPIC_TURB_STRcharacter(len=20)parameterDecaying isotropic turbulence (issue #119).
HIT_KEYcharacter(len=11)parameterIts required keys.
IC_SHU_OSHER_STRcharacter(len=9)parameterShock-density wave interaction (Euler).
IC_LINEAR_STRcharacter(len=6)parameterLinear field (verification of ghost fills).
IC_POLYNOMIAL_STRcharacter(len=10)parameterPolynomial field (verification, #68 D1).
IC_SINE_WAVE_STRcharacter(len=9)parameterSmall sine wave on a uniform state (issue #65).
SINE_MODE_SHEARcharacter(len=5)parameterSine wave: transverse velocity (shear) wave.
SINE_MODE_ACOUSTICcharacter(len=8)parameterSine wave: right-running acoustic wave.
SINE_MODE_MAGNETICcharacter(len=8)parameterSine wave: transverse field (MHD).
SINE_MODE_ENTROPYcharacter(len=7)parameterSine wave: density (entropy) wave.
SINE_MODE_JEANScharacter(len=5)parameterSine wave: Jeans mode (self-gravity, #81).
ATM_PULSE_KEYcharacter(len=15)parameterAtmosphere pulse keys.
IC_COUETTE_STRcharacter(len=7)parameterExact compressible Couette flow (issue #65).
COUETTE_KEYcharacter(len=16)parameterCouette keys.
IC_BECKER_STRcharacter(len=12)parameterBecker's exact viscous shock (issue #65).
IC_ISOTHERMAL_ATM_STRcharacter(len=21)parameterIsothermal atmosphere (issue #73).
IC_POLYTROPIC_ATM_STRcharacter(len=21)parameterPolytropic atmosphere (issue #73).
IC_RAYLEIGH_TAYLOR_STRcharacter(len=15)parameterTwo isothermal layers, heavy over light (#73).
IC_POLYTROPE_STRcharacter(len=9)parametern = 1 polytrope star, self-gravity (#81).
IC_SIS_STRcharacter(len=26)parameterSingular isothermal sphere, self-gravity (#94).
SIS_KEYcharacter(len=15)parameterSingular isothermal sphere keys.
IC_BE_STRcharacter(len=12)parameterIsothermal Lane-Emden sphere, self-gravity (#100).
BE_KEYcharacter(len=14)parameterBonnor-Ebert keys.
BE_DXIreal(kind=R8P)parameterBonnor-Ebert: Lane-Emden table step in xi.
IC_BB_STRcharacter(len=16)parameterRotating cloud, m = 2 perturbation (#100).
BB_KEYcharacter(len=12)parameterBoss-Bodenheimer keys.
STAR_KEYcharacter(len=20)parameterPolytrope keys.
RT_KEYcharacter(len=16)parameterRT keys.
BECKER_KEYcharacter(len=8)parameterBecker shock keys.
LINEAR_KEYcharacter(len=10)parameterLinear field gradient keys.
SHU_OSHER_KEYcharacter(len=14)parameterShu-Osher keys.
ROTATED_KEYcharacter(len=17)parameterRotated Riemann keys.
ROTOR_KEYcharacter(len=6)parameterMHD rotor keys.
MHD_VORTEX_KEYcharacter(len=6)parameterMagnetised vortex keys.
VORTEX_KEYcharacter(len=8)parameterVortex keys.
PIreal(kind=R8P)parameterPi greek.
PRIM_KEYcharacter(len=2)parameterRegion primitive state keys (MHD: all 8).
EXTENT_KEYcharacter(len=6)parameterRegion extents keys.

Derived Types ​

flume_ic_object ​

FLUME initial conditions class definition.

Components ​

NameTypeAttributesDescription
amr_iterationsinteger(kind=I4P)AMR iterations performed while imposing the initial conditions.
ic_typecharacter(len=:)allocatableInitial conditions type.
regions_numberinteger(kind=I4P)Regions number.
modelinteger(kind=I4P)Physical model id.
npriminteger(kind=I4P)Primitive keys number of a region: 5 (Euler) or 8 (MHD).
q_regionreal(kind=R8P)allocatableConservative state of each region [nv, regions_number].
scalarsreal(kind=R8P)allocatablePassive scalars of each region [NS_MAX, regions_number] (#92).
passive_scalarsinteger(kind=I4P)Passive scalars in use (issue #92).
iq_scalar1integer(kind=I4P)Slot of the first passive scalar.
eminreal(kind=R8P)allocatableMinimum corner of each region [3, regions_number].
emaxreal(kind=R8P)allocatableMaximum corner of each region [3, regions_number].
gammareal(kind=R8P)Specific heats ratio.
eos_argreal(kind=R8P)EOS parameter of the barotropic models (issue #100): c0^2 or
prim_1real(kind=R8P)Primitive state of region 1, the free stream (first nprim used).
sreal(kind=R8P)Uniform: relative amplitude of the seeded perturbation.
channelreal(kind=R8P)Channel: density, bulk velocity, wall Mach number, half height, Lx, Lz, perturbation.
blreal(kind=R8P)Boundary layer: delta, free-stream density, speed, pressure, wall position.
bl_profreal(kind=R8P)allocatableBoundary layer: profile table [7, rows].
tgreal(kind=R8P)Taylor-Green: density, velocity, Mach number, length.
hitreal(kind=R8P)Isotropic turbulence: density, u_rms, turbulent Mach number, k_0.
hit_seedinteger(kind=I4P)Isotropic turbulence: seed of the random phases.
vortexreal(kind=R8P)Isentropic vortex: x0, y0, radius, strength.
has_shocklogicalIsentropic vortex: a stationary shock at shock_x (issue #119, T2.7).
shock_xreal(kind=R8P)Isentropic vortex: position of the stationary shock.
pulse_axisinteger(kind=I4P)GLM pulse: axis, 1=x, 2=y, 3=z.
pulsereal(kind=R8P)GLM pulse: center, width, amplitude.
peakreal(kind=R8P)div(B) peak: x0, y0, radius, amplitude.
wavecharacter(len=:)allocatableLinear wave family: fast, alfven, slow, entropy.
wave_parreal(kind=R8P)Linear wave, CPAW: angle (degrees), amplitude, wavelength.
wave_envreal(kind=R8P)Sine wave: Gaussian envelope width (0: none) and centre along n (issue #121).
wave_rreal(kind=R8P)Linear wave: right eigenvector, global frame.
b_parreal(kind=R8P)CPAW: field along the wave normal.
polarisationreal(kind=R8P)CPAW: +1 right, -1 left.
mvortexreal(kind=R8P)Magnetised vortex: x0, y0, radius, kappa, mu.
rotorreal(kind=R8P)MHD rotor: x0, y0, r0, r1, rho_in, v0.
loopreal(kind=R8P)Field loop: x0, y0, radius, amplitude.
rotatedreal(kind=R8P)Rotated Riemann: normal x, y, interface 1, 2, period, width 2.
prim_2real(kind=R8P)Primitive state of region 2 (global frame, first nprim used).
shu_osher_axisinteger(kind=I4P)Shu-Osher: axis, 1=x, 2=y, 3=z.
shu_osherreal(kind=R8P)Shu-Osher: interface, density amplitude, density wavenumber.
gradientreal(kind=R8P)Linear: relative gradient g, q = q_1 (1 + g . x).
degreeinteger(kind=I4P)Polynomial: degree n, q = q_1 (1 + sum_d g_d x_d^n).
sine_modecharacter(len=:)allocatableSine wave: shear, acoustic, entropy, magnetic or jeans.
four_pi_greal(kind=R8P)Sine wave, jeans: 4 pi G of the self-gravity.
couettereal(kind=R8P)Couette: fixed wall y, height, moving wall velocity, T_wall.
couette_heatreal(kind=R8P)Couette: mu U^2 / (k H), the temperature rise scale.
Rreal(kind=R8P)Gas constant.
beckerreal(kind=R8P)Becker shock: upstream Mach number, shock position.
becker_mureal(kind=R8P)Becker shock: viscosity.
cpreal(kind=R8P)Specific heat at constant pressure.
greal(kind=R8P)Atmospheres: gravity.
polytropic_gammareal(kind=R8P)Polytropic atmosphere: exponent G of p ~ rho^G.
atm_pulsereal(kind=R8P)Atmospheres: pressure pulse amplitude (relative), centre, width.
rtreal(kind=R8P)seed amplitude, seed width.
rt_axisinteger(kind=I4P)Rayleigh-Taylor: axis of the gravity.
rt_t1integer(kind=I4P)Rayleigh-Taylor: axis of the seeded mode.
starreal(kind=R8P)Polytrope: radius, central density, centre, pressure factor.
star_kreal(kind=R8P)Polytrope: K of p = K rho^2 in equilibrium, 2 G a^2 / pi.
star_gmreal(kind=R8P)Polytrope: G M of the star, 4 G rho_c a^3 / pi.
sisreal(kind=R8P)Singular isothermal sphere: centre, overdensity A, G.
bereal(kind=R8P)Bonnor-Ebert sphere: centre, central density, overdensity,
bbreal(kind=R8P)Boss-Bodenheimer cloud: radius, density, omega, amplitude,

Type-Bound Procedures ​

NameAttributesDescription
descriptionpass(self)Return pretty-printed object description.
initializepass(self)Initialize initial conditions.
load_from_filepass(self)Load config from file.
set_initial_conditionspass(self)Set initial conditions on the blocks interior.
set_equilibriumpass(self)Set the hydrostatic equilibrium on the blocks interior.
is_barotropic_safepass(self)True if the IC type builds its density without gamma (#100).
atmosphere_statepass(self)Primitive state of the atmosphere at a point.
set_isotropic_turbulencepass(self)Set the isotropic turbulence field (#119).

Subroutines ​

initialize ​

Initialize initial conditions.

fortran
subroutine initialize(self, file_parameters, physics)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_ic_object)inoutInitial conditions.
file_parameterstype(file_ini)inSimulation parameters ini file handler.
physicstype(flume_physics_object)inPhysics (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

NameTypeIntentAttributesDescription
selfclass(flume_ic_object)inoutInitial conditions.
file_parameterstype(file_ini)inSimulation parameters ini file handler.
physicstype(flume_physics_object)inPhysics (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

NameTypeIntentAttributesDescription
selfclass(flume_ic_object)inInitial conditions.
fieldtype(field_object)inField (realm component, threaded in).
qreal(kind=R8P)inoutConservative 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

NameTypeIntentAttributesDescription
selfclass(flume_ic_object)inInitial conditions.
fieldtype(field_object)inField (realm component, threaded in).
qreal(kind=R8P)inoutConservative 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

NameTypeIntentAttributesDescription
codeinteger(kind=I8P)inBlock Morton code.
iinteger(kind=I4P)inCell indexes.
jinteger(kind=I4P)inCell indexes.
kinteger(kind=I4P)inCell indexes.
hreal(kind=R8P)outPseudo-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

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
Rreal(kind=R8P)inGas constant.
primreal(kind=R8P)inPrimitive state, global frame (r, u, v, w, p, bx, by, bz).
wavecharacter(len=*)inWave family: fast, alfven, slow, entropy.
anglereal(kind=R8P)inWave normal angle in the x-y plane (degrees).
r_globalreal(kind=R8P)outRight eigenvector, global frame.

Call graph

linear_wave_eigenvector_inert ​

Return the right eigenvector of the right-going wave of a barotropic MHD model (issue #100, P5), as linear_wave_eigenvector: the column of the isothermal or barotropic mhd_eigenvectors (Kim et al. 1999; waves ordered u_n - c_f, u_n - c_a, u_n - c_s, u_n + c_s, u_n + c_a, u_n + c_f, then the inert slot and B_n), its momentum and field rotated back to x, y, z. There is no entropy mode (refused by the loader).

fortran
subroutine linear_wave_eigenvector_inert(model, eos_arg, prim, wave, angle, r_global)

Arguments

NameTypeIntentAttributesDescription
modelinteger(kind=I4P)inPhysical model id.
eos_argreal(kind=R8P)inEOS parameter: c0^2, or the barotropic table id.
primreal(kind=R8P)inPrimitive state, global frame (r, u, v, w, p, bx, by, bz).
wavecharacter(len=*)inWave family: fast, alfven, slow.
anglereal(kind=R8P)inWave normal angle in the x-y plane (degrees).
r_globalreal(kind=R8P)outRight 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

NameTypeIntentAttributesDescription
prim0real(kind=R8P)inFree stream primitive state (r, u, v, w, p, bx, by, bz), bx = by = 0.
mvortexreal(kind=R8P)inVortex x0, y0, radius, kappa, mu.
xreal(kind=R8P)inPoint coordinates.
yreal(kind=R8P)inPoint coordinates.
primreal(kind=R8P)outPrimitive 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

NameTypeIntentAttributesDescription
prim0real(kind=R8P)inAmbient primitive state (r, u, v, w, p, bx, by, bz).
rotorreal(kind=R8P)inRotor x0, y0, r0, r1, rho_in, v0.
xreal(kind=R8P)inPoint coordinates.
yreal(kind=R8P)inPoint coordinates.
primreal(kind=R8P)outPrimitive 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

NameTypeIntentAttributesDescription
selfclass(flume_ic_object)inInitial conditions.
centerreal(kind=R8P)inPoint.
primreal(kind=R8P)outPrimitive 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

NameTypeIntentAttributesDescription
normalreal(kind=R8P)inNormal, (x, y), not normalised.
npriminteger(kind=I4P)inPrimitive keys number: 5 (Euler) or 8 (MHD).
primreal(kind=R8P)inoutPrimitive state (r, u, v, w, p, bx, by, bz).

Call graph

set_isotropic_turbulence ​

Set the isotropic turbulence field (formulas in the module header): every block sums the modes on its own cells, the exponentials tabulated per axis.

fortran
subroutine set_isotropic_turbulence(self, field, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_ic_object)inThe initial conditions.
fieldtype(field_object)inField (cell centres).
qreal(kind=R8P)inoutConservative variables.

Call graph

isotropic_turbulence_modes ​

Return the modes of the isotropic turbulence field (formulas in the module header): the half space kx > 0, or kx = 0 and ky > 0, or kx = ky = 0 and kz > 0, swept in one order on every rank.

fortran
subroutine isotropic_turbulence_modes(hit, seed, kmax, mode_k, mode_a)

Arguments

NameTypeIntentAttributesDescription
hitreal(kind=R8P)inDensity, u_rms, turbulent Mach number, k_0.
seedinteger(kind=I4P)inSeed of the phases.
kmaxinteger(kind=I4P)inLargest wavenumber.
mode_kinteger(kind=I4P)outallocatableWavevectors, (3, mode).
mode_acomplex(kind=R8P)outallocatableComplex amplitudes, (3, mode).

Call graph

channel_state ​

Return the primitive state (r, u, v, w, p) of a plane channel between y = +-h: uniform density and pressure, the laminar profile 3/2 U (1 - eta^2), and a perturbation of amplitude ch_pert U of a deterministic pattern, vanishing at the walls (2 waves along x, 6 along z), so identical on any rank count.

Attributes: pure

fortran
subroutine channel_state(gamma, ch, x, y, z, prim)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inDensity, bulk velocity, wall Mach number, half height, Lx, Lz, perturbation.
xreal(kind=R8P)inCell centre.
yreal(kind=R8P)inCell centre.
zreal(kind=R8P)inCell centre.
primreal(kind=R8P)outPrimitive state.

Call graph

taylor_green ​

Return the primitive state (r, u, v, w, p) of the compressible Taylor-Green vortex at (x, y, z) (formulas in the module header).

Attributes: pure

fortran
subroutine taylor_green(gamma, tg, x, y, z, prim)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
tgreal(kind=R8P)inDensity, velocity, Mach number, length.
xreal(kind=R8P)inCell centre.
yreal(kind=R8P)inCell centre.
zreal(kind=R8P)inCell centre.
primreal(kind=R8P)outPrimitive state.

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

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
primreal(kind=R8P)inFree stream primitive state (r, u, v, w, p).
vortexreal(kind=R8P)inVortex x0, y0, radius, strength.
xreal(kind=R8P)inPoint coordinates.
yreal(kind=R8P)inPoint coordinates.
qreal(kind=R8P)outConservative 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

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio, gas constant, cp.
Rreal(kind=R8P)inSpecific heats ratio, gas constant, cp.
cpreal(kind=R8P)inSpecific heats ratio, gas constant, cp.
mureal(kind=R8P)inViscosity.
prim1real(kind=R8P)inUpstream primitive state (rho, p used; velocity from the Mach number).
machreal(kind=R8P)inUpstream Mach number.
x0real(kind=R8P)inShock position.
xreal(kind=R8P)inAbscissa.
qreal(kind=R8P)outConservative variables.

Call graph

Functions ​

is_barotropic_safe ​

Return true if the IC type is defined for a barotropic gas (issue #100): its density, velocity and scalars are inputs or gamma-free formulas, and the pressure, which the barotropic gas ignores, enters nothing else. Refused: the isentropic vortex (rho from the adiabat, ^(1/(gamma-1))); the atmospheres and the polytrope (gamma-law equilibria); the dissipation ICs with their module; the MHD vortex (a pressure-balanced equilibrium) and the Orszag-Tang vortex (its density gamma^2 / (4 pi) presumes gamma = 5/3). The MHD ICs whose density, velocity and field are inputs or gamma-free formulas are accepted with the barotropic MHD models (P5); the linear wave takes their eigenvectors. The isothermal spheres (P4), singular and Bonnor-Ebert, are defined for the isothermal gas only.

Attributes: pure

Returns: logical

fortran
function is_barotropic_safe(self) result(safe)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_ic_object)inInitial conditions.

Call graph

description ​

Return a pretty-formatted object description.

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_ic_object)inInitial conditions.

Call graph

lane_emden_isothermal_table ​

Tabulate the isothermal Lane-Emden function (issue #100, P4, the Bonnor-Ebert sphere): psi'' + 2 psi' / xi = exp(-psi), psi(0) = psi'(0) = 0, at the nodes xi_n = n dxi up to xi_max and one beyond: the first node from the series psi = xi^2/6 - xi^4/120 + xi^6/1890 (the equation is singular at 0), the rest by classical RK4.

Attributes: pure

Returns: real(kind=R8P)

fortran
function lane_emden_isothermal_table(xi_max, dxi) result(tab)

Arguments

NameTypeIntentAttributesDescription
xi_maxreal(kind=R8P)inLargest xi to cover.
dxireal(kind=R8P)inNode spacing.

Call graph

lane_emden_isothermal_psi ​

Return psi(xi) from the Lane-Emden table by cubic Hermite interpolation of its nodes (values and slopes).

Attributes: pure

Returns: real(kind=R8P)

fortran
function lane_emden_isothermal_psi(tab, dxi, xi) result(psi)

Arguments

NameTypeIntentAttributesDescription
tabreal(kind=R8P)inpsi and psi' at the nodes [2, 0:n].
dxireal(kind=R8P)inNode spacing.
xireal(kind=R8P)inAbscissa, within the table.

Call graph

inverse_square_mean ​

Mean of 1 / |x - c|^2 over the box [lo, hi] (issue #94, the singular isothermal sphere): by the divergence theorem, div((x - c) / |x - c|^2) = 1 / |x - c|^2 in 3D, the volume integral is the flux of (x - c) / |x - c|^2 through the six faces, int d / (d^2 + u^2 + v^2) du dv on a face at distance d from c: smooth unless the face passes through c, where it vanishes (d = 0). 8 x 8 Gauss-Legendre points per face.

Attributes: pure

Returns: real(kind=R8P)

fortran
function inverse_square_mean(lo, hi, c) result(mean)

Arguments

NameTypeIntentAttributesDescription
loreal(kind=R8P)inBox corners.
hireal(kind=R8P)inBox corners.
creal(kind=R8P)inSingular point.

Call graph