ENH: MRF: Added support for mesh refinement/unrefinement and other topology changes

This commit is contained in:
Henry Weller
2017-08-18 22:22:47 +01:00
committed by Andrew Heather
parent c06f716555
commit be9d388a68
11 changed files with 176 additions and 129 deletions

View File

@ -110,23 +110,28 @@ int main(int argc, char *argv[])
// Do any mesh changes
mesh.update();
if (mesh.changing() && correctPhi)
if (mesh.changing())
{
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & rhoUf;
MRF.update();
#include "correctPhi.H"
if (correctPhi)
{
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & rhoUf;
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U);
#include "correctPhi.H"
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U);
}
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
}
if (mesh.changing() && checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
#include "rhoEqn.H"
Info<< "rhoEqn max/min : " << max(rho).value()
<< " " << min(rho).value() << endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -92,21 +92,26 @@ int main(int argc, char *argv[])
// Do any mesh changes
mesh.update();
if (mesh.changing() && correctPhi)
if (mesh.changing())
{
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & rhoUf;
MRF.update();
#include "correctPhi.H"
if (correctPhi)
{
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & rhoUf;
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U);
#include "correctPhi.H"
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U);
}
}
}
if (mesh.changing() && checkMeshCourantNo)
{
#include "meshCourantNo.H"
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
#include "rhoEqn.H"