Prepared by Ivan Batistić
This document describes solids4foam
function objects which are not available within the standard OpenFOAM
package;
Function objects are various post-processing functionalities that are executing during simulation run time;
Function objects are placed at the bottom of the system/controlDict
file; for example:
functions
{
forceDisp
{
type solidForcesDisplacements;
historyPatch cylinderFixed;
}
patchForce
{
type solidForces;
historyPatch top;
}
}
cantileverAnalyticalSolution
where $\nu$ is Poisson's ratio, $E$ is Young modulus, $I$ is the second moment of are of the cross-section, $P$ is applied load and $L$ is length of the beam.
Above analytical solution can be used only if the shearing forces on the ends are distributed according to the same parabolic law as the shearing stress $\tau_{xy}$ and the intensity of the normal forces at the built-in end is proportional to $y$.
The current version of the code assumes a rectangular cross-section with unit width and automatically calculates the second moment of inertia!
Example of usage
functions
{
cantileverSolution
{
type cantileverAnalyticalSolution;
E 00e6;
nu 0.3;
L 10;
D 0.1;
P 1e5;
//Optional
cellDisplacement true;
pointDisplacement true;
cellStress true;
pointStress true;
}
}
Arguments
P
load applied in the minus $y$ direction at the other end of the beam;L
length of the beam;D
depth of the beam;E
Young's modulus;nu
Poisson's ratio.Optional arguments
cellDisplacement
write analytical solution for cell-centred displacement field; default is true;pointDisplacement
write analytical solution for vertex-centred displacement field; default is true;cellStress
write analytical solution for cell-centred stress field; default is true;pointStress
write analytical solution for vertex-centred stress field; default is true;Outputs
analyticalStress
in time directories;analyticalD
in time directories.cellStressDifference
field; difference between analytical stress and calculated one: analyticalStress-sigma
;DDiference
field; difference between analytical displacement and calculated one: analyticalD-D
.Component: 1
Norms: mean L1, mean L2, LInfL: 0.12 0.2 0.5
...
Tutorial case in which it is used: :
solids/linearElasticity/cantilever2d/vertexCentredCantilever2d
contactPatchTestAnalyticalSolution
where \(E\) is Young's modulus, \(\nu\) Poisson's ratio and \(\Delta\) prescribed displacement of upper block top surface.
To use this analytical solution, the bottom surface of the lower block must freely deform in the tangential direction. It can be fixed only in the case of zero Poisson’s ratio.
Example of usage
functions
{
analyticalSolution
{
type contactPatchTestAnalyticalSolution;
displacement 0.01;
E 1e6;
nu 1e-15;
}
}
Arguments
displacement
upper block prescribed vertical displacement;E
Young's modulus;nu
Poisson's ratio.Optional arguments
Outputs
Analytical solution for stress tensor field analyticalStress
in time directories.
Scalar field of relative error named relativeError
and defined as: \(e(\%)=\dfrac{\left| \sigma_y - \sigma_y^{analytical} \right|}{\left|\sigma_y^{analytical}\right|} \cdot 100.\)
Tutorial case in which it is used:
solids/linearElasticity/contactPatchTest
curvedCantileverAnalyticalSolution
where $a$ is beam inner radius, $b$ is beam outer radius and $P$ is applied shear force.
Example of usage
functions
{
analyticalSolution
{
type curvedCantileverAnalyticalSolution;
rInner 0.31;
rOuter 0.33;
force 4;
E 100;
nu 0.3;
}
}
Arguments
rInner
inner beam radius;rOuter
outer beam radius;force
applied force in (N/m) at beam free end;E
Young's modulus;nu
Poisson's ratio.Optional arguments
Outputs
analyticalStress
in time directories.Tutorial case in which it is used:
solids/linearElasticity/curvedCantilever
hotCylinderAnalyticalSolution
where $a$ is pipe inner radius, $b$ is pipe outer radius, $\nu$ is Poisson's ratio, $E$ is Young modulus, $\alpha$ is coefficient of linear thermal expansion and $\Delta T$ is temperature difference between inner and outer pipe surface.
Example of usage
functions
{
analyticalHotCylinder
{
type hotCylinderAnalyticalSolution;
rInner 0.5;
rOuter 0.7;
TInner 100;
TOuter 0;
E 200e9;
nu 0.3;
alpha 1e-5;
}
}
Arguments
rInner
inner pipe radius;rOuter
outer pipe radius;TInner
temperature on the inner pipe surface;TOuter
temperature on the outer pipe surface;E
Young's modulus;nu
Poisson's ratio;alpha
coefficient of linear thermal expansion.Optional arguments
Outputs
analyticalHoopStress
in time directories.analyticalRadialStress
in time directories.analyticalT
in time directories.Tutorial case in which it is used:
solids/thermoelasticity/hotCylinder/hotCylinder
plateHoleAnalyticalSolution
same in cartesian coordinates:
\[\sigma_{xx} = T \left( 1-\frac{a^2}{r^2}\left(\frac{3}{2}\cos(2\theta)+\cos(4\theta) \right) + \frac{3}{2}\frac{a^4}{r^4}\cos(4\theta) \right),\] \[\sigma_{yy} = T \left( -\frac{a^2}{r^2}\left(\frac{1}{2}\cos(2\theta)-\cos(4\theta) \right) - \frac{3}{2}\frac{a^4}{r^4}\cos(4\theta) \right),\] \[\sigma_{xy} = T \left( -\frac{a^2}{r^2}\left(\frac{1}{2}\cos(2\theta)+\sin(4\theta) \right) + \frac{3}{2}\frac{a^4}{r^4}\sin(4\theta) \right).\] Displacement field in cartesian coordinates:
\[u_x = \frac{Ta}{8\mu}\left( \frac{r}{a}(\kappa+1)\cos\theta+\frac{2a}{r}\left((1+\kappa)\cos(\theta)+\cos (3\theta)\right)-\frac{2a^3}{r^3}\cos(3\theta) \right),\] \[u_y = \frac{Ta}{8\mu}\left( \frac{r}{a}(\kappa-3)\sin\theta+\frac{2a}{r}\left((1-\kappa)\sin(\theta)+\sin (3\theta)\right)-\frac{2a^3}{r^3}\sin(3\theta) \right),\] where \(a\) is hole radius, \(T\) is far field traction in \(x\) direction, \(\nu\) is Poisson's ratio, \(\mu\) is shear modulus and \(\kappa\) parameter is equal to \(3-4\nu\).
Example of usage
functions
{
plateHoleSolution
{
type plateHoleAnalyticalSolution;
holeRadius 1;
farFieldTractionX 1e6;
E 100;
nu 0.3;
//Optional
cellDisplacement true;
pointDisplacement true;
cellStress true;
pointStress true;
}
}
Arguments
holeRadius
radius of the hole centred on the origin;farFieldTractionX
far-field traction in the $x$ direction;E
Young's modulus;nu
Poisson's ratio.Optional arguments
cellDisplacement
write analytical solution for cell-centred displacement field; default is true;pointDisplacement
write analytical solution for vertex-centred displacement field; default is true;cellStress
write analytical solution for cell-centred stress field; default is true;pointStress
write analytical solution for vertex-centred stress field; default is true;Outputs
analyticalStress
in time directories;analyticalD
in time directories.Tutorial case in which it is used:
None.
fsiConvergenceData
Function object purpose
Reports the number of outer correctors required at each time-step to reach convergence of the FSI coupling.
Example of usage
functions
{
fsiConvData
{
type fsiConvergenceData;
//Optional
region fluid;
}
}
Arguments
Optional arguments
region
name; the default value is set to region0
.Outputs
Output file: postProcessing/0/fsiConvergenceData.dat
;
Output file format:
# Time nFsiCorrectors
0 15
1 12
...
Tutorial case in which it is used:
fluidSolidInteraction/heatTransfer/flowOverHeatedPlate
fluidSolidInteraction/heatTransfer/thermalCavity
hydrostaticPressure
Function object purpose
Outputs the hydrostatic component of the stress tensor field
where \(\mathbf{\sigma}\) is stress tensor.
Example of usage
functions
{
meanStress
{
type hydrostaticPressure;
}
}
Arguments
Optional arguments
Outputs
Scalar field hydrostaticPressure
in time directories;
Log at the end of each time-step:
Hydrostatic pressure: min = 150, max = 500
Tutorial case in which it is used:
None
principalStresses
Function object purpose
Calculate and write principal stress fields. It assumed that the stress tensor is called sigma
or sigmaCauchy
. Three vector fields are created: sigmaMax
, sigmaMid
, sigmaMin
. sigmaMax
is the most positive/tensile principal stress multiplied by the corresponding principal direction; sigmaMid
is the middle principal stress multiplied by the corresponding principal direction; sigmaMin
is the most negative/compressive principal stress multiplied by the corresponding principal direction.
Example of usage
functions
{
principalStresses1
{
type principalStresses;
// Optional
compressionPositive true;
region region0;
}
}
Arguments
Optional arguments
region
name; the default value is set to region0
.compressionPositive
specify if compression is considered positive; default is false
.Outputs
sigmaMinDir
vector field in time directories;sigmaMin
scalar field in time directories;sigmaMaxDir
vector field in time directories;sigmaMax
scalar field in time directories;sigmaMidDir
vector field in time directories;sigmaMid
scalar field in time directories;sigmaDIff
field; difference between sigmaMax
and sigmaMin
fields.Tutorial case in which it is used:
None
solidDisplacements
Function object purpose
Reports the minimum and maximum values of displacement components together with the arithmetic average value of the displacement.
Example of usage
functions
{
patchDisplacements
{
type solidDisplacements;
historyPatch top;
}
}
Arguments
historyPatch
is the name of the patch.
The non-existing patch name will not stop the simulation.
Optional arguments
Outputs
Output file: postProcessing/0/solidDisplacements<historyPatch>.dat
;
Output file format:
# Time minX minY minZ maxX maxY maxZ avX avY avZ
1 1 1 1 3 4 5 1.2 2 4
2 1 1 1 3 3 2 1 3 5
...
Tutorial case in which it is used:
solids/hyperelasticity/longWall
solids/elastoplasticity/neckingBar
solidForces
Function object purpose
Reports the overall force \(\mathbf{f}\) and normal force \(f_n\) for specified patch:
where \(\mathbf{n}_f\) is outward unit normal vector, \(\boldsymbol{\sigma}\) is Cauchy stress and \(N_f\) is number of faces on specified patch. Subscript $f$ is used to denote face centre value. In the case of TL formulation, the current boundary unit normal vector \(\mathbf{n}_f\) is calculated using total deformation gradient and its Jacobian \(J \: \mathbf{F}_{inv}^T \cdot \mathbf{n}_f\).
Example of usage
functions
{
patchForce
{
type solidForces;
historyPatch top;
}
}
Arguments
historyPatch
is the name of the patch.
The non-existing patch name will not stop the simulation.
Optional arguments
Outputs
Output file: postProcessing/0/solidForces<historyPatch>.dat
;
Output file format:
# Time forceX forceY forceZ normalForce
1 40 40 50 48
2 40 60 70 45
...
Tutorial case in which it is used:
solids/linearElasticity/punch
solids/linearElasticity/plateHole
solids/elastoplasticity/pipeCrush
solids/elastoplasticity/uniaxialTension
solids/elastoplasticity/impactBar
solids/elastoplasticity/simpleShear
solids/elastoplasticity/perforatedPlate
solids/elastoplasticity/cylinderCrush
solids/abaqusUMATs/plateHoleTotalDispUMAT
solids/hyperelasticity/plateHoleTotalLag
solids/hyperelasticity/cylinderCrush
fluidSolidInteraction/3dTube
fluidSolidInteraction/3dTubeRobin
fluidSolidInteraction-preCICE/3dTube
solidForcesDisplacements
Function object purpose
Reports the overall force \(f\) vs arithmetic average displacement \(\bar{\mathbf{u}}\) for specified patch:
where \(\mathbf{n}_f\) is outward unit normal vector, \(\boldsymbol{\sigma}\) is Cauchy stress, $\mathbf{u}$ is displacement vector and \(N_f\) is number of faces on specified patch. Subscript \(f\) is used to denote face centre value. In the case of TL formulation, the current boundary unit normal vector \(\mathbf{n}_f\) is calculated using total deformation gradient and its Jacobian \(J \: \mathbf{F}_{inv}^T \cdot \mathbf{n}_f\).
Example of usage
functions
{
patchForceDisplacements
{
type solidForcesDisplacements;
historyPatch top;
}
}
Arguments
historyPatch
is the name of the patch.
The non-existing patch name will not stop the simulation.
Optional arguments
Outputs
Output file: postProcessing/0/solidForcesDisplacements<historyPatch>.dat
;
Output file format:
# Time dispX dispY dispZ forceX forceY forceZ
1 0.1 0.1 0.1 40 40 50
2 0.1 0.2 0.2 40 60 70
...
Tutorial case in which it is used:
solids/linearElasticity/punch
solids/linearElasticity/plateHole
solids/elastoplasticity/pipeCrush
solids/elastoplasticity/perforatedPlate
solids/elastoplasticity/cylinderCrush
solids/abaqusUMATs/plateHoleTotalDispUMAT
solids/hyperelasticity/plateHoleTotalLag
solidKineticEnergy
Function object purpose
Reports the kinetic energy $E_k$ of a solid:
where \(\rho\) is density, \(\mathbf{v}\) is velocity, \(N_P\) is number of cells and \(V\) is volume. Subscript \(P\) is used to denote cell centre value.
Example of usage
functions
{
kineticEnergy
{
type solidKineticEnergy;
}
}
Arguments
Optional arguments
Outputs
Output file: postProcessing/0/solidKineticEnergy.dat
;
Output file format:
# Time kineticEnergy
1 0.10
2 0.11
...
Tutorial case in which it is used:
None
solidPointDisplacement
Function object purpose
Reports displacement vector value at closest mesh point to the specified point. The closest mesh point is determined using Euclidean distance. The displacement field (defined at cell centres) is interpolated to mesh points using the least squares interpolation.
functions
{
pointDisp
{
type solidPointDisplacement;
point (105e-6 50e-6 0);
// Optional
region "solid";
}
}
Arguments
point
- monitoring point vector.Optional arguments
region
name; in the case of structural analysis, the default value is set to solid
otherwise it is region0
.Outputs
Output file: postProcessing/0/solidPointDisplacement_<functionObjectName>.dat
;
Output file format:
# Time Dx Dy Dz magD
1 0.10 0.20 0.10 0.24494897
2 0.11 0.20 0.22 0.26551836
...
solids/hyperelasticity/cylinderCrush
solids/hyperelasticity/cylindricalPressureVessel
solids/abaqusUMATs/plateHoleTotalDispUMAT
solids/elastoplasticity/perforatedPlate
solids/elastoplasticity/cooksMembrane
solids/viscoelasticity/viscoTube
solids/linearElasticity/cooksMembrane
solids/abaqusUMATs/plateHoleTotalDispUMAT
solids/linearElasticity/wobblyNewton
solids/linearElasticity/plateHole
fluidSolidInteraction/beamInCrossFlow
fluidSolidInteraction/HronTurekFsi3
fluidSolidInteraction/3dTubeRobin
solidPointDisplacementAlongLine
Function object purpose
Reports reports displacement value along a line specified by the user. The displacement field (defined at cell centres) is interpolated to mesh points using the least squares interpolation.
Example of usage
functions
{
pointStress
{
type solidPointDisplacementAlongLine;
startPoint (0 0 0);
endPoint (2 0 0);
// Optional
minDist 1e-5;
region "solid";
}
}
This function object is currently only implemented for serial run!
Arguments
startPoint
line start point;endPoint
line end point.Optional arguments
minDist
maximum distance at which mesh point will be included in line plot;region
name; in the case of structural analysis, the default value is set to solid
otherwise it is region0
.Outputs
Output file: postProcessing/0/solidPointDisplacementAlongLine<functionObjectName>.dat
;
Output file format:
# PointID PointCoord Dx Dy Dz mag
152 (0.2 0.3 0.5) 0.1 0.2 0.1 0.2449
258 (0.4 0.3 0.5) 0.1 0.2 0.2 0.3
...
Tutorial case in which it is used:
None.
solidPointStress
Function object purpose
Reports stress value at closest mesh point to the specified point. The closest mesh point is determined using Euclidean distance. The stress field (defined at cell centres) is interpolated to mesh points using the least squares interpolation.
Example of usage
functions
{
pointStress
{
type solidPointStress;
point (0.0075 0 0);
// Optional
region "solid";
}
}
Arguments
point
- monitoring point vector.Optional arguments
region
name; in the case of structural analysis, the default value is set to solid
otherwise it is region0
.Outputs
Output file: postProcessing/0/solidPointStress_<functionObjectName>.dat
;
Output file format:
# Time XX XY XZ YY YZ ZZ
1 1e6 1e6 1e6 1e6 2e6 3e6
2 1e6 3e6 2e6 2e6 2e6 3e6
...
Tutorial case in which it is used:
solids/viscoelasticity/viscoTube
solidPointTemperature
Function object purpose
Reports temperature value at closest mesh point to the specified point. The closest mesh point is determined using Euclidean distance. The temperature field (defined at cell centres) is interpolated to mesh points using the least squares interpolation.
Example of usage
functions
{
pointTemp
{
type solidPointTemperature;
point (105e-6 50e-6 0);
// Optional
region "solid";
}
}
Arguments
point
- monitoring point vector.Optional arguments
region
name; in the case of structural analysis, the default value is set to solid
otherwise it is region0
.Outputs
Output file: postProcessing/solidPointTemperature_<functionObjectName>.dat
;
Output file format:
# Time value
1 225
2 226
...
Tutorial case in which it is used:
None
solidPotentialEnergy
Function object purpose
Reports the potential energy of a solid:
where \(\rho\) is density, \(\mathbf{u}\) is displacement, \(N_P\) is number of cells, \(g\) is gravity, \(V\) is volume, \(\mathbf{r}_{ref}\) is reference point with zero potential energy and \(\mathbf{r}_P\) is positional vector of cell centroid. Subscript \(P\) is used to denote cell centre value.
Example of usage
functions
{
potentialEnergy
{
type solidPotentialEnergy;
referencePoint (10 50 0);
}
}
Arguments
referencePoint
is a coordinate at which the potential energy is zero.
The value for the uniform gravity field $g$ is specified at constant/g
!
Optional arguments
Outputs
Output file: postProcessing/0/solidPotentialEnergy.dat
;
Output file format:
# Time potentialEnergy
1 500
2 520
...
Tutorial case in which it is used:
None
solidPotentialEnergy
is currently implemented only for linear geometry solid models!
solidStresses
Function object purpose
Reports the arithmetic average stress on the patch of a solid:
where subscript \(f\) is used to denote patch face centre value, \(\boldsymbol{\sigma}\) is Cauchy stress tensor and \(N_f\) is overall number of patch faces
Example of usage
functions
{
topStress
{
type solidStresses;
historyPatch top;
}
}
Arguments
historyPatch
is the name of the patch.
The non-existing patch name will not stop the simulation.
Optional arguments
Outputs
Output file: postProcessing/0/solidStresses<historyPatch>.dat
;
Output file format:
# Time XX XY XZ YY YZ ZZ
1 1e6 1e6 1e6 1e6 2e6 3e6
2 1e6 3e6 2e6 2e6 2e6 3e6
...
Tutorial case in which it is used:
solids/elastoplasticity/cylinderExpansion
solids/hyperelasticity/longWall
solidTorque
Function object purpose
Reports torque on the specified patch about the given axis:
where \(\mathbf{r}_{pa}\) is point on axis, \(\mathbf{a}\) is axis direction, \(\mathbf{r}_f\) is face centre vector, \(\mathbf{S}_f\) boundary face area vector, \(\boldsymbol{\sigma}_f\) Cauchy stress vector and \(N_f\) number of boundary patch faces. In the case of TL formulation, the current boundary face area vector \(\mathbf{S}_f\) is calculated using total deformation gradient and its Jacobian \(J \: \mathbf{F}_{inv}^T \cdot \mathbf{S}_f\).
Example of usage
functions
{
patchTorque
{
type solidTorque;
historyPatch right;
pointOnAxis (0 0 0);
axisDirection (0 0 1);
}
}
Arguments
pointOnAxis
- point on axis;
axisDirestion
- axis vector, does not require to be normalised;
historyPatch
is the name of the patch.
The non-existing patch name will not stop the simulation.
Optional arguments
Outputs
Output file: postProcessing/0/solidTorque<historyPatch>.dat
;
Output file format:
# Time torqueX torqueY torqueZ
1 10 12 13
2 12 13 13
...
Tutorial case in which it is used:
None
solidTractions
Function object purpose
Writes boundary traction as a vector field:
where \(\boldsymbol{\sigma}\) is Cauchy stress tensor, \(\mathbf{n}_b\) boundary outward unit vector and \(\mathbf{F}_{inv}\) inverse of total deformation gradient. Note that in case of UL formulation boundary normal \(\mathbf{n}_b\) is in current configuration while in the case of TL approach it is in initial configuration.
Example of usage
functions
{
patchTractions
{
type solidTractions;
}
}
Arguments
Optional arguments
Outputs
traction
in time directories;Tutorial case in which it is used:
None
stressTriaxiality
Function object purpose
Outputs the stress triaxiality field (mean i.e. hydrostatic stress divided by equivalent stress):
where \(T.F\) is triaxiality factor, \(\boldsymbol{\sigma}\) is Cauchy stress and \(\mathbf{\sigma}_{eq}\) is Von Mises equivalent stress.
Example of usage
functions
{
triaxility
{
type stressTriaxility;
// Optional
region "region0";
}
}
Arguments
Optional arguments
region
name; the default value is set to region0
.Outputs
Scalar field stressTriaxiality
in time directories;
Log at the end of each time-step:
Stress triaxiality: min = 0.2, max = 0.4
Tutorial case in which it is used:
None
transformStressToCylindrical
Function object purpose
Transform stress tensor to cylindrical coordinate system: \(\sigma_{transformed} = \mathbf{R} \cdot \sigma \cdot \mathbf{R}^{T},\)
where \(\mathbf{R}\) is rotation tensor.
Example of usage
functions
{
transformStressToCylindrical
{
type transformStressToCylindrical;
origin (0 0 0);
axis (0 0 1);
}
}
Arguments
origin
- origin point;axis
- axis vector, does not require to be normalised;Optional arguments
Outputs
Transformed sigma stress field named sigma:Transformed
in time directories;
When visualizing in Paraview, keep in mind that the stress components in the cylindrical coordinate system will have the same names as the ones from the Cartesian coordinate system.
\[\boldsymbol{\sigma} = \left[\begin{array}{ccc}\sigma_{xx} & \sigma_{xy} & \sigma_{xz} \\ & \sigma_{yy} & \sigma_{yx} \\ & & \sigma_{zz}\end{array}\right]\equiv\left[\begin{array}{ccc}\sigma_{R R} & \sigma_{R \theta} & \sigma_{R \phi} \\ & \sigma_{\theta \theta} & \sigma_{\theta \phi} \\ & & \sigma_{\phi \phi}\end{array}\right]\]Tutorial case in which it is used:
solids/linearElasticity/pressurisedCylinder
solids/thermoelasticity/hotCylinder/hotCylinder
solids/multiMaterial/layeredPipe