Commit 5ec46af7 authored by andy's avatar andy
Browse files

ENH: Solver updates for fvOptions usage

parent 65624412
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
( (
fvm::div(phi, U) fvm::div(phi, U)
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
==
fvOptions(rho, U)
); );
UEqn().relax(); UEqn().relax();
mrfZones.addCoriolis(rho, UEqn());
// Include the porous media resistance and solve the momentum equation // Include the porous media resistance and solve the momentum equation
// either implicit in the tensorial resistance or transport using by // either implicit in the tensorial resistance or transport using by
// including the spherical part of the resistance in the momentum diagonal // including the spherical part of the resistance in the momentum diagonal
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
for (int UCorr=0; UCorr<nUCorr; UCorr++) for (int UCorr=0; UCorr<nUCorr; UCorr++)
{ {
U = trTU() & ((UEqn() == fvOptions(rho, U))().H() - gradp); U = trTU() & (UEqn().H() - gradp);
} }
U.correctBoundaryConditions(); U.correctBoundaryConditions();
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
fvOptions.constrain(UEqn()); fvOptions.constrain(UEqn());
solve(UEqn() == -fvc::grad(p) + fvOptions(rho, U)); solve(UEqn() == -fvc::grad(p));
fvOptions.correct(U); fvOptions.correct(U);
......
IOMRFZoneList mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U);
IOporosityModelList pZones(mesh); IOporosityModelList pZones(mesh);
Switch pressureImplicitPorosity(false); Switch pressureImplicitPorosity(false);
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
if (pressureImplicitPorosity) if (pressureImplicitPorosity)
{ {
HbyA = trTU() & (UEqn() == fvOptions(rho, U))().H(); HbyA = trTU() & UEqn().H();
} }
else else
{ {
HbyA = trAU()*(UEqn() == fvOptions(rho, U))().H(); HbyA = trAU()*UEqn().H();
} }
UEqn.clear(); UEqn.clear();
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
fvc::interpolate(rho*HbyA) & mesh.Sf() fvc::interpolate(rho*HbyA) & mesh.Sf()
); );
mrfZones.relativeFlux(fvc::interpolate(rho), phiHbyA); fvOptions.relativeFlux(fvc::interpolate(rho), phiHbyA);
closedVolume = adjustPhi(phiHbyA, U, p); closedVolume = adjustPhi(phiHbyA, U, p);
......
...@@ -27,14 +27,13 @@ Application ...@@ -27,14 +27,13 @@ Application
Description Description
Steady-state solver for turbulent flow of compressible fluids with Steady-state solver for turbulent flow of compressible fluids with
RANS turbulence modelling, implicit or explicit porosity treatment RANS turbulence modelling, implicit or explicit porosity treatment
and MRF for HVAC and similar applications. and run-time selectable finite volume sources.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "rhoThermo.H" #include "rhoThermo.H"
#include "RASModel.H" #include "RASModel.H"
#include "IOMRFZoneList.H"
#include "fvIOoptionList.H" #include "fvIOoptionList.H"
#include "IOporosityModelList.H" #include "IOporosityModelList.H"
#include "simpleControl.H" #include "simpleControl.H"
......
...@@ -7,7 +7,7 @@ volScalarField rAU(1.0/UEqn().A()); ...@@ -7,7 +7,7 @@ volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1())); volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == fvOptions(rho, U))().H(); HbyA = rAU*UEqn().H();
UEqn.clear(); UEqn.clear();
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
+ fvm::div(phi, Urel) + fvm::div(phi, Urel)
+ turbulence->divDevReff(Urel) + turbulence->divDevReff(Urel)
+ SRF->Su() + SRF->Su()
==
fvOptions(Urel)
); );
UrelEqn().relax(); UrelEqn().relax();
fvOptions.constrain(UrelEqn()); fvOptions.constrain(UrelEqn());
solve(UrelEqn() == -fvc::grad(p) + fvOptions(Urel)); solve(UrelEqn() == -fvc::grad(p));
fvOptions.correct(Urel); fvOptions.correct(Urel);
volScalarField rAUrel(1.0/UrelEqn().A()); volScalarField rAUrel(1.0/UrelEqn().A());
volVectorField HbyA("HbyA", Urel); volVectorField HbyA("HbyA", Urel);
HbyA = rAUrel*(UrelEqn() == fvOptions(Urel))().H(); HbyA = rAUrel*UrelEqn().H();
if (pimple.nCorrPISO() <= 1) if (pimple.nCorrPISO() <= 1)
{ {
......
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == fvOptions(U))().H(); HbyA = rAU*UEqn().H();
if (pimple.nCorrPISO() <= 1) if (pimple.nCorrPISO() <= 1)
{ {
......
...@@ -3,6 +3,8 @@ tmp<fvVectorMatrix> UEqn ...@@ -3,6 +3,8 @@ tmp<fvVectorMatrix> UEqn
fvm::ddt(U) fvm::ddt(U)
+ fvm::div(phi, U) + fvm::div(phi, U)
+ turbulence->divDevReff(U) + turbulence->divDevReff(U)
==
fvOptions(U)
); );
...@@ -12,7 +14,7 @@ fvOptions.constrain(UEqn()); ...@@ -12,7 +14,7 @@ fvOptions.constrain(UEqn());
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
solve(UEqn() == -fvc::grad(p_gh) + fvOptions(U)); solve(UEqn() == -fvc::grad(p_gh));
fvOptions.correct(U); fvOptions.correct(U);
} }
...@@ -2,7 +2,7 @@ volScalarField rAU(1.0/UEqn().A()); ...@@ -2,7 +2,7 @@ volScalarField rAU(1.0/UEqn().A());
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == fvOptions(U))().H(); HbyA = rAU*UEqn().H();
if (pimple.nCorrPISO() <= 1) if (pimple.nCorrPISO() <= 1)
{ {
...@@ -18,6 +18,7 @@ surfaceScalarField phiHbyA ...@@ -18,6 +18,7 @@ surfaceScalarField phiHbyA
adjustPhi(phiHbyA, U, p_gh); adjustPhi(phiHbyA, U, p_gh);
fvOptions.relativeFlux(phiHbyA);
// Non-orthogonal pressure corrector loop // Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
......
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