Skip to content

CHASE ​

CFD-HPC enabled, Adaptive mesh, Simulation code for Euler equations.

Deprecated. CHASE no longer builds against the current library and is superseded by FLUME (issue #35), which solves the same equations on the CPU and FNL backends with verified characteristic WENO, AMR reflux and immersed boundary. CHASE's characteristic projection is applied transposed and its y/z right-eigenvector matrix is singular (issue #36): do not use it for new work.

CHASE solves the compressible inviscid Euler equations on block-structured adaptive meshes. It is built on the ADAM SDK and shares the same common/ + backend pattern as NASTO, but targets the Euler regime (no viscosity or heat diffusion). Only a CPU backend is provided.

Governing equations ​

The compressible Euler equations in conservation form:

∂q∂t+∇⋅F(q)=0

with conservative variables q=(ρ,ρu,ρv,ρw,ρE)⊤ and ideal-gas closure p=ρRT, E=cvT+12(u2+v2+w2).

The Euler flux in the x-direction is:

Fx=(ρuρu2+pρvuρwuρuH),H=E+pρ

with analogous expressions for Fy and Fz.


Source layout ​

src/app/chase/
├── common/                              # Backend-independent modules
│   ├── adam_chase_common_object.F90     # Base object — ADAM SDK + CHASE handlers
│   ├── adam_chase_physics_object.F90    # Fluid physics — EOS, variable layout, flux functions
│   ├── adam_chase_parameters.F90        # Global constants and eigenvector matrices
│   ├── adam_chase_bc_object.F90         # Boundary conditions handler
│   ├── adam_chase_ic_object.F90         # Initial conditions handler
│   ├── adam_chase_io_object.F90         # IO handler (XH5F output, restart, residuals)
│   ├── adam_chase_time_object.F90       # Time integration parameters and state
│   ├── adam_chase_riemann_library.F90   # Riemann solver library (LLF, HLL)
│   └── adam_chase_common_library.F90    # Barrel re-export of all common modules
└── cpu/                                 # CPU backend
    ├── adam_chase_cpu.F90               # Entry point — parses CLI, calls simulate
    └── adam_chase_cpu_object.F90        # Backend object — working arrays, all methods

Variable layout ​

Conservative variables — q(nv=5, ni, nj, nk, nb) ​

IndexSymbolDescription
1ρDensity
2ρux-momentum
3ρvy-momentum
4ρwz-momentum
5ρETotal energy

Auxiliary variables — q_aux(nv_aux=11, ni, nj, nk, nb) ​

IndexSymbolDescription
1ρDensity
2–4u,v,wVelocity components
5pPressure
6TTemperature
7ETotal specific energy
8HTotal specific enthalpy
9aSpeed of sound
10Rf=cp−cvFluid constant
11γ=cp/cvSpecific heats ratio

adam_chase_common_object ​

Base (non-extending) type that holds all ADAM SDK objects and CHASE handlers. Both backends compose the CPU object by extending this type.

Data members ​

MemberTypeDescription
mpihmpih_objectMPI handler
adamadam_objectADAM SDK — grid, tree, field, AMR, IO
fieldfield_object (pointer)Field variable storage and ghost-cell maps
gridgrid_object (pointer)Structured block grid
amramr_objectAMR marker handler
ibib_objectImmersed Boundary handler
slicesslices_objectSlice sampling for output
rkrk_objectRunge-Kutta integrator
wenoweno_objectWENO reconstructor
iochase_io_objectIO handler
physicschase_physics_objectPhysics — EOS, WENO basis
icchase_ic_objectInitial conditions
bcchase_bc_objectBoundary conditions
timechase_time_objectTime state and parameters
qreal(R8P)(nv,…,nb)Conservative variables
q_auxreal(R8P)(nv_aux,…,nb)Auxiliary variables

initialize_common(field, filename, …) ​

Parses the INI file; initialises all handlers; builds the ADAM grid, tree, and field; performs uniform refinement and pruning; binds all pointer members. Output variable names registered with ADAM IO: r_a u_a v_a w_a p_a a_a T_a E_a H_a Rfa g_a.


adam_chase_physics_object ​

Encapsulates the fluid EOS and WENO reconstruction basis selection.

Key data members ​

MemberDescription
nv = 5Conservative variable count
nv_aux = 11Auxiliary variable count
eoseos_ic_object — ideal-gas state functions (R, cv, g, …)
weno_rec_var'CONSERVATIVE' or 'CHARACTERISTICS'
erw, elwRight/left eigenvector matrices for WENO projection (pointer)

WENO reconstruction basis (set via [physics] INI section, key weno_rec_var):

ValueEigenvectors usedDescription
CONSERVATIVEIdentity (IERL)Reconstruct conservative variables directly
CHARACTERISTICSER / ELProject to characteristics before reconstruction

Module-level procedures ​

ProcedureDescription
compute_auxiliary(cv, Rf, g, conservative, auxiliary)Conservative → auxiliary for a single cell
compute_conservative(auxiliary, conservative)Auxiliary → conservative for a single cell
compute_fluxes_conservative(sir, auxiliary, fluxes)Euler flux vector in direction sir

adam_chase_bc_object ​

Reads and stores boundary conditions for all 6 domain faces from INI sections [bc_x_min], [bc_x_max], [bc_y_min], [bc_y_max], [bc_z_min], [bc_z_max].

ConstantValueINI keywordDescription
BC_EXTRAPOLATION1extrapolationZero-order extrapolation into ghost cells
BC_INFLOW2inflowSupersonic inflow — prescribed (ρ,u,v,w,p)
BC_WALL_INVISCID3wall-inviscidSlip wall (reflective)

Inflow state is read from INI options r, u, v, w, p (and s for a perturbation seed) under the relevant face section.


adam_chase_ic_object ​

Sets initial conditions at simulation start and after AMR grid adaptation.

IC typeINI keywordDescription
UniformuniformConstant state with optional random velocity perturbation scaled by q(6)
Isentropic vortexisentropic-vortexAnalytical isentropic vortex centred at (emin_x, emin_y), radius from q(6)
Riemann problemriemann-problemPiecewise constant regions defined by bounding boxes [emin, emax]

INI section: [initial_conditions]. Multi-region state per box in [initial_conditions_region_N] (options r, u, v, w, p, s, emin_x/y/z, emax_x/y/z).


adam_chase_time_object ​

INI option ([time])DefaultDescription
it_max−1Maximum time steps (−1 = time-based termination)
time_max1.0Maximum simulation time
CFL0.3CFL stability coefficient

adam_chase_riemann_library ​

Riemann solver library providing LLF and HLL solvers and Maxwell flux functions.

ProcedureDescription
compute_riemann_maxwell_llf(sir, nv, q1, q4, f, lmax)LLF (Rusanov) solver; wave speed c0=1/μ0ε0
compute_riemann_maxwell_hll(sir, nv, q1, q4, f, lmax, lmin)HLL solver
compute_convective_fluxes_maxwell(sir, q, f)Maxwell flux vector
compute_convective_fluxes_maxwell_div_d(sir, q, f)Maxwell flux with ∇⋅D correction
compute_convective_fluxes_maxwell_div_d_b(sir, q, f)Maxwell flux with ∇⋅D and ∇⋅B corrections

CPU backend — chase_cpu_object ​

Extends chase_common_object with working arrays and the full suite of compute methods.

Inheritance ​

chase_common_object          (common/)
    └── chase_cpu_object     (cpu/)   ← backend object

Additional data members ​

MemberShapeDescription
dq(nv, 1-ngc:ni+ngc, …, nb)Residual (right-hand side)
flx(nv, 1-ngc:ni+ngc, …, nb)Convective face fluxes in x
fly(nv, 1-ngc:ni+ngc, …, nb)Convective face fluxes in y
flz(nv, 1-ngc:ni+ngc, …, nb)Convective face fluxes in z

Methods ​

Lifecycle

ProcedurePurpose
initialize(filename)Calls initialize_common; then allocate_cpu for working arrays
allocate_cpu()Allocates dq, flx, fly, flz; zero-initialises
simulate(filename)Full simulation driver: init → IC/restart → time loop → finalise

AMR

ProcedurePurpose
amr_update()Iterates AMR markers; calls adam%amr_update; recomputes IB phi after each pass
mark_by_geo(delta_fine, delta_coarse)Marks blocks by proximity to IB surface (phi sign change)
mark_by_grad_var(grad_tol, delta_type, …)Marks blocks by max gradient of a field variable
refine_uniform(levels)Uniformly refines all blocks
compute_phi()Recomputes signed-distance IB field after grid changes
move_phi(velocity, s)Translates IB solid s by velocity and updates phi

Immersed boundary

ProcedurePurpose
integrate_eikonal(q)Runs n_eikonal Godunov sweeps; applies invert_eikonal

I/O

ProcedurePurpose
save_xh5f([output_basename])Writes q (r,ru,rv,rw,rE) and q_aux to XH5F with Morton cell ordering
save_restart_files()Saves ADAM binary restart + an XH5F snapshot
load_restart_files(t, time)Reads restart binary; rebuilds MPI communication maps
save_residuals()Computes per-variable L2 norm of dq via MPI_ALLREDUCE(SUM)
save_simulation_data()Schedules output: XH5F snapshots, restart checkpoints, slice sampling

Slice data is written in .mat format with variable names rho rhu rhv rhw rhe.

Initial and boundary conditions

ProcedurePurpose
set_initial_conditions()Delegates to ic%set_initial_conditions
set_boundary_conditions(q)Iterates local_map_bc_crown; applies extrapolation or inflow BCs
update_ghost(q [,step])Local inter-block copy → MPI exchange → BC application

Numerical methods

ProcedurePurpose
compute_dt()CFL stability criterion (see below)
compute_q_auxiliary(q, q_aux)Full-field conservative → auxiliary conversion
compute_residuals(q, q_aux, dq)Ghost sync → eikonal → aux vars → fluxes → divergence
integrate()Runge-Kutta time advance; same scheme dispatch as NASTO CPU
simulate(filename)Full time loop driver

Time-step control ​

compute_dt uses a convective-only CFL bound (no viscous Fourier term):

Δt=CFL⋅[maxb,i,j,k(|u|+aΔx/2+|v|+aΔy/2+|w|+aΔz/2)]−1

A global minimum is then taken via MPI_ALLREDUCE(MPI_MIN).

Residual computation pipeline ​

1. update_ghost(q)                   ! sync ghost cells + apply BC
2. integrate_eikonal(q)              ! update IB distance field
3. compute_q_auxiliary(q, q_aux)     ! q → primitive/auxiliary vars
4. compute_fluxes_convective(x,y,z)  ! WENO + LLF Euler fluxes per direction
5. compute_fluxes_difference(…)      ! flux divergence → dq; IB masking

adam_chase_common_library ​

Barrel re-export module. A single use adam_chase_common_library brings all common modules into scope:

fortran
use adam_chase_bc_object
use adam_chase_common_object
use adam_chase_ic_object
use adam_chase_io_object
use adam_chase_parameters
use adam_chase_physics_object
use adam_chase_time_object

Build ​

bash
# GNU compiler (production)
FoBiS.py build -mode chase-gnu

# GNU compiler (debug)
FoBiS.py build -mode chase-gnu-debug

The executable adam_chase_cpu is placed in exe/.

Running ​

bash
# Single rank, default INI filename (input.ini)
mpirun -np 1 exe/adam_chase_cpu

# Multiple ranks, custom INI
mpirun -np 8 exe/adam_chase_cpu my_case.ini

An example INI file is provided at src/app/chase/cpu/adam_nasto.ini.


Copyrights ​

CHASE is part of the ADAM framework, released under the GNU Lesser General Public License v3.0 (LGPLv3).

Copyright (C) Andrea Di Mascio, Federico Negro, Giacomo Rossi, Francesco Salvadore, Stefano Zaghi.