Inputs
BC
This is the mechanism for impositing boundary conditions on Set::Field
objects of
scalar type.
Typical convention is for [prefix]
to be given by the field name. For instance,
bc.temp.type.xhi = dirichlet dirichlet dirichlet
bc.temp.val.xhi = 0.0 1.0 0.0
corresponds to the boundary condition for temperature. See the specific integrator for details.
BC::Constant
src/BC/Constant.cpp src/BC/Constant.H
This is the most commonly used standard boundary condition implementation. The name “Constant” refers to the invariance of the BC value or character along each face of the simulation domain; however, you may cause a change in the value with time by using a Numeric::Interpolator::Linear string.
The BC on each face is specified with a type
string that specifies the nature of
the BC, and a val
that specifies the value.
By default, all types are Dirichlet and all values are 0.0.
The complete list of BC types are below:
Dirichlet boundary condition
types can be specified with Dirichlet
, dirichlet
, EXT_DIR
.
Neumann boundary condition
types are specified with Neumann
, neumann
.
Periodic boundary conditions
can be specified with Periodic
, periodic
, INT_DIR
.
Important: Ensure that your geometry is specified to be periodic using geometry.is_periodic
.
For instance, if periodic in x, set to 1 0 0
The BC values can be specified either as a number (e.g. 1.0
) or using a linear interpolator
string (e.g. (0,1:2.3,-0.1)
).
The number of values and types must be either 0 (for defaults), 1 (to set the same for all field components) or N (where N=number of field components).
Parameter |
Type |
Values |
---|---|---|
BC type on the lower x edge (2d) face (3d) |
||
BC type on the upper x edge (2d) face (3d) |
||
BC type on the lower y edge (2d) face (3d) |
||
BC type on the upper y edge (2d) face (3d) |
||
BC type on the lower z face (processed but ignored in 2d to prevent unused input errors) |
||
BC type on the upper z face (processed but ignored in 2d to prevent unused input errors) |
||
BC value on the lower x edge (2d) face (3d) |
||
BC value on the upper x edge (2d) face (3d) |
||
BC value on the lower y edge (2d) face (3d) |
||
BC value on the upper y edge (2d) face (3d) |
||
BC value on the lower z face (processed but ignored in 2d to prevent unused input errors) |
||
BC value on the upper z face (processed but ignored in 2d to prevent unused input errors) |
BC::Expression
src/BC/Expression.cpp src/BC/Expression.H
Parameter |
Type |
Values |
---|---|---|
BC type on the lower x edge (2d) face (3d) |
||
BC type on the upper x edge (2d) face (3d) |
||
BC type on the lower y edge (2d) face (3d) |
||
BC type on the upper y edge (2d) face (3d) |
||
BC type on the lower z face (processed but ignored in 2d to prevent unused input errors) |
||
BC type on the upper z face (processed but ignored in 2d to prevent unused input errors) |
BC::Operator
The BC::Operator
family of BC classes are designed to work with implicit
operators.
They are not the same thing as other BC types and cannot be used in that same
way.
(This is not an ideal taxonomy for BC structures - we may transition other BC types
to be subspaces of BC::Integrator.)
BC::Operator::Elastic
src/BC/Operator/Elastic/Elastic.H
Class of BC operators that work with Operator::Elastic.
BC::Operator::Elastic::Constant
src/BC/Operator/Elastic/Constant.H
This BC defines boundary conditions that are constant with respect to space. However they may change in time using the Numeric::Interpolator::Linear method.
In 2D, BCs are prescribed for each edge (4) and corner (4) on the boundary, for a total of 8 possible regions. In 3D, BCs are prescribed for each face (6), each edge (12), and each corner (8), for a total of 26 possible regions. Care must be taken to define BCs for edges/corners consistently with the faces/edges, or you will get poor convergence and inaccurate behavior. (See BC::Operator::Elastic::TensionTest for a reduced BC with streamlined load options.)
To define a boundary condition, you must define both a “type” and a “value” in each direction. The type can be “displacement”, “disp”, “neumann”, “traction”, “trac”. The value is the corresponding value. All BCs are, by default, dirichlet (displacement) with a value of zero.
Parameter |
Type |
Values |
---|---|---|
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge / 2D Corner |
||
3D Edge / 2D Corner |
||
3D Edge / 2D Corner |
||
3D Edge / 2D Corner |
||
3D Face / 2D Edge |
||
3D Face / 2D Edge |
||
3D Face / 2D Edge |
||
3D Face / 2D Edge |
||
3D Face |
||
3D Face |
||
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Corner |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge |
||
3D Edge / 2D Corner |
||
3D Edge / 2D Corner |
||
3D Edge / 2D Corner |
||
3D Edge / 2D Corner |
||
3D Face / 2D Edge |
||
3D Face / 2D Edge |
||
3D Face / 2D Edge |
||
3D Face / 2D Edge |
||
3D Face |
||
3D Face |
BC::Operator::Elastic::TensionTest
src/BC/Operator/Elastic/TensionTest.H
Parameter |
Type |
Values |
---|---|---|
Tension test type. (Only option right now is |
||
Applied displacement (can be interpolator) |
||
Applied traction (can be interpolator) |
IC
Initial condition (IC) objects are used to set fields to specified values, through mathematical expressions, images, etc. They are often used as initial conditions, but may be used generally to incorporate static or time-dependent values. All IC methods inherit from the base IC class, and are implemented by overriding the “Add” method. (Initialize uses Add after setting the field to zero.)
IC::BMP
Initialize a field using a bitmap image. (2D only)
Note that in GIMP, you must select “do not write color space information” and “24 bit R8 G8 B8” when exporting the BMP file.
Parameter |
Type |
Values |
---|---|---|
BMP filename. |
file path |
|
How to position image in space |
stretch fitheight fitwidth coord |
|
Location of lower-left corner in the domain |
||
Location of upper-right corner in the domain |
||
Color channel to use |
r g b R G B |
|
Scaling value - minimum |
0.0 |
|
Scaling value - maximum |
255.0 |
IC::Cuboid
Parameter |
Type |
Values |
---|---|---|
Coordinates (X Y Z) of the center of the square/cube. |
||
Side legnth of cuboid |
||
Regularization value |
IC::Constant
Basic IC that just sets the entire field to a constant value. Works with a single or multiple-component field.
Parameter |
Type |
Values |
---|---|---|
Array of constant values. The number of values should equal either 1 or N where N is the number of fab components |
required |
IC::Ellipse
If number_of_inclusions
is specified, then multiple ellipses are specified.
In this case, each parameter must have number_of_inclusion*M values, where M is the
number of values specified for the single ellipse case.
Parameter |
Type |
Values |
---|---|---|
Coorinates of ellipse center |
||
Diffuse boundary thickness |
0.0 |
|
DxD square matrix defining an ellipse. |
||
If |
||
Number of ellipses |
||
center of the ellipse |
||
center of the ellipse |
||
either a vector containing ellipse radii, or a matrix defining the ellipse |
||
Same |
||
Array of radii [depricated] |
||
Regularization for smooth boundary |
||
Flip the inside and the outside |
IC::Expression
Initialize a field using a mathematical expression. Expressions are imported as strings and are compiled real-time using the AMReX Parser.
Works for single or multiple-component fields.
Use the regionN
(N=0,1,2, etc. up to number of components) to pass expression.
For example:
ic.region0 = "sin(x*y*z)"
ic.region1 = "3.0*(x > 0.5 and y > 0.5)"
for a two-component field. It is up to you to make sure your expressions are parsed correctly; otherwise you will get undefined behavior.
Constants
You can add constants to your expressions using the constant
directive.
For instance, in the following code
psi.ic.type=expression
psi.ic.expression.constant.eps = 0.05
psi.ic.expression.constant.R = 0.25
psi.ic.expression.region0 = "0.5 + 0.5*tanh((x^2 + y^2 - R)/eps)"
the constants eps
and R
are defined by the user and then used
in the subsequent expression.
The variables can have any name made up of characters that is not reserved.
However, if multiple ICs are used, they must be defined each time for each IC.
Parameter |
Type |
Values |
---|---|---|
coordinate system to use: “cartesian” (for x,y,z,t) and “polar” (for r, theta, z, t) |
||
IC::Laminate
Create a single laminate with specified orientation, thickness, and offset.
Parameter |
Type |
Values |
---|---|---|
How many laminates (MUST be greater than or equal to 1). |
1 |
|
Vector normal to the interface of the laminate |
||
Diffuse thickness |
||
Type of mollifer to use (options: dirac, [gaussian]) |
||
Switch to mode where only one component is used. |
||
Take the complement of the laminate |
IC::PS
Fill a domain with randomly packed and sized spheres.
Warning
This is not used for anything useful as far as we can see. It will likely be removed shortly.
Parameter |
Type |
Values |
---|---|---|
Total number of spheres |
||
Value for the matrix [0.0] |
||
Value for the inclusion [1.0] |
IC::PSRead
Fill a domain (region where field=0) with packed spheres (regions where field=1). Sphere locations and radii are determined from an xyzr file.
Parameter |
Type |
Values |
---|---|---|
Diffuseness of the sphere boundary |
||
Location of .xyzr file |
file path |
|
Verbosity (used in parser only) |
||
Coordinate multiplier |
||
Coordinate multiplier |
||
Coordinate offset |
IC::PerturbedInterface
Initialize a perturbed interface using Fourier Modes
Notes: 1. todo Extend this class to allow for 3D perturbations, currently only 2D are allowed 2. todo Allow for cosine (or complex exponential) expansions rather than just sin. 3. note This is a two grain only initial condition. 4. note This replaces the depricated “perturbed_bar” initial condition from previous versions
The interface is defined as the \(x=0\) plane (2D), or the \(x=0,z=0\) plane (3D). The equation for the interface is given by \(y(x,z) = \sum_{n\in \{n_1,\ldots,n_N\}} A_n \sin(n\pi x/L_x)\) where \(A_n\) are the amplitudes (stored in #wave_amplitudes), \(n_1,\ldots,n_N\subset\mathbb{Z}_+\) are wave numbers (stored in #wave_numbers), and \(L_x\) is the length in the x direction (obtained using the #geom object).
Grain 1 is defined as being above \(y(x,z)\), Grain 2 is defined as being below.
Parameter |
Type |
Values |
---|---|---|
Wave numbers |
||
Wave amplitudes |
||
Which axis is normal to the interface (x,y,z) |
||
Interface offset from origin |
||
If true, flip the interface (default:false) |
||
Mollifier (options: dirac, [gaussian]) |
||
Magnitude of mollifier |
IC::PNG
Initialize a field using a PNG image. (2D only)
Parameter |
Type |
Values |
---|---|---|
BMP filename. |
file path |
|
How to fit. {options: stretch, fitheight, fitwidth} |
||
Lower-left coordinates of image in domain |
||
Upper-right coordinates of image in domain |
||
Color channel to use (options: r, R, g, G, b, B, a, A) |
r g b a R G B A |
|
Scaling value - minimum |
0.0 |
|
Scaling value - maximum |
255.0 |
IC::Random
Parameter |
Type |
Values |
---|---|---|
Multiplier |
1.0 |
IC::Sphere
Parameter |
Type |
Values |
---|---|---|
Radius of the sphere |
||
Vector location of the sphere center |
||
Value of the field inside the sphere |
||
Value of the field outside teh sphere |
||
Type - can be cylinder oriented along the x, y, z directions or full sphere. |
IC::Trig
This is an old-fashioned IC. You use IC::Expression instead.
Parameter |
Type |
Values |
---|---|---|
Number of real (cosin) waves |
||
Number of imaginary (sin) waves |
||
Spatial dimension |
||
Multiplier |
IC::TabulatedInterface
Parameter |
Type |
Values |
---|---|---|
x location of points |
||
y location of points |
IC::Voronoi
Parameter |
Type |
Values |
---|---|---|
Number of grains |
||
Value to take in the region [1.0] |
||
Random seed to use |
IO
IO::FileNameParse
src/IO/FileNameParse.cpp src/IO/FileNameParse.H
Parameter |
Type |
Values |
---|---|---|
IO::ParmParse
src/IO/ParmParse.cpp src/IO/ParmParse.H
This is a thin wrapper to the amrex::ParmParse class This class exists to add some additional parsing capability, e.g. parsing Set::Matrix and Set::Vector data types.
IO::ParmParse uses static Parse()
functions to
perform cascading class-based input parsing.
See the Autodoc and Autotest section for instructions on adding documentation.
This is standard infrastructure code; make sure you know what you ard doing before you change it.
Query directives
Alamo uses different query directives to standardize reading inputs and automatic documentation.
The type of query that is used (query vs query_required, etc) triggers different handlers and different
automatic documentation procedures.
For instance, the use of a query_default
causes a default value to be set and added to the metadata
file, and it also serves as a flag for the autodoc system to document that a default value is available.
The following table is a reference for the different kinds of query directives.
BC Type |
Description |
---|---|
query |
Standard IO for bool, string, Set::Scalarthat does not enforce defaults or required values. Not recommended for general use. |
query_required |
Similar to query, but will abort if no value is specified. Required values are indicated by required. |
query_default |
Similar to query, but will fill with default value if no value is provided. Will also add default value to metadata. Default values are indicated by green badge values, e.g. 0.0. |
query_validate |
For strings, read in a value and enforce that the value is one of a supplied number of values. Optionally make required, or set the default value to the first supplied value. Acceptable options are indicated by blue badge values, e.g. 1.0, 2.0. If a default value is available, it is indicated by a green badge, e.g. 1.0. |
query_file |
Read in a string that defines a file name. Check to make sure that the file exists and is a regular file, and print an informative error message if not (this can be disabled). Also, copy the file to the output directory, with the full path preserved by replacing / with _. (This can also be disabled, but doing so is discouraged.) Default values are not allowed. File paths are indicated by file path. |
queryarr |
Read in an array of numbers into either a standard vector or
into a |
queryclass |
Read a class object with a specified prefix.
How that class is read in is determined by its |
Query macros
A set of preprocessor macros are defined so that you can call a query function using pp_
instead
of pp.
.
For instance, the following two can be used interchangeably:
pp.query_required("myvar",myvar); /* function version */
pp_query_required("myvar",myvar); /* preprocessor macro version - preferred*/
Using the preprocessor macros enables code location information to be passed to the parser, so that
more informative error messages will be printed out.
Note that the ParmParse object must always be called pp
for this to work.
IO::WriteMetaData
src/IO/WriteMetaData.cpp src/IO/WriteMetaData.H
This provide an IO routine for generating run-specific output.
Every Alamo run produces a metadata file and (if applicable) a diff.patch
file that reflects the exact state when the simulation was run.
Note that the file WriteMetaData.cpp
file is _always_ recompiled
upon make
, in order to pull the latest information about the local
state at build.
This is standard infrastructure code; make sure you know what you ard doing before you change it.
Parameter |
Type |
Values |
---|---|---|
Integrator
src/Integrator/Integrator.cpp src/Integrator/Integrator.H
Pure abstract class for managing data structures, time integration (with substepping), mesh refinement, and I/O.
Native input file parameters:
max_step = [maximum number of timesteps]
stop_time = [maximum simulation time]
timestep = [time step for coarsest level]
amr.regrid_int = [number of timesteps between regridding]
amr.plot_int = [number of timesteps between dumping output]
amr.plot_file = [base name of output directory]
amr.nsubsteps = [number of temporal substeps at each level. This can be
either a single int (which is then applied to every refinement
level) or an array of ints (equal to amr.max_level)
corresponding to the refinement for each level.]
Inherited input file parameters (from amrex AmrMesh class):
amr.v = [verbosity level]
amr.max_level = [maximum level of refinement]
amr.n_proper =
amr.grid_eff =
amr.n_error_buff =
amr.ref_ratio_vect = [refinement ratios in each direction]
amr.ref_ratio = [refinement ratio in all directions (cannot be used with ref_ratio_vect)]
amr.max_grid_x =
amr.blocking_factor =
amr.n_cell = [number of cells on coarsest level]
amr.refine_grid_layout =
amr.check_input =
Parameter |
Type |
Values |
---|---|---|
These are basic parameters that are, in general, common to all Alamo simulations. |
||
Number of iterations before ending (default is maximum possible int) |
2147483647 |
|
Simulation time before ending |
required |
|
Nominal timestep on amrlev = 0 |
required |
|
Name of restart file to READ from |
||
Name of cell-fab restart file to read from |
||
Name of node-fab restart file to read from |
||
This allows the user to ignore certain arguments that would otherwise cause problems. Most generally this is used in the event of a “above inputs specified but not used” error. The primary purpose of this was to fix those errors that arise in regression tests. |
||
Space-separated list of entries to ignore |
||
These are parameters that are specific to the AMR/regridding part of the code. |
||
Regridding interval in step numbers |
2 |
|
Regridding interval based on coarse level only |
0 |
|
Interval (in timesteps) between plotfiles (Default negative value will cause the plot interval to be ignored.) |
-1 |
|
Interval (in simulation time) between plotfiles (Default negative value will cause the plot dt to be ignored.) |
-1.0 |
|
Output file |
output |
|
Turn on to write all output in cell fabs (default: off) |
false |
|
Turn off to prevent any cell based output (default: on) |
true |
|
Turn on to write all output in node fabs (default: off) |
false |
|
Turn off to prevent any node based output (default: on) |
true |
|
Abort if a plotfile contains nan or inf. |
true |
|
Specify a maximum level of refinement for output files (NO REFINEMENT) |
-1 |
|
Number of substeps to take on each level (default: 2) |
||
Number of substeps to take on each level (set all levels to this value) |
required |
|
activate dynamic CFL-based timestep |
||
how much information to print |
0 1 |
|
number of previous timesteps for rolling average |
5 |
|
dynamic teimstep CFL condition |
1.0 |
|
minimum timestep size allowed shen stepping dynamically |
timestep |
|
maximum timestep size allowed shen stepping dynamically |
timestep |
|
Information on how to generate thermodynamic data (to show up in thermo.dat) |
||
Integration interval (1) |
1 |
|
Interval (in timesteps) between writing (Default negative value will cause the plot interval to be ignored.) |
-1 |
|
Interval (in simulation time) between writing (Default negative value will cause the plot dt to be ignored.) |
-1.0 |
|
Instead of using AMR, prescribe an explicit, user-defined set of grids to work on. This is pretty much always used for testing purposes only. |
||
Use explicit mesh instead of AMR |
0 |
Integrator::AllenCahn
This is a simple implementation of an Allen-Cahn equation governed by
where \(\alpha(x,t)\) is the order parameter.
Parameter |
Type |
Values |
---|---|---|
Criterion for mesh refinement [0.01] |
0.01 |
|
Value for \(L\) (mobility) |
1.0 |
|
Value for \(\epsilon\) (diffuse boundary width) |
0.1 |
|
Value for \(\kappa\) (Interface energy parameter) |
1.0 |
|
Value for \(\lambda\) (Chemical potential coefficient) |
1.0 |
|
Force directional growth: 0=no growth, 1=only positive, -1=only negative |
0 1 -1 |
|
Set the initial condition for the alpha field |
sphere constant expression bmp png random psread |
Integrator::CahnHilliard
src/Integrator/CahnHilliard.cpp src/Integrator/CahnHilliard.H
CahnHilliard
Integrator::Dendrite
This is a BASIC phase field method for dendritic growth as described in “A Numerical Approach to Three-Dimensional Dendritic Solidification” by Ryo Kobayashi (1994) Reference: https://doi.org/10.1080/10586458.1994.10504577
Parameter |
Type |
Values |
---|---|---|
Pre-multiplier of “m” barrier height |
required |
|
Anisotropy factor |
required |
|
Anisotropic temperature coupling factor |
required |
|
Diffuse boundary width |
required |
|
Diffusive timescale |
required |
|
Refinement criteria for temperature |
0.01 |
|
Refinement criteria for phi |
0.01 |
Integrator::Flame
src/Integrator/Flame.cpp src/Integrator/Flame.H
Parameter |
Type |
Values |
---|---|---|
Simulation timestep |
1.0e-4 |
|
Burn width thickness |
0.0 |
|
Interface energy param |
0.0 |
|
Scaling factor for mobility |
1.0 |
|
Chemical potential multiplier |
0.0 |
|
Unburned rest energy |
0.0 |
|
Barrier energy |
0.0 |
|
Burned rest energy |
0.0 |
|
number of ghost cells in all fields |
2 |
|
Domain x length |
0.001 |
|
Domain y length |
0.001 |
|
Boundary conditions for phase field order params |
constant |
|
phase field initial condition after comment |
constant expression |
|
phase field initial condition |
laminate constant expression bmp png |
|
IO::ParmParse pp(“thermal”); Whether to use the Thermal Transport Model |
false |
|
Whether to use Neo-hookean Elastic model |
0 |
|
System Initial Temperature |
0.0 |
|
Body force |
0.0 |
|
Phi refinement criteria |
1 |
|
AP Density |
required |
|
HTPB Density |
required |
|
AP Thermal Conductivity |
required |
|
HTPB Thermal Conductivity |
required |
|
AP Specific Heat |
required |
|
HTPB Specific Heat |
required |
|
Baseline heat flux |
0.0 |
|
AP Pre-exponential factor for Arrhenius Law |
required |
|
HTPB Pre-exponential factor for Arrhenius Law |
required |
|
AP Activation Energy for Arrhenius Law |
required |
|
HTPB Activation Energy for Arrhenius Law |
required |
|
Used to change heat flux units |
1.0 |
|
Systen AP mass fraction |
0.8 |
|
AP mass flux reference value |
0.0 |
|
HTPB mass flux reference value |
0.0 |
|
AP/HTPB mass flux reference value |
0.0 |
|
Temperature of the Standin Fluid |
300.0 |
|
K; dispersion variables are use to set the outter field properties for the void grain case. |
||
rho; dispersion variables are use to set the outter field properties for the void grain case. |
||
cp; dispersion variables are use to set the outter field properties for the void grain case. |
||
Scaling factor for AP thermal conductivity (default = 1.0) |
1.0 |
|
Scaling factor for HTPB thermal conductivity (default = 1.0) |
1.0 |
|
Temperature boundary condition |
constant |
|
laser initial condition |
constant expression |
|
thermal initial condition |
constant expression bmp png |
|
Constant pressure value |
1.0 |
|
Surgate heat flux model paramater - AP |
required |
|
Surgate heat flux model paramater - HTPB |
required |
|
Surgate heat flux model paramater - Total |
required |
|
Surgate heat flux model paramater - AP |
required |
|
Surgate heat flux model paramater - HTPB |
required |
|
Surgate heat flux model paramater - Total |
required |
|
Surgate heat flux model paramater - Total |
required |
|
Whether to include pressure to the arrhenius law |
0 |
|
Whether to use pressure to determined the reference Zeta |
1 |
|
Surgate heat flux model paramater - Homogenized |
1.81 |
|
Surgate heat flux model paramater - Homogenized |
1.34 |
|
AP power pressure law parameter (r*P^n) |
required |
|
HTPB power pressure law parameter (r*P^n) |
required |
|
AP/HTPB power pressure law parameter (r*P^n) |
required |
|
AP power pressure law parameter (r*P^n) |
required |
|
HTPB power pressure law parameter (r*P^n) |
required |
|
AP/HTPB power pressure law parameter (r*P^n) |
required |
|
Whether to compute the pressure evolution |
0 |
|
Whether to initialize Phi with homogenized properties |
0 |
|
Refinement criterion for eta field |
0.001 |
|
Refinement criterion for temperature field |
0.001 |
|
Eta value to restrict the refinament for the temperature field |
0.1 |
|
Refinement criterion for phi field [infinity] |
1.0e100 |
|
Lowest value of Eta. |
1.0e-8 |
|
IC type (psread, laminate, constant) |
psread laminate expression constant bmp png |
|
value.ic_phicell = new IC::PSRead(value.geom, pp, “phi.ic.psread”); AP/HTPB interface length |
1.0e-5 |
|
Reference interface length for heat integration |
1.0e-5 |
|
value.ic_phicell = new IC::Laminate(value.geom, pp, “phi.ic.laminate”); AP/HTPB interface length |
1.0e-5 |
|
Reference interface length for heat integration |
1.0e-5 |
|
value.ic_phicell = new IC::Expression(value.geom, pp, “phi.ic.expression”); Reference interface length for heat integration |
1.0e-5 |
|
AP/HTPB interface length |
1.0e-5 |
|
value.ic_phicell = new IC::Constant(value.geom, pp, “phi.ic.constant”); Reference interface length for heat integration |
1.0e-5 |
|
AP/HTPB interface length |
1.0e-5 |
|
value.ic_phicell = new IC::BMP(value.geom, pp, “phi.ic.bmp”); Reference interface length for heat integration |
1.0e-5 |
|
AP/HTPB interface length |
1.0e-5 |
|
Reference interface length for heat integration |
1.0e-5 |
|
AP/HTPB interface length |
1.0e-5 |
|
Initial temperature for thermal expansion computation |
300.0 |
Integrator::Fracture
Parameter |
Type |
Values |
---|---|---|
IC for crack field |
||
Type of crack {notch,ellipsoid} |
||
Integrator::HeatConduction
src/Integrator/HeatConduction.H
This implements a basic heat conduction method in Alamo. The partial differential equation to be solved is
where \(T\) is temperature, \(t\) is time, and \(alpha\) is the thermal diffusivity. Integration is performed explicitly in time using forward Euler, and differentiation is performed using the finite difference method.
Parameter |
Type |
Values |
---|---|---|
Diffusion coefficient \(\alpha\). This is an example of a required input variable - - program will terminate unless it is provided. |
required |
|
Criterion for mesh refinement. This is an example of a default input variable. The default value is provided here, not in the definition of the variable. |
0.01 |
|
Initial condition type. |
constant sphere expression |
|
Select BC object for temperature |
constant expression |
Integrator::Mechanics
This is a general purpose integrator that focuses on solving
elasticity/mechanics equations in the absence of other multiphysics
simulations.
It is enabled by alamo.program=mechanics
if used on its own, in
which case there is no prefix.
If it is being used by another integrator, see that integrator to determine
the value of [prefix]
(often equal to elastic
).
This integrator inherits from Integrator::Base::Mechanics; see documentation for that integrator for additional parameters.
Model setup There are two basic tools for setting up a mechanics problem in this integrator.
The
eta
field: this is used to mix models of different types. Usenmodels
to specify how many material models to use, and then specify each model asmodel1
,model2
, etc. The type of moel is specified using thealamo.program.mechanics.model
input.Once you have done this, you must determine the spatial distribution of each model. This is done by choosing an IC for the eta field with
ic.type
. TheIC::Expression
is the most general and recommended. The models are then mixed linearly, i.e.\[W_{\textrm{eff}} = \sum_{i=1}^N W_i\,\eta_i(\mathbf{x})\]See the Eshelby test for an example of model mixing.
The
psi
field: this is used specifically for cases where a “void” region is desired. Its usage is similar to theeta
case, and is conceptually similar in that it scales the model field to near-zero in order to mimic the (lack of) mechanical behavior in an empty region. It is important to usepsi
here, for reasons that are discussed in detail in this paper. The initialization ofpsi
is similar to that foreta
.See the PlateHole and RubberPlateHole for canonical exmaples. The Integrator::Fracture and Integrator::TopOp integrators are examples of integrators that leverage the psi property.
Body forces currently have limited support due to the relatively low number of times they are needed. See the Integrator::Base::Mechanics documentation for detail. See the TrigTest test for examples of current body force implementation.
Boundary conditions are implemented using the BC::Operator::Elastic classes. See the documentation on these classes for more detail. See any of the mechanics-based tests for examples of boundary condition application.
Parameter |
Type |
Values |
---|---|---|
Number of elastic model varieties |
1 |
|
Refinement threshold for eta field |
0.01 |
|
Refinement threshold for strain gradient |
0.01 |
|
Explicity impose neumann condition on model at domain boundaries (2d only) |
false |
|
Select the initial condition for eta |
constant ellipse voronoi bmp png expression psread |
|
Whether to re-initialize eta when re-gridding occurs. Default is false unless eta ic is set, then default is. true. |
true |
|
Select initial condition for psi field |
ellipse constant expression psread png |
|
Whether to re-initialize psi when re-gridding occurs. Default is false unless a psi ic is set, then default is true. |
true |
|
Read in IC for the “normal traction” field (applied at diffuse boundaries) |
ellipse constant expression psread |
Integrator::PhaseFieldMicrostructure
src/Integrator/PhaseFieldMicrostructure.cpp src/Integrator/PhaseFieldMicrostructure.H
file PhaseFieldMicrostructure.H
Parameter |
Type |
Values |
---|---|---|
Number of grain fields (may be more if using different IC) |
2 |
|
Mobility |
required |
|
Phase field \(\mu\) |
required |
|
Phase field \(\gamma\) |
required |
|
Initial GB energy if not using anisotropy |
required |
|
Mobility |
required |
|
Determine whether to use elastic driving force |
false |
|
Multiplier of elastic energy |
1.0 |
|
Value used for thresholding kinetic relation |
0.0 |
|
Whether to include chemical potential in threshold |
false |
|
Whether to include boundary energy in threshold |
false |
|
Whether to include corner regularization in threshold |
false |
|
Whether to include lagrange multiplier in threshold |
false |
|
Whether to include mechanical driving force in threshold |
false |
|
Type of thresholding to use |
continuous chop |
|
Maximum AMR level |
required |
|
Phase field refinement threshold |
0.1 |
|
Elasticity |
0.0 |
|
Lagrange multiplier method for enforcing volumes |
false |
|
Lagrange multiplier value |
required |
|
Prescribed volume |
required |
|
Lagrange multipler start time |
0.0 |
|
synthetic driving force (SDF) |
false |
|
value of SDF for each grain |
||
time to begin applying SDF |
0.0 |
|
Turn on |
false |
|
Regularization para m |
required |
|
Time to turn on anisotropy |
required |
|
Modify timestep when turned on |
required |
|
Modify plot_int when turned on |
-1 |
|
Modify plot_dt when turned on |
-1.0 |
|
Modify thermo int when turned on |
-1 |
|
Modify thermo plot int when turned on |
-1 |
|
Frequency of elastic calculation |
-1 |
|
Type of regularization to use |
k12 wilmore |
|
Type of GB to use |
abssin sin read sh |
|
Boundary condition for eta |
constant |
|
Initial condition for the order parameter eta |
constant perturbedinterface voronoi expression sphere ellipse random |
|
Anisotropic mobility |
0 |
|
simulation time when anisotropic kinetics is activated |
0.0 |
|
file containing anisotropic mobility data |
file path |
|
file containing anisotropic mobility data |
file path |
Integrator::SutureCrack
Parameter |
Type |
Values |
---|---|---|
IC for crack field |
||
Crack type to use {notch} |
Integrator::ThermoElastic
src/Integrator/ThermoElastic.H
Parameter |
Type |
Values |
---|---|---|
Diffusion coefficient |
Integrator::TopOp
Parameter |
Type |
Values |
---|---|---|
Initial condition for psi field |
ellipse constant |
|
Refinement threshold based on eta |
0.01 |
|
\(\alpha\) parameter |
1.0 |
|
\(\beta\) parameter |
1.0 |
|
\(\gamma\) parameter |
1.0 |
|
Prescribed volume fraction |
0.5 |
|
Prescribed total vlume |
0.5 |
Integrator::Base
Integrator::Base::Mechanics
src/Integrator/Base/Mechanics.H
Parameter |
Type |
Values |
---|---|---|
Type of mecahnics to use. Static: do full implicit solve. Dynamic: evolve dynamic equations with explicit dynamics Disable: do nothing. |
disable static dynamic |
|
Treat mechanics fields as changing in time. [false] You should use this if you care about other physics driven by the output of this integrator. |
false |
|
Include displacement field in output |
true |
|
Include right-hand side in output |
true |
|
Include \(\psi\) field in output |
true |
|
Include stress in output |
true |
|
Include strain in output |
true |
|
Dashpot damping (damps velocity) |
0.0 |
|
Newtonian viscous damping (damps velocity gradient) |
0.0 |
|
Initializer for RHS |
none expression |
|
Select the mechanical boundary conditions |
constant tensiontest expression |
|
Print out model variables (if enabled by model) |
false |
|
Initializer for RHS |
none trig constant |
|
Timestep interval for elastic solves (default - solve every time) |
0 |
|
Maximum multigrid coarsening level (default - none, maximum coarsening) |
-1 |
|
Whether to include residual output field |
false |
|
Whether to refine based on elastic solution |
0.01 |
|
Set this to true to zero out the displacement before each solve. (This is a temporary fix - we need to figure out why this is needed.) |
false |
|
Time to start doing the elastic solve (by default, start immediately) |
-1.0 |
|
Model
In Alamo, any type of constitutive behavior is encapsulated in a “Model”. There is a broad range of model types, and so there is no abstract Model class. Rather, the base Model classes are stored in subsets of Model.
Model::Interface
Model::Interface::Crack
Model::Interface::Crack::Constant
src/Model/Interface/Crack/Constant.H
Parameter |
Type |
Values |
---|---|---|
Fracture energy |
||
Lengthscale regularization |
||
Mobility (speed) |
||
Threshold |
||
Type of g function to use {square, multiwell, 4c3, squarep, squarepexp, cubicm} |
||
Type o w function to use {square, multiwell, multiwell2, 4c3} |
Model::Interface::Crack::Sin
src/Model/Interface/Crack/Sin.H
Parameter |
Type |
Values |
---|---|---|
Min Gc (fracture energy) value |
||
Max Gc (fracture energy)value |
||
Angle offset |
||
Regularization |
||
Crack mobiilty |
||
Threshold for kinetics |
||
Type of g function to use {square, multiwell, 4c3, squarep, squarepexp, cubicm} |
||
Type o w function to use {square, multiwell, multiwell2, 4c3} |
Model::Interface::GB
Model::Interface::GB::AbsSin
src/Model/Interface/GB/AbsSin.H
Parameter |
Type |
Values |
---|---|---|
Angle offset (degrees) |
||
Minimum energy |
||
Energy multiplier |
Model::Interface::GB::Read
Parameter |
Type |
Values |
---|---|---|
Filename containing GB data |
file path |
Model::Interface::GB::SH
Parameter |
Type |
Values |
---|---|---|
Theta offset (degrees) |
||
Phi offset (radians) |
||
Minimum energy value |
||
Energy multiplier |
||
Type of regularization to use: {wilhelm,k23} |
Model::Interface::GB::Sin
Parameter |
Type |
Values |
---|---|---|
Theta offset (degrees) |
||
Minimum energy |
||
Energy multiplier |
||
Frequency number (integer) |
Model::Solid
Solid models are used with the Integrator::Mechanics integrator, which
implements the Solver::Nonlocal::Newton elasticity solver.
All solid models inherit from the Model::Solid
base class, which requires
all of the necessary components to be used in a mechanics solve.
Model classes have basically two functions:
Provide energy (W), stress (DW), and modulus (DDW) based on a kinematic variable
Evolve internal variables in time.
Model::Solid::Affine
src/Model/Solid/Affine/Affine.H
“Affine” generally means “linear with an offset”. Here we use “affine” to refer to models that are elastic with an eigenstrain, i.e.
The quantity \(\varepsilon_0\) is any kind of eigenstrain - examples include thermal strain, plastic strain, or viscous strain. This class can be used directly, where the eigenstrain is read in or set by the integrator. There are also classes (particularly visco/plastic models) that inherit from this type of model.
Model::Solid::Affine::Hexagonal
src/Model/Solid/Affine/Hexagonal.H
This model implements an affine hexagonal material:
where \(W_{aff}\) is the present model, \(\mathbf{F}_0\) is the eigenstrain, and \(W_{lin}\) is the cubic model defined in Model::Solid::Linear::Hexagonal.
Parameter |
Type |
Values |
---|---|---|
Eigenstrain matrix. Can be defined in 2D or 3D. |
Model::Solid::Affine::Isotropic
src/Model/Solid/Affine/Isotropic.H
Parameter |
Type |
Values |
---|---|---|
Lame modulus |
||
Shear modulus |
||
Elastic modulus |
||
Poisson’s ratio |
||
Young’s modulus |
||
Shear modulus |
||
Young’s modulus |
||
Lame parameter |
||
Poisson’s ratio |
||
Shear modulus |
||
Lame parameter |
||
Poisson’s ratio |
||
Bulk modulus |
||
Shear modulus |
||
Eigendeformation gradient |
Model::Solid::Affine::J2
This models an isotropic elastic-perfectly-plastic, non-time-dependent solid model.
The energy and derivatives are:
where \(\mathbb{C}\) is an isotropic Set::Matrix4
and \(\varepsilon_p\) is
is stored in the F0
eigenstrain.
The plastic strain is evolved according to the following:
Calculate the deviatoric stress \(\sigma_v=\sigma - \frac{1}{3}tr(\sigma)\mathbf{I}\)
Calculate \(J_2=\sqrt{\frac{3}{2}\sigma_v:\sigma_v}\)
If \(J_2<\sigma_0\) then quit - no plasticity occurs
Calculate \(\Delta\sigma = (1-\frac{\sigma_0}{J_2})\), which projects the stress back on the yield surface.
Convert to change in plastic strain, \(\Delta\varepsilon=\mathbb{C}^{-1}\Delta\sigma\)
Update plastic strain: \(\varepsilon_p += \Delta\varepsilon\)
Notes:
This does not implement any kind of hardening model. Rate hardening, isotropic hardening, and kinematic hardening have yet to be implemneted.
Parameter |
Type |
Values |
---|---|---|
J2 Yield criterion |
1.0 |
|
Hardening coefficient (negative value disables rate hardening) |
-1.0 |
|
Rate coefficient (negative value disables rate hardening) |
-1.0 |
Model::Solid::Affine::J2Plastic
src/Model/Solid/Affine/J2Plastic.H
Parameter |
Type |
Values |
---|---|---|
Lame constant |
||
Shear modulus |
||
Young’s modulus |
||
Poisson’s ratio |
||
Yield strength |
||
Hardening constant |
||
Hardening theta |
Model::Solid::Finite
Model::Solid::Finite::CrystalPlastic
src/Model/Solid/Finite/CrystalPlastic.H
A basic and relatively untested implementation of finite-deformation FCC crystal plasticity. Use with caution.
Inherits from PseudoLinear::Cubic to provide elastic response.
Plastic flow modeled as:
where \(\mathbf{F}=\mathbf{F}^e\mathbf{F}^p\) and \(\gamma_n\) are slips on system \(n\).
Power law rate hardening is used in the integration of slips:
Parameter |
Type |
Values |
---|---|---|
Critical resolved shear stress \(\tau_{crss}\) |
||
Rate hardening coefficient \(\dot{\gamma}_0\) |
1.0 |
|
Inverse of the hardening exponent \(\frac{1}{m}\) |
0.5 |
|
Time to activate plastic slip |
0.0 |
Model::Solid::Finite::NeoHookeanPredeformed
src/Model/Solid/Finite/NeoHookeanPredeformed.H
Parameter |
Type |
Values |
---|---|---|
Large-deformation eigendeformation (Identity = no deformation) |
||
Small-deformation eigendeformation (Zero = no deformation) |
Model::Solid::Finite::NeoHookean
src/Model/Solid/Finite/NeoHookean.H
Parameter |
Type |
Values |
---|---|---|
Shear modulus |
||
Bulk modulus |
||
Alternative input for shear modulus |
||
Bulk modulus |
||
Shear modulus |
||
Lame parameter |
||
Young’s modulus |
||
Poisson’s ratio |
Model::Solid::Finite::PseudoAffine
Model::Solid::Finite::PseudoAffine::Cubic
src/Model/Solid/Finite/PseudoAffine/Cubic.H
Parameter |
Type |
Values |
---|---|---|
Large-strain eigendeformation (Identity = no deformation) |
||
Small-strain eigendeformation (Zero = no deformation) |
Model::Solid::Finite::PseudoLinear
Model::Solid::Finite::PseudoLinear::Cubic
src/Model/Solid/Finite/PseudoLinear/Cubic.H
Parameter |
Type |
Values |
---|---|---|
Set::Scalar C11 = 1.68, C12 = 1.21, C44 = 0.75; Elastic constant (default: 1.68) |
||
Elastic constant (default: 1.21) |
||
Elastic constant (default: 0.75) |
||
Bunge Euler angle \(\phi_1\) |
||
Bunge Euler angle \(\Phi\) |
||
Bunge Euler angle \(\phi_2\) |
Model::Solid::Linear
Model::Solid::Linear::Cubic
src/Model/Solid/Linear/Cubic.H
This class implements basic cubic elasticity. For a discussion on cubic elasticity, please see this link.
Parameter |
Type |
Values |
---|---|---|
Elastic constant |
1.68 |
|
Elastic constant |
1.21 |
|
Elastic constant |
0.75 |
|
specify whether using radians or degrees |
radians degrees |
|
Bunge Euler angle \(\phi_1\) about x axis |
0.0 |
|
Bunge Euler angle \(\Phi\) about z axis |
0.0 |
|
Bunge Euler angle \(\phi_2\) about x axis |
0.0 |
Model::Solid::Linear::Hexagonal
src/Model/Solid/Linear/Hexagonal.H
This class implements elasticity for a linear material with hexagonal symmetry. The elastic modulus tensor \(\mathbb{C}\) has major and minor symmetry but not cubic symmetry, so the symmetry class for this material is Set::Sym::MajorMinor. The five elastic constants in the unrotated system are \(C_{11},C_{12},C_{13},C_{33},C_{44}\), and the resulting elastic modulus tensor is
Rotations can be specified using Bunge euler angles to generate a rotation matrix \(\mathbf{R}\). The rotated modulus tensor \(\mathbb{C}^{rot}\) is then
Parameter |
Type |
Values |
---|---|---|
Elastic constant |
required |
|
Elastic constant |
required |
|
Elastic constant |
required |
|
Elastic constant |
required |
|
Elastic constant |
required |
|
Bunge Euler angle \(\phi_1\) |
0.0 |
|
Bunge Euler angle \(\Phi\) |
0.0 |
|
Bunge Euler angle \(\phi_2\) |
0.0 |
Model::Solid::Linear::Isotropic
src/Model/Solid/Linear/Isotropic.H
This model implements an isotropic linear elastic material. See this link for more information about the theory.
Free energy for a linear material is defined as
For an isotropic material, stress and strain are related through
where \(\lambda\) and \(\mu\) are the Lame constant and shear modulus, respectively.
Users can specify these either through (lame
and shear
)
OR (lambda
and mu
) OR (E
and nu
).
Class methods:
Isotropic()
: Basic constructor. Does nothing, and leaves all values initiated as NAN.Isotropic(Solid<Set::Sym::Isotropic> base)
Basic constructor. Does nothing gut allows for inheritance.Isotropic(Set::Scalar a_mu, Set::Scalar a_lambda)
BAD old-fashioned constructor. Do not use!~Isotropic()
Simple destructor. Don’t need to change it.void Define(Set::Scalar a_mu, Set::Scalar a_lambda)
BAD old-fashioned way of doing things. UseParse
instead.Set::Scalar W(const Set::Matrix & gradu) const override
Returns elastic free energy densitySet::Matrix DW(const Set::Matrix & gradu) const override
Returns first derivative of free energy, the stress tensorSet::Matrix4<...> DDW(const Set::Matrix & ) const override
Returns second derivative of free energy, the modulus tensorvirtual void Print(std::ostream &out) const override
Prints the modulus tensor object to output stream (usually the terminal)static Isotropic Random()
Static method that generates a random yet acceptable model.static Isotropic Zero()
Static method that generates a “zero” element (so that there is no effect under addition)static void Parse(Isotropic & value, IO::ParmParse & pp)
Parser where all the IO occurs
Parameter |
Type |
Values |
---|---|---|
Whether or not to use the plane stress approximation. |
||
Lame parameter |
||
Shear modulus (redundant with “mu”) |
||
Lame parameter |
||
Shear modulus (redundant with “shear”) |
||
Elastic modulus |
||
Poisson’s ratio |
Model::Solid::Linear::Laplacian
src/Model/Solid/Linear/Laplacian.H
Parameter |
Type |
Values |
---|---|---|
Coefficient for the Laplacian |
1.0 |
Numeric
Numeric::Interpolator
src/Numeric/Interpolator/Interpolator.H
This namespace has evolved to contain some general Interpolator routines that are actually unrelated. The Numeric::Interpolator::Linear is an I/O utility. The Numeric::Interpolator::NodeBilinear is a low-level AMReX override that the average user (or even coder) will probably not need to touch.
Numeric::Interpolator::Linear
src/Numeric/Interpolator/Linear.H
This is a general-purpose routine for specifying time-interpolated quantities in an input file. Interpolators obey the following syntax:
(t1,t2,..,tn;v1,v2,...,vn)
where tn
are times and vn
are values at those times.
Note: do not include whitespace in an interpolator, this will mess with the parser.
Interpolators can usually be used in place of regular numbers, but only when supported by the calling parse function.
For instance, the BC::Operator::Elastic::TensionTest allows the user to specify fixed displacement; for instance, to specify a value of 0.1:
bc.tenstion_test.disp = 0.1
However, it may be desirable to change the value over time. In this case, one may specify an interpolator string instead:
bc.tenstion_test.disp = (1.0,1.5,2.0;0.0,0.1,0.0)
This will cause the displacement value to be zero for t<1.0
;
ramp to 0.1
as 1.0<t<2.0
;
ramp back to 0.0
as 2.0<t<3.0
;
and then remain at the constant value of 3.0
for t>3.0
.
Parameter |
Type |
Values |
---|---|---|
Interpolator string used when Parsed from queryclass. |
Numeric::Interpolator::NodeBilinear
src/Numeric/Interpolator/NodeBilinear.H
Provide an interpolator function that can work with templated fields.
Warning: This is a low-level class used to add templating functionality to unerlying AMReX classes. Edit at your own risk!
Operator
Operator::Elastic
src/Operator/Elastic.cpp src/Operator/Elastic.H
Parameter |
Type |
Values |
---|---|---|
Regularization offset value used in near-singular elastic solves. It should be small - if it is too large, you will get better convergence but less correct values! |
Set
The Set namespace defines the Alamo datatypes.
This includes scalars (Set::Scalar
), vectors (Set::Vector
), and nD tensors (Set::Tensor
).
Scalars are an alias for AMReX Real
.
Vectors and tensors are an alias for the Tuxfamily Eigen vectors and matrices, and so you can use
Eigen operations on them (like A.determinant()
, etc.)
See the Eigen documentation for more.
The Set namespace defines the Matrix4
datatype for fourth order tensors.
These can have isotropic, major, minor, majorminor, etc., symmetries.
The Set namespace also defines the Field
datatype, which is where most data is stored.
It is templated so that Set::Field<Set::Scalar>
is a field of scalars, Set::Field<Set::Vector>
is a vector field, etc.
One can also have, for instance, a field of models, like Set::Field<Model::Solid::Linear::Iostropic>
.
Set::Matrix4_Isotropic
The isotropic tensor is defined to be
The inverse (“compliance”) tensor is
Replacing E, nu with Lame constants gives:
- For reference: http://solidmechanics.org/text/Chapter3_2/Chapter3_2.htm
Solver
Solver::Nonlocal
Solver::Nonlocal::Linear
Parameter |
Type |
Values |
---|---|---|
Max number of iterations to perform before erroring out |
||
Max number of iterations on the bottom solver |
||
Max number of F-cycle iterations to perform |
||
Number of fixed iterations to perform before exiting gracefully |
||
Verbosity of the solver (1-5) |
||
Number of smoothing operations before bottom solve (2) |
||
Number of smoothing operations after bottom solve (2) |
||
Number of final smoothing operations when smoother is used as bottom solver (8) |
||
Additional smoothing after bottom CG solver (0) |
||
The method that is used for the multigrid bottom solve (cg, bicgstab, smoother) |
||
Relative tolerance on bottom solver |
||
Absolute tolerance on bottom solver |
||
Relative tolerance |
||
Absolute tolerance |
||
Omega (used in gauss-seidel solver) |
||
Whether to average down coefficients or use the ones given. (Setting this to true is important for fracture.) |
||
Whether to normalize DDW when calculating the diagonal. This is primarily used when DDW is near-singular - like when there is a “void” region or when doing phase field fracture. |
||
If set to true, output diagnostic multifab information whenever the MLMG solver fails to converge. (Note: you must also set |
||
If set to false, MLMG will not die if convergence criterion is not reached. (Note: you must also set |
||
Solver::Nonlocal::Newton
Parameter |
Type |
Values |
---|---|---|
Number of newton-raphson iterations. |
||
Tolerance to use for newton-raphson convergence |
Util
src/Util/Util.cpp src/Util/Util.H
Parameter |
Type |
Values |
---|---|---|
Name of directory containing all output data |
||