Commit b5d1ab43 authored by andy's avatar andy
Browse files

ENH: Updated solver run-time selectable sources

parent cf6956f1
......@@ -29,7 +29,7 @@ if (pimple.transonic())
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......@@ -64,7 +64,7 @@ else
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......
......@@ -26,7 +26,7 @@ if (pimple.transonic())
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......@@ -58,7 +58,7 @@ else
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......
......@@ -37,7 +37,7 @@ while (pimple.correctNonOrthogonal())
+ sources(psi, p_rgh, rho.name())
);
sources.constrain(p_rghEqn, rho.name());
sources.constrain(p_rghEqn);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
......
......@@ -29,7 +29,7 @@ if (pimple.transonic())
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......@@ -64,7 +64,7 @@ else
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......
......@@ -40,7 +40,7 @@
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......@@ -80,7 +80,7 @@
- fvm::laplacian(rho*rAU, p)
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......
......@@ -39,7 +39,7 @@ if (pimple.transonic())
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......@@ -77,7 +77,7 @@ else
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......
......@@ -51,7 +51,7 @@ if (pimple.transonic())
// Relax the pressure equation to maintain diagonal dominance
pEqn.relax();
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve();
......@@ -89,7 +89,7 @@ else
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve();
......
......@@ -35,7 +35,7 @@
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.setReference(pRefCell, pRefValue);
......@@ -71,7 +71,7 @@
pEqn.setReference(pRefCell, pRefValue);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve();
......
......@@ -45,7 +45,7 @@ if (simple.transonic())
// Relax the pressure equation to maintain diagonal dominance
pEqn.relax();
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.setReference(pRefCell, pRefValue);
......@@ -82,7 +82,7 @@ else
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.setReference(pRefCell, pRefValue);
......
......@@ -42,7 +42,7 @@
- fvm::laplacian(rhorAUf, p_rgh)
);
sources.constrain(p_rghEqn, rho.name());
sources.constrain(p_rghEqn);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
......
......@@ -7,6 +7,7 @@
rho.dimensionedInternalField()*g
+ coalParcels.SU(U)
+ limestoneParcels.SU(U)
+ sources(rho, U)
);
UEqn.relax();
......@@ -15,6 +16,6 @@
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p) + sources(rho, U));
solve(UEqn == -fvc::grad(p));
K = 0.5*magSqr(U);
}
......@@ -2,7 +2,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn == sources(rho, U))().H();
HbyA = rAU*UEqn.H();
if (pimple.transonic())
{
......@@ -16,6 +16,8 @@ if (pimple.transonic())
)
);
sources.relativeFlux(fvc::interpolate(psi), phid);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
......@@ -28,7 +30,7 @@ if (pimple.transonic())
+ sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......@@ -50,6 +52,8 @@ else
)
);
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
......@@ -62,7 +66,7 @@ else
+ sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
sources.constrain(pEqn);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......
......@@ -21,9 +21,11 @@
+ surfaceFilm.Sh()
+ radiation->Sh(thermo)
+ combustion->Sh()
+ sources(rho, he)
);
EEqn.relax();
sources.constrain(EEqn);
EEqn.solve();
thermo.correct();
......
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude \
-I${LIB_SRC}/sampling/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
......@@ -25,6 +27,8 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lfieldSources \
-lsampling \
-lmeshTools \
-lcompressibleRASModels \
-lcompressibleLESModels \
......
......@@ -5,10 +5,13 @@
+ turbulence->divDevRhoReff(U)
==
parcels.SU(U)
+ sources(rho, U)
);
UEqn.relax();
sources.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve
......
......@@ -22,18 +22,24 @@ tmp<fv::convectionScheme<scalar> > mvConvection
{
volScalarField& Yi = Y[i];
solve
fvScalarMatrix YEqn
(
fvm::ddt(rho, Yi)
+ mvConvection->fvmDiv(phi, Yi)
- fvm::laplacian(turbulence->alphaEff(), Yi)
==
parcels.SYi(i, Yi)
+ sources(rho, Yi)
+ combustion->R(Yi)
+ surfaceFilm.Srho(i)
+ combustion->R(Yi),
mesh.solver("Yi")
);
YEqn.relax();
sources.constrain(YEqn);
YEqn.solve(mesh.solver("Yi"));
Yi.max(0.0);
Yt += Yi;
}
......
......@@ -139,3 +139,5 @@
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
);
IObasicSourceList sources(mesh);
......@@ -18,6 +18,7 @@ surfaceScalarField phiHbyA
+ phig
);
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
while (pimple.correctNonOrthogonal())
{
......@@ -30,8 +31,11 @@ while (pimple.correctNonOrthogonal())
==
parcels.Srho()
+ surfaceFilm.Srho()
+ sources(psi, p_rgh, rho.name())
);
sources.constrain(p_rghEqn);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
......@@ -39,6 +43,7 @@ while (pimple.correctNonOrthogonal())
phi = phiHbyA + p_rghEqn.flux();
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
U.correctBoundaryConditions();
sources.correct(U);
}
}
......
......@@ -37,6 +37,7 @@ Description
#include "psiCombustionModel.H"
#include "radiationModel.H"
#include "SLGThermo.H"
#include "IObasicSourceList.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -37,6 +37,7 @@ Description
==
parcels.Srho(rho)
+ surfaceFilm.Srho()
+ sources(rho)
);
}
......
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