50 elasticityMotionSolver,
65 if (isA<fixedValuePointPatchVectorField>(pointBCs))
68 refCast<fixedValuePointPatchVectorField>(pointBCs);
69 fixedValueBCs == fixedValueBCs/scalar(
nSteps_);
81 if (isA<fixedValueFvPatchVectorField>(bField))
96 Foam::elasticityMotionSolver::elasticityMotionSolver
99 const IOdictionary&
dict 117 IOobject::READ_IF_PRESENT,
122 fixedValuePointPatchVectorField::typeName
131 IOobject::READ_IF_PRESENT,
136 pointMotionU_.boundaryField().types()
140 coeffDict().
found(
"interpolation")
141 ? motionInterpolation::
New(fvMesh_, coeffDict().lookup(
"interpolation"))
142 : motionInterpolation::
New(fvMesh_)
158 exponent_(this->coeffDict().
get<scalar>(
"exponent")),
159 nSteps_(this->coeffDict().
get<label>(
"steps")),
160 nIters_(this->coeffDict().
get<label>(
"iters")),
161 tolerance_(this->coeffDict().
get<scalar>(
"tolerance"))
178 cellMotionU_.primitiveFieldRef() = vector::zero;
182 setBoundaryConditions();
185 for (label istep = 0; istep < nSteps_; ++istep)
191 E_.primitiveFieldRef() = 1./
pow(vols, exponent_);
192 E_.correctBoundaryConditions();
194 for (label iter = 0; iter < nIters_; ++iter)
196 Info<<
"Iteration " << iter <<
endl;
197 cellMotionU_.storePrevIter();
205 scalar residual =
mag(dEqn.solve().initialResidual());
206 cellMotionU_.relax();
209 fvMesh_.time().printExecutionTime(
Info);
212 if (residual < tolerance_)
214 Info<<
"\n***Reached mesh movement convergence limit for step " 216 <<
" iteration " << iter <<
"***\n\n";
222 interpolationPtr_->interpolate(cellMotionU_, pointMotionU_);
225 mesh().
points() + pointMotionU_.primitiveFieldRef()
229 fvMesh_.movePoints(newPoints);
230 fvMesh_.checkMesh(
true);
234 Info<<
" Writing new mesh points " <<
endl;
240 mesh().pointsInstance(),
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const word zeroGradientType
A zeroGradient patch field type.
fvPatchField< vector > fvPatchVectorField
label nSteps_
Intermediate steps to solve the PDEs.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
vectorIOField pointIOField
pointIOField is a vectorIOField.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Type & refCast(U &obj)
A dynamic_cast (for references). Generates a FatalError on failed casts and uses the virtual type() m...
virtual void solve()
Solve for motion.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Calculate the matrix for the laplacian of the field.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
void setBoundaryConditions()
Set boundary conditions of cellMotionU based on pointMotionU.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
vectorField pointField
pointField is a vectorField.
static const Identity< scalar > I
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
virtual void updateMesh(const mapPolyMesh &)
Update the mesh corresponding to given map.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
void updateCoeffs()
Update the boundary condition coefficients.
Calculate the divergence of the given field.
pointVectorField pointMotionU_
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Calculate the matrix for the divergence of the given field and flux.
volVectorField cellMotionU_
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const std::string patch
OpenFOAM patch number as a std::string.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
const polyMesh & mesh() const
Return reference to mesh.
A class for managing temporary objects.
fvMesh & fvMesh_
Since the mesh deformation is broken down to multiple steps, mesh points need to be moved here...
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
const scalarField & cellVolumes() const
virtual tmp< pointField > curPoints() const
Return point location. Mesh is actually moved in solve()
static constexpr const zero Zero
Global zero (0)