This problem tests the writing of a hdf5 file for initialization for compressible flow.

compressibleFlow/hdf5InitializerTest.yaml

---
test: !IntegrationRestartTest
  # specify the basic test parameters for restart test
  testParameters:
    # a unique test name for this integration tests
    name: compressibleFlowPgsLodiRestart
    asserts:
      - "inputs/compressibleFlow/hdf5InitializerTest/hdf5InitializerTest.txt"
  # upon restart, use a separate input file
  restartInputFile: "inputs/compressibleFlow/hdf5InitializerTest/hdf5InitializerTest.Initialization.yaml"

# metadata for the simulation
environment:
  title: _hdf5InitializationCompressibleFlow
  tagDirectory: false
arguments:
  # ask petsc to label the boundary values
  dm_plex_separate_marker: ""
# set up the time stepper responsible for marching in time
timestepper:
  arguments:
    ts_type: rk
    ts_max_time: 100000
    ts_max_steps: 50
    ts_dt: 1.0E-10
    ts_adapt_safety: 0.9
  # io controls how often the results are saved to a file for visualization and restart
  io: !ablate::io::Hdf5MultiFileSerializer
    interval: 0 # results are saved at every 0 steps.  In real simulations this should be much larger.

  # Create a simple box mesh to start
  domain: !ablate::domain::BoxMesh
    name: simpleBoxField
    faces: [ 50, 10 ]
    lower: [ 0.0, 0.0 ]
    upper: [ .5, .1 ]
    simplex: false
    # pass in these options to petsc when setting up the domain.  Using an option list here prevents command line arguments from being seen.
    options:
      dm_distribute: true # turn off default dm_distribute so that we can extrude label first
      dm_distribute_overlap: 0
    modifiers:
      # extrude all boundaries
      - !ablate::domain::modifiers::ExtrudeLabel
        # use the labels defined by the dm_plex_separate_marker option
        regions:
          - name: marker
            value: 1 # this is the bottom boundary value
          - name: marker
            value: 2 # this is the right boundary value
          - name: marker
            value: 3 # this is the top boundary value
          - name: marker
            value: 4 # this is the left boundary value
        # define a region for the new interface between the originalRegion and extrudedRegion
        boundaryRegion:
          name: boundaryFaces
        # for all cells/faces/points that were in the original mesh before extrusion
        originalRegion:
          name: interiorCells
        # for all cells/faces/points that were extruded.  This does include overlap faces that are in the boundaryRegion, originalRegion, and extrudedRegion regions
        extrudedRegion:
          name: boundaryCells
      # if using mpi, this modifier distributes cells
      - !ablate::domain::modifiers::DistributeWithGhostCells
        ghostCellDepth: 2
    fields:
      # all fields must be defined before solvers.  The ablate::finiteVolume::CompressibleFlowFields is a helper
      # class that creates the required fields for the compressible flow solver (rho, rhoE, rhoU, ...)
      - !ablate::finiteVolume::CompressibleFlowFields
        eos: !ablate::eos::PerfectGas &eos
          parameters:
            gamma: 1.4
            Rgas: 287.0
          # species are added to the flow through the eos.  This allows testing of the species transport equations
          species: [ N2, H2O, O2 ]
      # by adding a pressure field the code will compute and output pressure
      - name: pressure
        location: AUX
        type: FVM
  # set the initial conditions of the flow field
  initialization:
    # The ablate::finiteVolume::CompressibleFlowFields is a helper
    # class that creates the required fields for the compressible flow solver (rho, rhoE, rhoU, ...)
    - !ablate::finiteVolume::fieldFunctions::Euler
      state:
        &flowFieldState
        eos: *eos
        pressure: 101325.0
        temperature: 300
        velocity: "0.0, 0.0"
        # individual mass fractions must be passed to the flow field state to compute density, energy, etc.
        other: !ablate::finiteVolume::fieldFunctions::MassFractions
          &massFractions
          eos: *eos
          values:
            - fieldName: N2
              field: "x > .01 ? .2 : 1.0"
            - fieldName: H2O
              field: " x> .01 ? .3 :0"
            - fieldName: O2
              field: " x > .01 ? .5 : 0"
    # the same state can be used to internalize the DensityMassFractions field from density and mass fractions
    - !ablate::finiteVolume::fieldFunctions::DensityMassFractions
      state: *flowFieldState
solvers:
  # The compressible flow solver will solve the compressible flow equations over the interiorCells
  - !ablate::finiteVolume::CompressibleFlowSolver
    id: vortexFlowField
    # only apply this solver to the flowRegion, area without faces
    region:
      name: interiorCells

    # a flux calculator must be specified to so solver for advection
    fluxCalculator: !ablate::finiteVolume::fluxCalculator::AusmpUp

    # cfl is used to compute the physics time step
    parameters:
      cfl: 0.5

    # the default transport object assumes constant values for k, mu, diff
    transport:
      &transportModel
      k: .2
      mu: .1
      diff: 1E-4

    # share the existing eos with the compressible flow solver
    eos: *eos

  # use a boundary solver to update the cells in the boundaryCellsLeft region to represent an inlet
  - !ablate::boundarySolver::BoundarySolver
    id: inlet
    region:
      name: marker
      value: 4
    fieldBoundary:
      name: boundaryFaces
    mergeFaces: false
    processes:
      - !ablate::boundarySolver::lodi::Inlet
        eos: *eos
        velocity: "min(100, 100000*t), 0" # for stability, increase the velocity slowly

  # use a boundary solver to update the cells in the boundaryCellsRight region to represent an open pipe
  - !ablate::boundarySolver::BoundarySolver
    id: openBoundary
    region:
      name: marker
      value: 2
    fieldBoundary:
      name: boundaryFaces
    mergeFaces: true
    processes:
      - !ablate::boundarySolver::lodi::OpenBoundary
        eos: *eos
        reflectFactor: 0.0
        referencePressure: 101325.0
        maxAcousticsLength: 1

  # use a boundary solver to update the cells in the boundaryCellsTop region to represent standard wall
  - !ablate::boundarySolver::BoundarySolver
    id: topBoundary
    region:
      name: marker
      value: 3
    fieldBoundary:
      name: boundaryFaces
    mergeFaces: true
    processes:
      - !ablate::boundarySolver::lodi::IsothermalWall
        eos: *eos

  # use a boundary solver to update the cells in the boundaryCellsTop region to represent standard wall
  - !ablate::boundarySolver::BoundarySolver
    id: topBoundary
    region:
      name: marker
      value: 1
    fieldBoundary:
      name: boundaryFaces
    mergeFaces: true
    processes:
      - !ablate::boundarySolver::lodi::IsothermalWall
        eos: *eos