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.
This commit is contained in:
Henry
2015-05-29 23:35:43 +01:00
parent ec6ad11cbd
commit c3ee2348a6
146 changed files with 443 additions and 882 deletions

View File

@ -1,9 +1,11 @@
// Solve the Momentum equation
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
fvm::ddt(U) + fvm::div(phi, U)
+ MRF.DDt(U)
+ turbulence->divDevReff(U)
==
fvOptions(U)

View File

@ -15,7 +15,7 @@ surfaceScalarField phiHbyA
+ rAUf*fvc::ddtCorr(U, phi)
);
fvOptions.makeRelative(phiHbyA);
MRF.makeRelative(phiHbyA);
adjustPhi(phiHbyA, U, p);
@ -25,7 +25,7 @@ setSnGrad<fixedFluxPressureFvPatchScalarField>
p.boundaryField(),
(
phiHbyA.boundaryField()
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
- MRF.relative(mesh.Sf().boundaryField() & U.boundaryField())
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
);

View File

@ -15,6 +15,8 @@ surfaceScalarField phiHbyA
+ rAUf*fvc::ddtCorr(U, Uf)
);
MRF.makeRelative(phiHbyA);
if (p.needReference())
{
fvc::makeRelative(phiHbyA, U);
@ -22,6 +24,17 @@ if (p.needReference())
fvc::makeAbsolute(phiHbyA, U);
}
// Update the fixedFluxPressure BCs to ensure flux consistency
setSnGrad<fixedFluxPressureFvPatchScalarField>
(
p.boundaryField(),
(
phiHbyA.boundaryField()
- MRF.relative(mesh.Sf().boundaryField() & U.boundaryField())
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
);
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn

View File

@ -39,6 +39,7 @@ Description
#include "pimpleControl.H"
#include "CorrectPhi.H"
#include "fvIOoptionList.H"
#include "fixedFluxPressureFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,6 +54,7 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "createUf.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "readTimeControls.H"
#include "CourantNo.H"

View File

@ -39,8 +39,6 @@ Description
#include "turbulentTransportModel.H"
#include "pimpleControl.H"
#include "fvIOoptionList.H"
#include "IOporosityModelList.H"
#include "IOMRFZoneList.H"
#include "fixedFluxPressureFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,6 +52,7 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"

View File

@ -1,8 +1,11 @@
// Momentum predictor
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
+ MRF.DDt(U)
+ turbulence->divDevReff(U)
==
fvOptions(U)

View File

@ -4,7 +4,7 @@
HbyA = rAU*UEqn().H();
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf());
fvOptions.makeRelative(phiHbyA);
MRF.makeRelative(phiHbyA);
adjustPhi(phiHbyA, U, p);
tmp<volScalarField> rAtU(rAU);

View File

@ -1,5 +1,7 @@
// Construct the Momentum equation
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)

View File

@ -1,6 +1,3 @@
IOMRFZoneList MRF(mesh);
MRF.correctBoundaryVelocity(U);
IOporosityModelList pZones(mesh);
Switch pressureImplicitPorosity(false);

View File

@ -35,7 +35,6 @@ Description
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "simpleControl.H"
#include "IOMRFZoneList.H"
#include "IOporosityModelList.H"
#include "fvIOoptionList.H"
@ -50,8 +49,9 @@ int main(int argc, char *argv[])
simpleControl simple(mesh);
#include "createFields.H"
#include "createMRF.H"
#include "createPorousZones.H"
#include "createFvOptions.H"
#include "createZones.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -46,6 +46,7 @@ int main(int argc, char *argv[])
simpleControl simple(mesh);
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"