Commit 2b9a2adf authored by Henry's avatar Henry
Browse files

MRF: Separate MRF from fvOptions

fvOptions does not have the appropriate structure to support MRF as it
is based on option selection by user-specified fields whereas MRF MUST
be applied to all velocity fields in the particular solver.  A
consequence of the particular design choices in fvOptions made it
difficult to support MRF for multiphase and it is easier to support
frame-related and field related options separately.

Currently the MRF functionality provided supports only rotations but
the structure will be generalized to support other frame motions
including linear acceleration, SRF rotation and 6DoF which will be
run-time selectable.
parent 4192e0bc
......@@ -80,6 +80,7 @@ int main(int argc, char *argv[])
pisoControl potentialFlow(mesh, "potentialFlow");
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -90,8 +91,7 @@ int main(int argc, char *argv[])
// function objects so do it ourselves
runTime.functionObjects().start();
fvOptions.makeRelative(phi);
MRF.makeRelative(phi);
adjustPhi(phi, U, p);
// Non-orthogonal velocity potential corrector loop
......@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
}
}
fvOptions.makeAbsolute(phi);
MRF.makeAbsolute(phi);
Info<< "Continuity error = "
<< mag(fvc::div(phi))().weightedAverage(mesh.V()).value()
......
......@@ -92,6 +92,7 @@ int main(int argc, char *argv[])
#include "readCombustionProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createMRF.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
......
MRF.correctBoundaryVelocity(U);
fvVectorMatrix UEqn
(
betav*fvm::ddt(rho, U)
+ fvm::div(phi, U)
betav*fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
betav*rho*g
......
MRF.correctBoundaryVelocity(U);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
rho*g
......
......@@ -72,6 +72,7 @@ int main(int argc, char *argv[])
#include "readCombustionProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
......
......@@ -18,7 +18,7 @@ if (pimple.transonic())
)
);
fvOptions.makeRelative(fvc::interpolate(psi), phid);
MRF.makeRelative(fvc::interpolate(psi), phid);
while (pimple.correctNonOrthogonal())
{
......@@ -50,7 +50,7 @@ else
)
);
fvOptions.makeRelative(phiHbyA);
MRF.makeRelative(phiHbyA);
while (pimple.correctNonOrthogonal())
{
......
......@@ -50,6 +50,7 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "createRhoUf.H"
#include "initContinuityErrs.H"
......
......@@ -74,6 +74,7 @@ int main(int argc, char *argv[])
#include "readCombustionProperties.H"
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "createRhoUf.H"
#include "initContinuityErrs.H"
......
......@@ -21,7 +21,7 @@ if (pimple.transonic())
);
fvc::makeRelative(phid, psi, U);
fvOptions.makeRelative(fvc::interpolate(psi), phid);
MRF.makeRelative(fvc::interpolate(psi), phid);
while (pimple.correctNonOrthogonal())
{
......@@ -54,7 +54,7 @@ else
);
fvc::makeRelative(phiHbyA, rho, U);
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
while (pimple.correctNonOrthogonal())
{
......
MRF.correctBoundaryVelocity(U);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
parcels.SU(U)
......
......@@ -55,6 +55,7 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "createClouds.H"
#include "createSurfaceFilmModel.H"
......
......@@ -18,7 +18,7 @@ surfaceScalarField phiHbyA
+ phig
);
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the fixedFluxPressure BCs to ensure flux consistency
setSnGrad<fixedFluxPressureFvPatchScalarField>
......@@ -26,7 +26,7 @@ setSnGrad<fixedFluxPressureFvPatchScalarField>
p_rgh.boundaryField(),
(
phiHbyA.boundaryField()
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
- MRF.relative(mesh.Sf().boundaryField() & U.boundaryField())
*rho.boundaryField()
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
);
......
......@@ -50,6 +50,7 @@ int main(int argc, char *argv[])
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
......
MRF.correctBoundaryVelocity(U);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
rho*g
......
......@@ -18,7 +18,7 @@ if (pimple.transonic())
)
);
fvOptions.makeRelative(fvc::interpolate(psi), phid);
MRF.makeRelative(fvc::interpolate(psi), phid);
while (pimple.correctNonOrthogonal())
{
......@@ -50,7 +50,7 @@ else
)
);
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
while (pimple.correctNonOrthogonal())
{
......
......@@ -48,6 +48,7 @@ int main(int argc, char *argv[])
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
......
MRF.correctBoundaryVelocity(U);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
fvOptions(rho, U)
......
......@@ -23,7 +23,7 @@
+ phig
);
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the fixedFluxPressure BCs to ensure flux consistency
setSnGrad<fixedFluxPressureFvPatchScalarField>
......@@ -31,7 +31,7 @@
p_rgh.boundaryField(),
(
phiHbyA.boundaryField()
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
- MRF.relative(mesh.Sf().boundaryField() & U.boundaryField())
*rho.boundaryField()
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
);
......
......@@ -49,6 +49,7 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
......
......@@ -22,7 +22,7 @@
)
);
fvOptions.makeRelative(phiHbyA);
MRF.makeRelative(phiHbyA);
surfaceScalarField phid("phid", fvc::interpolate(thermo.psi())*phiHbyA);
......@@ -63,7 +63,7 @@
)
);
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
fvScalarMatrix pDDtEqn
(
......
Supports Markdown
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