Commit 5a816c45 authored by mattijs's avatar mattijs
Browse files

ENH: fvMotionSolvers: add fvOptions. Fixes #765.

parent 239c96bf
......@@ -9,5 +9,6 @@ EXE_INC = \
LIB_LIBS = \
-lmeshTools \
-ldynamicMesh \
-lfiniteVolume
-lfiniteVolume \
-lfvOptions
/*-lforces include in controlDict if needed */
......@@ -29,6 +29,7 @@ License
#include "fvmLaplacian.H"
#include "addToRunTimeSelectionTable.H"
#include "mapPolyMesh.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -231,6 +232,8 @@ void Foam::displacementComponentLaplacianFvMotionSolver::solve()
diffusivityPtr_->correct();
pointDisplacement_.boundaryFieldRef().updateCoeffs();
fv::options& fvOptions(fv::options::New(fvMesh_));
// We explicitly do NOT want to interpolate the motion inbetween
// different regions so bypass all the matrix manipulation.
fvScalarMatrix TEqn
......@@ -241,8 +244,12 @@ void Foam::displacementComponentLaplacianFvMotionSolver::solve()
cellDisplacement_,
"laplacian(diffusivity,cellDisplacement)"
)
==
fvOptions(cellDisplacement_)
);
fvOptions.constrain(TEqn);
TEqn.solveSegregatedOrCoupled(TEqn.solverDict());
}
......
......@@ -28,6 +28,7 @@ License
#include "motionDiffusivity.H"
#include "fvmLaplacian.H"
#include "addToRunTimeSelectionTable.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -129,6 +130,8 @@ void Foam::velocityComponentLaplacianFvMotionSolver::solve()
diffusivityPtr_->correct();
pointMotionU_.boundaryFieldRef().updateCoeffs();
fv::options& fvOptions(fv::options::New(fvMesh_));
// We explicitly do NOT want to interpolate the motion inbetween
// different regions so bypass all the matrix manipulation.
fvScalarMatrix TEqn
......@@ -139,8 +142,12 @@ void Foam::velocityComponentLaplacianFvMotionSolver::solve()
cellMotionU_,
"laplacian(diffusivity,cellMotionU)"
)
==
fvOptions(cellMotionU_)
);
fvOptions.constrain(TEqn);
TEqn.solveSegregatedOrCoupled(TEqn.solverDict());
}
......
......@@ -33,6 +33,7 @@ License
#include "surfaceInterpolate.H"
#include "fvcLaplacian.H"
#include "mapPolyMesh.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -186,6 +187,8 @@ void Foam::displacementSBRStressFvMotionSolver::solve()
volTensorField gradCd("gradCd", fvc::grad(cellDisplacement_));
fv::options& fvOptions(fv::options::New(fvMesh_));
fvVectorMatrix TEqn
(
fvm::laplacian
......@@ -233,8 +236,12 @@ void Foam::displacementSBRStressFvMotionSolver::solve()
)
)
*/
==
fvOptions(cellDisplacement_)
);
fvOptions.constrain(TEqn);
TEqn.solveSegregatedOrCoupled(TEqn.solverDict());
}
......
......@@ -31,6 +31,7 @@ License
#include "OFstream.H"
#include "meshTools.H"
#include "mapPolyMesh.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -333,6 +334,8 @@ void Foam::displacementLaplacianFvMotionSolver::solve()
diffusivity().correct();
pointDisplacement_.boundaryFieldRef().updateCoeffs();
fv::options& fvOptions(fv::options::New(fvMesh_));
// We explicitly do NOT want to interpolate the motion inbetween
// different regions so bypass all the matrix manipulation.
fvVectorMatrix TEqn
......@@ -343,8 +346,12 @@ void Foam::displacementLaplacianFvMotionSolver::solve()
cellDisplacement_,
"laplacian(diffusivity,cellDisplacement)"
)
==
fvOptions(cellDisplacement_)
);
fvOptions.constrain(TEqn);
TEqn.solveSegregatedOrCoupled(TEqn.solverDict());
}
......
......@@ -33,6 +33,7 @@ License
#include "mapPolyMesh.H"
#include "solidBodyMotionFunction.H"
#include "transformField.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -344,7 +345,9 @@ void Foam::solidBodyDisplacementLaplacianFvMotionSolver::solve()
diffusivity().correct();
pointDisplacement_.boundaryFieldRef().updateCoeffs();
Foam::solve
fv::options& fvOptions(fv::options::New(fvMesh_));
fvVectorMatrix TEqn
(
fvm::laplacian
(
......@@ -352,7 +355,13 @@ void Foam::solidBodyDisplacementLaplacianFvMotionSolver::solve()
cellDisplacement_,
"laplacian(diffusivity,cellDisplacement)"
)
==
fvOptions(cellDisplacement_)
);
fvOptions.constrain(TEqn);
TEqn.solveSegregatedOrCoupled(TEqn.solverDict());
}
......
......@@ -35,6 +35,7 @@ License
#include "pointMVCWeight.H"
#include "dimensionedSymmTensor.H"
#include "quaternion.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -383,6 +384,8 @@ void Foam::surfaceAlignedSBRStressFvMotionSolver::solve()
const surfaceScalarField Df(diffusivity().operator()());
pointDisplacement_.boundaryFieldRef().updateCoeffs();
fv::options& fvOptions(fv::options::New(fvMesh_));
const volTensorField gradCd(fvc::grad(cellDisp));
for (int nonOrth=0; nonOrth<=nNonOrthogonalCorr_; nonOrth++)
......@@ -407,8 +410,11 @@ void Foam::surfaceAlignedSBRStressFvMotionSolver::solve()
)
==
fvc::div(sigmaD_)
+ fvOptions(cellDisp)
);
fvOptions.constrain(DEqn);
// Note: solve uncoupled
DEqn.solveSegregatedOrCoupled(DEqn.solverDict());
}
......
......@@ -28,6 +28,7 @@ License
#include "motionDiffusivity.H"
#include "fvmLaplacian.H"
#include "addToRunTimeSelectionTable.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -124,6 +125,8 @@ void Foam::velocityLaplacianFvMotionSolver::solve()
diffusivityPtr_->correct();
pointMotionU_.boundaryFieldRef().updateCoeffs();
fv::options& fvOptions(fv::options::New(fvMesh_));
fvVectorMatrix UEqn
(
fvm::laplacian
......@@ -132,8 +135,12 @@ void Foam::velocityLaplacianFvMotionSolver::solve()
cellMotionU_,
"laplacian(diffusivity,cellMotionU)"
)
==
fvOptions(cellMotionU_)
);
fvOptions.constrain(UEqn);
UEqn.solveSegregatedOrCoupled(UEqn.solverDict());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment