Simple test for pushing source terms to the cell mesh. Notice that the time step lag results in a final result that is off by a dt
particles/coupledParticles2DRestart.yaml
---
test: !IntegrationRestartTest
# specify the basic test parameters for restart test
testParameters:
# a unique test name for this integration tests
name: coupledParticles2DRestart
# create a default assert that compares the log file
assert: "inputs/particles/coupledParticles2DRestart.txt"
# # upon restart, override some of the input parameters
restartOverrides:
timestepper::arguments::ts_max_steps: "20"
# metadata for the simulation
environment:
title: _2DInertialParticlesRestartInCompressibleFlow
tagDirectory: false
arguments: { }
# set up the time stepper responsible for marching in time
timestepper:
name: theMainTimeStepper
# io controls how often the results are saved to a file for visualization and restart
io: # by default the ablate::io::Hdf5Serializer serializer is used
interval: 5
# time stepper specific input arguments. By default, the time stepper will use TSADAPTBASIC
arguments:
ts_type: euler
ts_max_steps: 12
ts_adapt_safety: 1.0
ts_adapt_dt_max: .1
# sets a single box domain with periodic boundary conditions
domain: !ablate::domain::BoxMesh
name: simpleBoxField
faces: [ 5, 5 ]
lower: [ 0, 0 ]
upper: [ 1, 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_refine: 0
modifiers:
# if using mpi, this modifier distributes cells
- !ablate::domain::modifiers::DistributeWithGhostCells
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
# specify the extra pressure field for testing coupling
- !ablate::domain::FieldDescription
name: alpha
type: FV
location: sol
# set the initial conditions of the flow field
initialization:
- !ablate::finiteVolume::fieldFunctions::Euler
state: &flowFieldState
eos: *eos
pressure: 101325.0
temperature: 300.0
velocity: "0.0, 0.0"
# set the alpha field to zero
- fieldName: "alpha"
field: 0.0
solvers:
# the CompressibleFlowSolver is used to just to update the velocity and Yi field, it does not do anything else
- !ablate::finiteVolume::CompressibleFlowSolver
id: flowField
# output the increasing alpha values
monitors:
- !ablate::monitors::MaxMinAverage
field: alpha
# share the existing eos with the compressible flow solver
eos: *eos
# use a particle solver with an inertial process
- !ablate::particles::CoupledParticleSolver
id: flowParticles
# Petsc options used for the timestepper
options:
ts_dt: 0.005
# create a single particle per cell
initializer: !ablate::particles::initializers::CellInitializer
particlesPerCellPerDim: 1
# only couple the alpha field
coupledFields:
- alpha
# all fields except the coordinate must be specified
fields:
- name: ParticleVelocity
location: SOL # Solution means that it is part of the time stepping in the particle solver
components: [ u, v ]
- name: ParticleDiameter
location: AUX
- name: ParticleDensity
location: AUX
# processes used to add source terms for the particle solver
processes:
# add an arbitrary source in alpha
- !ablate::particles::processes::ArbitraryEulerianSource
coupledField: alpha
sourceFunction: "1.0"
# Initialize the specified particle fields
fieldInitialization:
- fieldName: ParticleDiameter
field: 0.01
- fieldName: ParticleDensity
field: 90.0
- fieldName: ParticleVelocity
field: "0.0, 0.0"
# Monitor particle statistics
monitors:
- !ablate::monitors::TimeStepMonitor