HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
The following input files are required to run HyPar. They are indicated as being mandatory or optional. If optional, then default values are used if not found.
Note: It is best to start with the provided examples, understand their input files based on the information on this page, and then modify them to run other cases.
Requirement: mandatory
Read by: ReadInputs()
Description: Specify the main simulation-related parameters.
Format: ASCII text
begin <keyword> <value> <keyword> <value> <keyword> <value> ... <keyword> <value> end
where the list of keywords and their type are:
Keyword name | Type | Variable | Default value -------— |
---|---|---|---|
ndims | int | HyPar::ndims | 1 |
nvars | int | HyPar::nvars | 1 |
size | int[ndims] | HyPar::dim_global | must be specified |
iproc | int[ndims] | MPIVariables::iproc | must be specified |
ghost | int | HyPar::ghosts | 1 |
n_iter | int | HyPar::n_iter | 0 |
restart_iter | int | HyPar::restart_iter | 0 |
time_scheme | char[] | HyPar::time_scheme | euler |
time_scheme_type | char[] | HyPar::time_scheme_type | none |
hyp_space_scheme | char[] | HyPar::spatial_scheme_hyp | 1 |
hyp_flux_split | char[] | HyPar::SplitHyperbolicFlux | no |
hyp_interp_type | char[] | HyPar::interp_type | characteristic |
par_space_type | char[] | HyPar::spatial_type_par | nonconservative-1stage |
par_space_scheme | char[] | HyPar::spatial_scheme_par | 2 |
dt | double | HyPar::dt | 0.0 |
conservation_check | char[] | HyPar::ConservationCheck | no |
screen_op_iter | int | HyPar::screen_op_iter | 1 |
file_op_iter | int | HyPar::file_op_iter | 1000 |
op_file_format | char[] | HyPar::op_file_format | text |
ip_file_type | char[] | HyPar::ip_file_type | ascii |
input_mode | char[] | HyPar::input_mode | serial |
output_mode | char[] | HyPar::output_mode | serial |
op_overwrite | char[] | HyPar::op_overwrite | no |
model | char[] | HyPar::model | must be specified |
immersed_body | char[] | HyPar::ib_filename | "none" |
size_exact | int[ndims] | HyPar::dim_global_ex | HyPar::dim_global |
use_gpu | char[] | HyPar::use_gpu | no |
gpu_device_no | int | HyPar::gpu_device_no | -1 |
Notes:
if "input_mode" or "output_mode" are set to "parallel" or "mpi-io", the number of I/O ranks must be specified right after as an integer. For example:
begin ... input_mode parallel 4 ... end
This means that 4 MPI ranks will participate in file I/O (assuming total MPI ranks is more than 4) (see ReadArrayParallel(), WriteArrayParallel(), ReadArrayMPI_IO() ).
Requirement: mandatory
Read by: InitializeBoundaries()
Description: Specify boundary conditions.
Format: ASCII text
nb boundary_type spatial_dimension face [extent] boundary_type spatial_dimension face [extent] ... boundary_type spatial_dimension face [extent]
where
u[0] u[1] ... u[#HyPar::nvars-1]
u[0] u[1] ... u[#HyPar::ndims-1]
rho u[0] u[1] ... u[#HyPar::ndims-1]
p
_SUPERSONIC_INFLOW_: the next line must specify the inflow density, velocity, and pressure (assumed to be constant in space and time). Each component of the velocity must be specified (i.e. HyPar::ndims+2 real numbers)
rho u[0] u[1] ... u[#HyPar::ndims-1] p
Note that this boundary can also be implemented through the _DIRICHLET_; however, the flow variables must be converted to the conserved variable form to specify the Dirichlet boundary value:
rho rho*u[0] rho*u[1] ... rho*u[#HyPar::ndims-1] E (internal energy)
rho u[0] u[1] ... u[#HyPar::ndims-1] p filename
Requirement: mandatory
Read by: InitialSolution(), through ReadArray()
Format: Depends on HyPar::input_mode and HyPar::ip_file_type, specified in solver.inp. See ReadArraySerial(), ReadArrayParallel(), and ReadArrayMPI_IO() to understand the format and data layout of this file.
Description: This file contains the initial solution. It will probably not be created by hand. See the examples provided for codes that generate this file for various problems. The final part in these codes, where the initial solution is written to file, can be reused to generate this file for a new case.
Requirement: optional
Read by: tridiagLUInit()
Description: Specify parameters related to LU solvers for tridiagonal systems of equations. This file is relevant only if some method requiring the solution of a tridiagonal system of equations is being used (for example: Interp1PrimFifthOrderCRWENO() ).
Format: ASCII text
begin <keyword> <value> <keyword> <value> <keyword> <value> ... <keyword> <value> end
where the list of keywords are:
Keyword name | Type | Variable | Default value -------— |
---|---|---|---|
evaluate_norm | int | TridiagLU::evaluate_norm | 1 |
maxiter | int | TridiagLU::maxiter | 10 |
atol | double | TridiagLU::atol | 1e-12 |
rtol | double | TridiagLU::rtol | 1e-10 |
verbose | int | TridiagLU::verbose | 0 |
reducedsolvetype | char[] | TridiagLU::reducedsolvetype | _TRIDIAG_JACOBI_ |
Requirement: optional
Read by: WENOInitialize()
Description: Specify parameters related to WENO-type spatial discretization. This file is relevant only if a WENO-type method is being used for spatial discretization (for example: Interp1PrimFifthOrderCRWENO(), Interp1PrimFifthOrderWENO(), Interp1PrimFifthOrderHCWENO() ). For most cases, this file is useful if a very specific study on the behavior of the WENO-type method is being carried out; typically, the default values are enough to ensure "good" solutions.
Format: ASCII text
begin <keyword> <value> <keyword> <value> ... <keyword> <value> end
where the list of keywords are:
Keyword name | Type | Variable | Default value -------— |
---|---|---|---|
mapped | int | WENOParameters::mapped | 0 |
borges | int | WENOParameters::borges | 0 |
yc | int | WENOParameters::yc | 0 |
no_limiting | int | WENOParameters::no_limiting | 0 |
epsilon | double | WENOParameters::eps | 1e-6 |
rc | double | WENOParameters::rc | 0.3 |
xi | double | WENOParameters::xi | 0.001 |
tol | double | WENOParameters::tol | 1e-16 |
Requirement: mandatory/optional (depends on the physical model)
Read by: The initialization function of the various physics modules (eg. Euler1DInitialize(), NavierStokes2DInitialize(), etc)
Description: This file contains inputs specific to a physics model. Depending on the physical model being used, it may or may not be mandatory. The exact parameters to specify depend on the physics.
Format: ASCII text
begin <keyword> <value> <keyword> <value> ... <keyword> <value> end
See the documentation for the initialization function of the various phyical models for a list of keywords (for example, Euler1DInitialize(), NavierStokes2DInitialize()).
Requirement: mandatory if using PETSc time integration; if absent, HyPar will use native time integration. If compiled without PETSc, this file is not required.
Read by: PETSc
Description: This file contains the input flags required by PETSc time integration and its associated features.
Format: ASCII text
Note: The contents of this file may also be specified as command line flags.
This file contains all the inputs required for the PETSc time integrators. See PETSc documentation (https://petsc.org/release/docs/) for all the inputs that PETSc needs, or see the PETSc examples for the inputs relevant to HyPar. In addition, following are the HyPar-specific inputs (they are all optional, if not specified, default values are used):
In addition, if an IMEX time integrator (TSARKIMEX - https://petsc.org/release/docs/manualpages/TS/TSARKIMEX.html) is being used, the following terms specify how the hyperbolic, parabolic, and source terms are integrated in time (explicitly or implicitly):
Requirement: mandatory if using immersed boundaries (the keyword immersed_body is specified in solver.inp); if absent, HyPar will not use immersed boundaries.
Read by: IBReadBodySTL(), called by the initialization function for immersed boundaries InitializeImmersedBoundaries().
File name: The name of this file must be the same as the value of the keyword immersed_body in solver.inp.
Format: ASCII STL (https://en.wikipedia.org/wiki/STL_%28file_format%29)
Notes:
Requirement: mandatory if running an ensemble/multidomain simulation
Read by: EnsembleSimulation::define()
Description: Specify the parameters related to ensemble simulations.
Format: ASCII text
begin <keyword> <value> <keyword> <value> <keyword> <value> ... <keyword> <value> end
where the list of keywords and their type are:
Keyword name | Type | Variable | Default value -------— |
---|---|---|---|
nsims | int | EnsembleSimulation::m_nsims | 1 |
Notes:
Requirement: mandatory if running with the sparse grids method
Read by: SparseGridsSimulation::define()
Description: Specify the parameters related to sparse grids method.
Format: ASCII text
begin <keyword> <value> <keyword> <value> <keyword> <value> ... <keyword> <value> end
where the list of keywords and their type are:
Keyword name | Type | Variable | Default value -------— |
---|---|---|---|
log2_imin | int | SparseGridsSimulation::m_imin | 2 |
interp_order | int | SparseGridsSimulation::m_interp_order | 6 |
write_sg_solution | char[] | SparseGridsSimulation::m_write_sg_solutions | no |
write_sg_errors | char[] | SparseGridsSimulation::m_print_sg_errors | no |
Notes:
Even if you want to use the default values for all the parameters, the file sparse_grids.inp must exist with just the text
begin end
If this file does not exist, HyPar will not use the sparse grids method.
Requirement: mandatory if one wants to use the libROM (https://www.librom.net/) interface. This file is read only if HyPar is compiled with the libROM interface (see compilation instructions).
Read by: libROMInterface::define(), DMDROMObject::DMDROMObject()
Description: Specify the parameters related to reduced-order modeling using libROM.
Format: ASCII text
begin <keyword> <value> <keyword> <value> <keyword> <value> ... <keyword> <value> end
where the list of keywords and their type are:
Keyword name | Type | Variable | Default value -------— |
---|---|---|---|
rdim | int | libROMInterface::m_rdim | -1 |
sampling_frequency | int | libROMInterface::m_sampling_freq | 1 |
mode | string | libROMInterface::m_mode | "train" |
component_mode | string | libROMInterface::m_comp_mode | "monolithic" |
type | string | libROMInterface::m_rom_type | "DMD" |
save_to_file | string | libROMInterface::m_save_ROM | "true" |
dmd_num_win_samples | int | DMDROMObject::m_num_window_samples | INT_MAX |
dmd_dirname | string | DMDROMObject::m_dirname | "DMD" |
dmd_write_snapshot_mat | bool | DMDROMObject::m_write_snapshot_mat | false |
Notes:
Even if you want to use the default values for all the parameters, the file librom.inp must exist with just the text
begin end
If this file does not exist, HyPar will not use the libROM interface.