Example setup for incompressible flow that uses a finite volume solver
feFlow/incompressibleFlow.yaml
---
test:
# a unique test name for this integration tests
name: incompressibleFlow
# create a default assert that compares the log file
assert: "inputs/feFlow/incompressibleFlow.txt"
# metadata for the simulation
environment:
title: incompessibleFlow
tagDirectory: false
arguments:
dm_plex_separate_marker: ""
# set up the time stepper responsible for marching in time
timestepper:
name: theMainTimeStepper
# set the arguments for the time stepper, this includes the time stepping solution technique for the finite element solver
arguments:
ts_dt: .1
ts_max_steps: 30
ksp_type: fgmres
ksp_gmres_restart: 10
ksp_rtol: 1.0e-9
ksp_atol: 1.0e-14
ksp_error_if_not_converged: ""
pc_type: fieldsplit
pc_fieldsplit_0_fields: 0,2
pc_fieldsplit_1_fields: 1
pc_fieldsplit_type: schur
pc_fieldsplit_schur_factorization_type: "full"
fieldsplit_0_pc_type: lu
fieldsplit_pressure_ksp_rtol: 1E-10
fieldsplit_pressure_pc_type: jacobi
# define a simple box mesh
domain: !ablate::domain::BoxMesh
name: simpleBoxField
faces: [ 2, 2 ]
lower: [ 0, 0 ]
upper: [ 1, 1 ]
# 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: 2
# all fields must be defined before solvers.
fields:
# define the velocity field with two components using the FE solver
- !ablate::domain::FieldDescription
name: velocity
prefix: velocity
components: ["vel0", "vel1"]
type: FE
options:
petscspace_degree: 2
# define the pressure field using the FE solver
- !ablate::domain::FieldDescription
name: pressure
prefix: pressure
type: FE
options:
petscspace_degree: 1
# define the temperature field using the FE solver
- !ablate::domain::FieldDescription
name: temperature
prefix: temperature
type: FE
options:
petscspace_degree: 2
# set the initial conditions of the flow field. Tag each field function so that they can be reused for the exact solution
initialization:
- &velocityField
fieldName: "velocity"
field: "t + x^2 + y^2, t + 2*x^2 - 2*x*y"
timeDerivative: "1.0, 1.0"
- &pressureField
fieldName: "pressure"
field: "x + y - 1"
timeDerivative: "0.0"
- &temperatureField
fieldName: "temperature"
field: "t + x + y"
timeDerivative: "1.0"
# set the exact solutions based upon the initial conditions
exactSolution:
- *velocityField
- *pressureField
- *temperatureField
# this problem uses a single solver (!ablate::finiteElement::IncompressibleFlowSolver)
solver: !ablate::finiteElement::IncompressibleFlowSolver
id: theFlowField
options: {}
# the fe solver assumed constant flow values
parameters:
strouhal: 1.0
reynolds: 1.0
peclet: 1.0
mu: 1.0
k: 1.0
cp: 1.0
# set constant boundary conditions for velocity and temperature based uon the initial condition fields
boundaryConditions:
- !ablate::finiteElement::boundaryConditions::Essential
boundaryName: "wall velocity"
labelIds: [3, 1, 2, 4] # this is all walls
boundaryValue: *velocityField
- !ablate::finiteElement::boundaryConditions::Essential
boundaryName: "wall temp"
labelIds: [3, 1, 2, 4]
boundaryValue: *temperatureField
monitors:
# compute output the error to standard out
- !ablate::monitors::FieldErrorMonitor
# compute output the error to a log file
- !ablate::monitors::FieldErrorMonitor
log: !ablate::monitors::logs::FileLog
name: errorMonitor.log