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): 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).

  • 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.

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_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).
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].
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.
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.
vortexreal(kind=R8P)Isentropic vortex: x0, y0, radius, strength.
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_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.

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.
atmosphere_statepass(self)Primitive state of the atmosphere at a point.

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

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

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 ​

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