OpenFOAM: Updated all libraries, solvers and utilities to use the new const-safe tmp

The deprecated non-const tmp functionality is now on the compiler switch
NON_CONST_TMP which can be enabled by adding -DNON_CONST_TMP to EXE_INC
in the Make/options file.  However, it is recommended to upgrade all
code to the new safer tmp by using the '.ref()' member function rather
than the non-const '()' dereference operator when non-const access to
the temporary object is required.

Please report any problems on Mantis.

Henry G. Weller
CFD Direct.
This commit is contained in:
Henry Weller
2016-02-26 17:31:28 +00:00
parent f4ba71ddd0
commit cd852be3da
169 changed files with 511 additions and 477 deletions

View File

@ -70,7 +70,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::G() const
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
tmp<volScalarField> tGtot = XiGModel_->G();
volScalarField& Gtot = tGtot();
volScalarField& Gtot = tGtot.ref();
const scalarField Cw = pow(Su_.mesh().V(), 2.0/3.0);
scalarField N(Nv.internalField()*Cw);

View File

@ -113,7 +113,7 @@ Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
)
);
volSymmTensorField& DragDcu = tDragDcu();
volSymmTensorField& DragDcu = tDragDcu.ref();
if (on_)
{
@ -147,7 +147,7 @@ Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
)
);
volScalarField& Gk = tGk();
volScalarField& Gk = tGk.ref();
if (on_)
{

View File

@ -161,9 +161,9 @@ void PDRkEpsilon::correct()
- fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_)
);
epsEqn().relax();
epsEqn.ref().relax();
epsEqn().boundaryManipulate(epsilon_.boundaryField());
epsEqn.ref().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilonMin_);
@ -182,7 +182,7 @@ void PDRkEpsilon::correct()
- fvm::Sp(betav*rho_*epsilon_/k_, k_)
);
kEqn().relax();
kEqn.ref().relax();
solve(kEqn);
bound(k_, kMin_);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -108,7 +108,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
dimensionedScalar("XiEq", dimless, 0.0)
)
);
volScalarField& xieq = tXiEq();
volScalarField& xieq = tXiEq.ref();
forAll(xieq, celli)
{

View File

@ -113,7 +113,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
dimensionedScalar("zero", Nv.dimensions(), 0.0)
)
);
volScalarField& N = tN();
volScalarField& N = tN.ref();
N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
volSymmTensorField ns

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -259,7 +259,7 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
)
);
volScalarField& Su0 = tSu0();
volScalarField& Su0 = tSu0.ref();
forAll(Su0, celli)
{
@ -306,7 +306,7 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
)
);
volScalarField& Su0 = tSu0();
volScalarField& Su0 = tSu0.ref();
forAll(Su0, celli)
{
@ -358,7 +358,7 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Ma
)
);
volScalarField& ma = tMa();
volScalarField& ma = tMa.ref();
forAll(ma, celli)
{

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
@ -10,14 +10,15 @@ tmp<fvVectorMatrix> UEqn
==
fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);
K = 0.5*magSqr(U);

View File

@ -3,13 +3,13 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A());
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
tUEqn.clear();
}
if (pimple.transonic())

View File

@ -3,13 +3,13 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
volScalarField rAU(1.0/UEqn.A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
tUEqn.clear();
}
if (pimple.transonic())

View File

@ -5,9 +5,9 @@
// pressure solution - done in 2 parts. Part 1:
thermo.rho() -= psi*p;
volScalarField rAU(1.0/UEqn().A());
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
if (pimple.transonic())
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
{
volScalarField& rDeltaT = trDeltaT();
volScalarField& rDeltaT = trDeltaT.ref();
const dictionary& pimpleDict = pimple.dict();

View File

@ -22,7 +22,7 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> interpolate
)
);
GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf();
GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf.ref();
sf.rename(vf.name() + '_' + dir.name());

View File

@ -1,5 +1,5 @@
{
volScalarField& rDeltaT = trDeltaT();
volScalarField& rDeltaT = trDeltaT.ref();
scalar rDeltaTSmoothingCoeff
(

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
@ -10,14 +10,15 @@ tmp<fvVectorMatrix> UEqn
==
fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);
K = 0.5*magSqr(U);

View File

@ -3,13 +3,13 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A());
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
tUEqn.clear();
}
if (pimple.transonic())

View File

@ -3,13 +3,13 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
volScalarField rAU(1.0/UEqn.A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
tUEqn.clear();
}
if (pimple.transonic())

View File

@ -3,13 +3,13 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A());
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
tUEqn.clear();
}
if (pimple.transonic())

View File

@ -1,5 +1,5 @@
{
volScalarField& rDeltaT = trDeltaT();
volScalarField& rDeltaT = trDeltaT.ref();
const dictionary& pimpleDict = pimple.dict();

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ MRF.DDt(rho, U)
@ -10,11 +10,12 @@
==
fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
solve(UEqn() == -fvc::grad(p));
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);

View File

@ -1,8 +1,8 @@
{
volScalarField rAU(1.0/UEqn().A());
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
UEqn.clear();
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
tUEqn.clear();
bool closedVolume = false;

View File

@ -1,7 +1,7 @@
volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
UEqn.clear();
volScalarField rAU(1.0/UEqn.A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
tUEqn.clear();
bool closedVolume = false;

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ MRF.DDt(rho, U)
@ -10,8 +10,9 @@
==
fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
// Include the porous media resistance and solve the momentum equation
// either implicit in the tensorial resistance or transport using by
@ -22,18 +23,18 @@
if (pressureImplicitPorosity)
{
tmp<volTensorField> tTU = tensor(I)*UEqn().A();
pZones.addResistance(UEqn(), tTU());
tmp<volTensorField> tTU = tensor(I)*UEqn.A();
pZones.addResistance(UEqn, tTU.ref());
trTU = inv(tTU());
trTU().rename("rAU");
trTU.ref().rename("rAU");
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
volVectorField gradp(fvc::grad(p));
for (int UCorr=0; UCorr<nUCorr; UCorr++)
{
U = trTU() & (UEqn().H() - gradp);
U = trTU() & (UEqn.H() - gradp);
}
U.correctBoundaryConditions();
@ -41,14 +42,14 @@
}
else
{
pZones.addResistance(UEqn());
pZones.addResistance(UEqn);
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
solve(UEqn() == -fvc::grad(p));
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);
trAU = 1.0/UEqn().A();
trAU().rename("rAU");
trAU = 1.0/UEqn.A();
trAU.ref().rename("rAU");
}

View File

@ -4,15 +4,15 @@
tmp<volVectorField> tHbyA;
if (pressureImplicitPorosity)
{
tHbyA = constrainHbyA(trTU()&UEqn().H(), U, p);
tHbyA = constrainHbyA(trTU()&UEqn.H(), U, p);
}
else
{
tHbyA = constrainHbyA(trAU()*UEqn().H(), U, p);
tHbyA = constrainHbyA(trAU()*UEqn.H(), U, p);
}
volVectorField& HbyA = tHbyA();
volVectorField& HbyA = tHbyA.ref();
UEqn.clear();
tUEqn.clear();
bool closedVolume = false;
@ -51,13 +51,15 @@
);
}
tpEqn().setReference(pRefCell, pRefValue);
fvScalarMatrix& pEqn = tpEqn.ref();
tpEqn().solve();
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (simple.finalNonOrthogonalIter())
{
phi = phiHbyA - tpEqn().flux();
phi = phiHbyA - pEqn.flux();
}
}

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ MRF.DDt(U)
@ -10,16 +10,17 @@
==
fvOptions(U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
if (simple.momentumPredictor())
{
solve
(
UEqn()
UEqn
==
fvc::reconstruct
(

View File

@ -1,9 +1,9 @@
{
volScalarField rAU("rAU", 1.0/UEqn().A());
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p_rgh));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
UEqn.clear();
tUEqn.clear();
surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ MRF.DDt(rho, U)
@ -10,16 +10,17 @@
==
fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
if (simple.momentumPredictor())
{
solve
(
UEqn()
UEqn
==
fvc::reconstruct
(

View File

@ -2,10 +2,10 @@
rho = thermo.rho();
rho.relax();
volScalarField rAU("rAU", 1.0/UEqn().A());
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p_rgh));
UEqn.clear();
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
tUEqn.clear();
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ MRF.DDt(rho, U)
@ -10,14 +10,15 @@
==
fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
solve
(
UEqn()
UEqn
==
fvc::reconstruct
(

View File

@ -4,10 +4,10 @@
rho = min(rho, rhoMax[i]);
rho.relax();
volScalarField rAU("rAU", 1.0/UEqn().A());
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p_rgh));
UEqn.clear();
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
tUEqn.clear();
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
@ -10,16 +10,17 @@
==
fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
if (momentumPredictor)
{
solve
(
UEqn()
UEqn
==
fvc::reconstruct
(

View File

@ -5,9 +5,9 @@
rho = thermo.rho();
volScalarField rAU("rAU", 1.0/UEqn().A());
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p_rgh));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());

View File

@ -6,7 +6,7 @@ if (finalIter)
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
tmp<fvScalarMatrix> hEqn
fvScalarMatrix hEqn
(
fvm::ddt(betav*rho, h)
- (
@ -18,11 +18,11 @@ if (finalIter)
fvOptions(rho, h)
);
hEqn().relax();
hEqn.relax();
fvOptions.constrain(hEqn());
fvOptions.constrain(hEqn);
hEqn().solve(mesh.solver(h.select(finalIter)));
hEqn.solve(mesh.solver(h.select(finalIter)));
fvOptions.correct(h);
}

View File

@ -107,7 +107,7 @@ int main(int argc, char *argv[])
{
// Momentum predictor
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ turbulence->divDevReff(U)
@ -115,18 +115,19 @@ int main(int argc, char *argv[])
==
fvOptions(U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
solve(UEqn() == -fvc::grad(p));
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);
volScalarField rAU(1.0/UEqn().A());
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
UEqn.clear();
volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
tUEqn.clear();
surfaceScalarField phiHbyA
(
"phiHbyA",
@ -180,7 +181,7 @@ int main(int argc, char *argv[])
zeroCells(adjointTransposeConvection, inletCells);
tmp<fvVectorMatrix> UaEqn
tmp<fvVectorMatrix> tUaEqn
(
fvm::div(-phi, Ua)
- adjointTransposeConvection
@ -189,19 +190,20 @@ int main(int argc, char *argv[])
==
fvOptions(Ua)
);
fvVectorMatrix& UaEqn = tUaEqn.ref();
UaEqn().relax();
UaEqn.relax();
fvOptions.constrain(UaEqn());
fvOptions.constrain(UaEqn);
solve(UaEqn() == -fvc::grad(pa));
solve(UaEqn == -fvc::grad(pa));
fvOptions.correct(Ua);
volScalarField rAUa(1.0/UaEqn().A());
volScalarField rAUa(1.0/UaEqn.A());
volVectorField HbyAa("HbyAa", Ua);
HbyAa = rAUa*UaEqn().H();
UaEqn.clear();
HbyAa = rAUa*UaEqn.H();
tUaEqn.clear();
surfaceScalarField phiHbyAa
(
"phiHbyAa",

View File

@ -1,5 +1,5 @@
// Relative momentum predictor
tmp<fvVectorMatrix> UrelEqn
tmp<fvVectorMatrix> tUrelEqn
(
fvm::ddt(Urel)
+ fvm::div(phi, Urel)
@ -8,11 +8,12 @@
==
fvOptions(Urel)
);
fvVectorMatrix& UrelEqn = tUrelEqn.ref();
UrelEqn().relax();
UrelEqn.relax();
fvOptions.constrain(UrelEqn());
fvOptions.constrain(UrelEqn);
solve(UrelEqn() == -fvc::grad(p));
solve(UrelEqn == -fvc::grad(p));
fvOptions.correct(Urel);

View File

@ -1,6 +1,6 @@
volScalarField rAUrel(1.0/UrelEqn().A());
volScalarField rAUrel(1.0/UrelEqn.A());
volVectorField HbyA("HbyA", Urel);
HbyA = rAUrel*UrelEqn().H();
HbyA = rAUrel*UrelEqn.H();
surfaceScalarField phiHbyA
(
@ -15,7 +15,7 @@ tmp<volScalarField> rAtUrel(rAUrel);
if (pimple.consistent())
{
rAtUrel = 1.0/max(1.0/rAUrel - UrelEqn().H1(), 0.1/rAUrel);
rAtUrel = 1.0/max(1.0/rAUrel - UrelEqn.H1(), 0.1/rAUrel);
phiHbyA +=
fvc::interpolate(rAtUrel() - rAUrel)*fvc::snGrad(p)*mesh.magSf();
HbyA -= (rAUrel - rAtUrel())*fvc::grad(p);
@ -23,7 +23,7 @@ if (pimple.consistent())
if (pimple.nCorrPISO() <= 1)
{
UrelEqn.clear();
tUrelEqn.clear();
}
// Update the pressure BCs to ensure flux consistency

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::ddt(U) + fvm::div(phi, U)
+ MRF.DDt(U)
@ -10,14 +10,15 @@ tmp<fvVectorMatrix> UEqn
==
fvOptions(U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);
}

View File

@ -1,5 +1,5 @@
volScalarField rAU(1.0/UEqn().A());
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
surfaceScalarField phiHbyA
(
"phiHbyA",
@ -15,7 +15,7 @@ tmp<volScalarField> rAtU(rAU);
if (pimple.consistent())
{
rAtU = 1.0/max(1.0/rAU - UEqn().H1(), 0.1/rAU);
rAtU = 1.0/max(1.0/rAU - UEqn.H1(), 0.1/rAU);
phiHbyA +=
fvc::interpolate(rAtU() - rAU)*fvc::snGrad(p)*mesh.magSf();
HbyA -= (rAU - rAtU())*fvc::grad(p);
@ -23,7 +23,7 @@ if (pimple.consistent())
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
tUEqn.clear();
}
// Update the pressure BCs to ensure flux consistency

View File

@ -1,5 +1,5 @@
volScalarField rAU(1.0/UEqn().A());
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
surfaceScalarField phiHbyA
(
"phiHbyA",
@ -20,7 +20,7 @@ tmp<volScalarField> rAtU(rAU);
if (pimple.consistent())
{
rAtU = 1.0/max(1.0/rAU - UEqn().H1(), 0.1/rAU);
rAtU = 1.0/max(1.0/rAU - UEqn.H1(), 0.1/rAU);
phiHbyA +=
fvc::interpolate(rAtU() - rAU)*fvc::snGrad(p)*mesh.magSf();
HbyA -= (rAU - rAtU())*fvc::grad(p);
@ -28,7 +28,7 @@ if (pimple.consistent())
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
tUEqn.clear();
}
// Update the pressure BCs to ensure flux consistency

View File

@ -1,6 +1,6 @@
// Relative momentum predictor
tmp<fvVectorMatrix> UrelEqn
tmp<fvVectorMatrix> tUrelEqn
(
fvm::div(phi, Urel)
+ turbulence->divDevReff(Urel)
@ -8,11 +8,12 @@
==
fvOptions(Urel)
);
fvVectorMatrix& UrelEqn = tUrelEqn.ref();
UrelEqn().relax();
UrelEqn.relax();
fvOptions.constrain(UrelEqn());
fvOptions.constrain(UrelEqn);
solve(UrelEqn() == -fvc::grad(p));
solve(UrelEqn == -fvc::grad(p));
fvOptions.correct(Urel);

View File

@ -1,7 +1,7 @@
{
volScalarField rAUrel(1.0/UrelEqn().A());
volScalarField rAUrel(1.0/UrelEqn.A());
volVectorField HbyA("HbyA", Urel);
HbyA = rAUrel*UrelEqn().H();
HbyA = rAUrel*UrelEqn.H();
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf());
adjustPhi(phiHbyA, Urel, p);
@ -10,13 +10,13 @@
if (simple.consistent())
{
rAtUrel = 1.0/(1.0/rAUrel - UrelEqn().H1());
rAtUrel = 1.0/(1.0/rAUrel - UrelEqn.H1());
phiHbyA +=
fvc::interpolate(rAtUrel() - rAUrel)*fvc::snGrad(p)*mesh.magSf();
HbyA -= (rAUrel - rAtUrel())*fvc::grad(p);
}
UrelEqn.clear();
tUrelEqn.clear();
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, Urel, phiHbyA, rAtUrel());

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ MRF.DDt(U)
@ -10,11 +10,12 @@
==
fvOptions(U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
solve(UEqn() == -fvc::grad(p));
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);

View File

@ -1,6 +1,6 @@
{
volScalarField rAU(1.0/UEqn().A());
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf());
MRF.makeRelative(phiHbyA);
adjustPhi(phiHbyA, U, p);
@ -9,13 +9,13 @@
if (simple.consistent())
{
rAtU = 1.0/(1.0/rAU - UEqn().H1());
rAtU = 1.0/(1.0/rAU - UEqn.H1());
phiHbyA +=
fvc::interpolate(rAtU() - rAU)*fvc::snGrad(p)*mesh.magSf();
HbyA -= (rAU - rAtU())*fvc::grad(p);
}
UEqn.clear();
tUEqn.clear();
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, U, phiHbyA, rAtU(), MRF);

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ MRF.DDt(U)
@ -10,8 +10,9 @@
==
fvOptions(U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
// Include the porous media resistance and solve the momentum equation
// either implicit in the tensorial resistance or transport using by
@ -22,18 +23,18 @@
if (pressureImplicitPorosity)
{
tmp<volTensorField> tTU = tensor(I)*UEqn().A();
pZones.addResistance(UEqn(), tTU());
tmp<volTensorField> tTU = tensor(I)*UEqn.A();
pZones.addResistance(UEqn, tTU.ref());
trTU = inv(tTU());
trTU().rename("rAU");
trTU.ref().rename("rAU");
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
volVectorField gradp(fvc::grad(p));
for (int UCorr=0; UCorr<nUCorr; UCorr++)
{
U = trTU() & (UEqn().H() - gradp);
U = trTU() & (UEqn.H() - gradp);
}
U.correctBoundaryConditions();
@ -41,14 +42,14 @@
}
else
{
pZones.addResistance(UEqn());
pZones.addResistance(UEqn);
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
solve(UEqn() == -fvc::grad(p));
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);
trAU = 1.0/UEqn().A();
trAU().rename("rAU");
trAU = 1.0/UEqn.A();
trAU.ref().rename("rAU");
}

View File

@ -1,15 +1,15 @@
tmp<volVectorField> tHbyA;
if (pressureImplicitPorosity)
{
tHbyA = constrainHbyA(trTU()&UEqn().H(), U, p);
tHbyA = constrainHbyA(trTU()&UEqn.H(), U, p);
}
else
{
tHbyA = constrainHbyA(trAU()*UEqn().H(), U, p);
tHbyA = constrainHbyA(trAU()*UEqn.H(), U, p);
}
volVectorField& HbyA = tHbyA();
volVectorField& HbyA = tHbyA.ref();
UEqn.clear();
tUEqn.clear();
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf());
MRF.makeRelative(phiHbyA);
@ -29,13 +29,15 @@ while (simple.correctNonOrthogonal())
tpEqn = (fvm::laplacian(trAU(), p) == fvc::div(phiHbyA));
}
tpEqn().setReference(pRefCell, pRefValue);
fvScalarMatrix pEqn = tpEqn.ref();
tpEqn().solve();
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (simple.finalNonOrthogonalIter())
{
phi = phiHbyA - tpEqn().flux();
phi = phiHbyA - pEqn.flux();
}
}

View File

@ -1,4 +1,4 @@
EXE_INC = -DCONST_TMP \
EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
{
volScalarField& rDeltaT = trDeltaT();
volScalarField& rDeltaT = trDeltaT.ref();
const dictionary& pimpleDict = pimple.dict();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
{
volScalarField& rDeltaT = trDeltaT();
volScalarField& rDeltaT = trDeltaT.ref();
const dictionary& pimpleDict = pimple.dict();

View File

@ -1,6 +1,6 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ MRF.DDt(rho, U)
@ -10,11 +10,12 @@
+ parcels.SU(U)
+ fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
solve(UEqn() == -fvc::grad(p));
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);

View File

@ -3,10 +3,10 @@
// pressure solution - done in 2 parts. Part 1:
thermo.rho() -= psi*p;
volScalarField rAU(1.0/UEqn().A());
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
UEqn.clear();
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
tUEqn.clear();
surfaceScalarField phiHbyA
(
"phiHbyA",

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
@ -12,14 +12,15 @@ tmp<fvVectorMatrix> UEqn
+ parcels.SU(U)
+ fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);
K = 0.5*magSqr(U);

View File

@ -3,13 +3,13 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A());
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
tUEqn.clear();
}
if (pimple.transonic())

View File

@ -3,13 +3,13 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A());
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
tUEqn.clear();
}
if (pimple.transonic())

View File

@ -40,8 +40,8 @@
psi1*fvm::ddt(p_rgh)
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
);
deleteDemandDrivenData(p_rghEqnComp1().faceFluxCorrectionPtr());
p_rghEqnComp1().relax();
deleteDemandDrivenData(p_rghEqnComp1.ref().faceFluxCorrectionPtr());
p_rghEqnComp1.ref().relax();
p_rghEqnComp2 =
fvc::ddt(rho2) + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2)
@ -50,8 +50,8 @@
psi2*fvm::ddt(p_rgh)
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
);
deleteDemandDrivenData(p_rghEqnComp2().faceFluxCorrectionPtr());
p_rghEqnComp2().relax();
deleteDemandDrivenData(p_rghEqnComp2.ref().faceFluxCorrectionPtr());
p_rghEqnComp2.ref().relax();
}
else
{

View File

@ -37,8 +37,8 @@
psi1*fvm::ddt(p_rgh)
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
);
deleteDemandDrivenData(p_rghEqnComp1().faceFluxCorrectionPtr());
p_rghEqnComp1().relax();
deleteDemandDrivenData(p_rghEqnComp1.ref().faceFluxCorrectionPtr());
p_rghEqnComp1.ref().relax();
p_rghEqnComp2 =
fvc::ddt(rho2) + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2)
@ -47,8 +47,8 @@
psi2*fvm::ddt(p_rgh)
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
);
deleteDemandDrivenData(p_rghEqnComp2().faceFluxCorrectionPtr());
p_rghEqnComp2().relax();
deleteDemandDrivenData(p_rghEqnComp2.ref().faceFluxCorrectionPtr());
p_rghEqnComp2.ref().relax();
}
else
{

View File

@ -190,7 +190,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::he
for (++phasei; phasei != phases_.end(); ++phasei)
{
the() += phasei()*phasei().thermo().he(p, T);
the.ref() += phasei()*phasei().thermo().he(p, T);
}
return the;
@ -213,7 +213,8 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::he
for (++phasei; phasei != phases_.end(); ++phasei)
{
the() += scalarField(phasei(), cells)*phasei().thermo().he(p, T, cells);
the.ref() +=
scalarField(phasei(), cells)*phasei().thermo().he(p, T, cells);
}
return the;
@ -236,7 +237,7 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::he
for (++phasei; phasei != phases_.end(); ++phasei)
{
the() +=
the.ref() +=
phasei().boundaryField()[patchi]*phasei().thermo().he(p, T, patchi);
}
@ -252,7 +253,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::hc() const
for (++phasei; phasei != phases_.end(); ++phasei)
{
thc() += phasei()*phasei().thermo().hc();
thc.ref() += phasei()*phasei().thermo().hc();
}
return thc;
@ -293,7 +294,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::rho() const
for (++phasei; phasei != phases_.end(); ++phasei)
{
trho() += phasei()*phasei().thermo().rho();
trho.ref() += phasei()*phasei().thermo().rho();
}
return trho;
@ -314,7 +315,7 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::rho
for (++phasei; phasei != phases_.end(); ++phasei)
{
trho() +=
trho.ref() +=
phasei().boundaryField()[patchi]*phasei().thermo().rho(patchi);
}
@ -330,7 +331,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::Cp() const
for (++phasei; phasei != phases_.end(); ++phasei)
{
tCp() += phasei()*phasei().thermo().Cp();
tCp.ref() += phasei()*phasei().thermo().Cp();
}
return tCp;
@ -353,7 +354,7 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::Cp
for (++phasei; phasei != phases_.end(); ++phasei)
{
tCp() +=
tCp.ref() +=
phasei().boundaryField()[patchi]*phasei().thermo().Cp(p, T, patchi);
}
@ -369,7 +370,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::Cv() const
for (++phasei; phasei != phases_.end(); ++phasei)
{
tCv() += phasei()*phasei().thermo().Cv();
tCv.ref() += phasei()*phasei().thermo().Cv();
}
return tCv;
@ -392,7 +393,7 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::Cv
for (++phasei; phasei != phases_.end(); ++phasei)
{
tCv() +=
tCv.ref() +=
phasei().boundaryField()[patchi]*phasei().thermo().Cv(p, T, patchi);
}
@ -408,7 +409,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::gamma() const
for (++phasei; phasei != phases_.end(); ++phasei)
{
tgamma() += phasei()*phasei().thermo().gamma();
tgamma.ref() += phasei()*phasei().thermo().gamma();
}
return tgamma;
@ -431,7 +432,7 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::gamma
for (++phasei; phasei != phases_.end(); ++phasei)
{
tgamma() +=
tgamma.ref() +=
phasei().boundaryField()[patchi]
*phasei().thermo().gamma(p, T, patchi);
}
@ -448,7 +449,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::Cpv() const
for (++phasei; phasei != phases_.end(); ++phasei)
{
tCpv() += phasei()*phasei().thermo().Cpv();
tCpv.ref() += phasei()*phasei().thermo().Cpv();
}
return tCpv;
@ -471,7 +472,7 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::Cpv
for (++phasei; phasei != phases_.end(); ++phasei)
{
tCpv() +=
tCpv.ref() +=
phasei().boundaryField()[patchi]
*phasei().thermo().Cpv(p, T, patchi);
}
@ -488,7 +489,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::CpByCpv() const
for (++phasei; phasei != phases_.end(); ++phasei)
{
tCpByCpv() += phasei()*phasei().thermo().CpByCpv();
tCpByCpv.ref() += phasei()*phasei().thermo().CpByCpv();
}
return tCpByCpv;
@ -511,7 +512,7 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::CpByCpv
for (++phasei; phasei != phases_.end(); ++phasei)
{
tCpByCpv() +=
tCpByCpv.ref() +=
phasei().boundaryField()[patchi]
*phasei().thermo().CpByCpv(p, T, patchi);
}
@ -543,7 +544,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::kappa() const
for (++phasei; phasei != phases_.end(); ++phasei)
{
tkappa() += phasei()*phasei().thermo().kappa();
tkappa.ref() += phasei()*phasei().thermo().kappa();
}
return tkappa;
@ -564,7 +565,7 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::kappa
for (++phasei; phasei != phases_.end(); ++phasei)
{
tkappa() +=
tkappa.ref() +=
phasei().boundaryField()[patchi]*phasei().thermo().kappa(patchi);
}
@ -583,7 +584,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::kappaEff
for (++phasei; phasei != phases_.end(); ++phasei)
{
tkappaEff() += phasei()*phasei().thermo().kappaEff(alphat);
tkappaEff.ref() += phasei()*phasei().thermo().kappaEff(alphat);
}
return tkappaEff;
@ -606,7 +607,7 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::kappaEff
for (++phasei; phasei != phases_.end(); ++phasei)
{
tkappaEff() +=
tkappaEff.ref() +=
phasei().boundaryField()[patchi]
*phasei().thermo().kappaEff(alphat, patchi);
}
@ -626,7 +627,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::alphaEff
for (++phasei; phasei != phases_.end(); ++phasei)
{
talphaEff() += phasei()*phasei().thermo().alphaEff(alphat);
talphaEff.ref() += phasei()*phasei().thermo().alphaEff(alphat);
}
return talphaEff;
@ -649,7 +650,7 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::alphaEff
for (++phasei; phasei != phases_.end(); ++phasei)
{
talphaEff() +=
talphaEff.ref() +=
phasei().boundaryField()[patchi]
*phasei().thermo().alphaEff(alphat, patchi);
}
@ -666,7 +667,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::rCv() const
for (++phasei; phasei != phases_.end(); ++phasei)
{
trCv() += phasei()/phasei().thermo().Cv();
trCv.ref() += phasei()/phasei().thermo().Cv();
}
return trCv;
@ -696,7 +697,7 @@ Foam::multiphaseMixtureThermo::surfaceTensionForce() const
)
);
surfaceScalarField& stf = tstf();
surfaceScalarField& stf = tstf.ref();
forAllConstIter(PtrDictionary<phaseModel>, phases_, phase1)
{
@ -922,7 +923,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::K
{
tmp<surfaceVectorField> tnHatfv = nHatfv(alpha1, alpha2);
correctContactAngle(alpha1, alpha2, tnHatfv().boundaryField());
correctContactAngle(alpha1, alpha2, tnHatfv.ref().boundaryField());
// Simple expression for curvature
return -fvc::div(tnHatfv & mesh_.Sf());
@ -949,7 +950,8 @@ Foam::multiphaseMixtureThermo::nearInterface() const
forAllConstIter(PtrDictionary<phaseModel>, phases_, phase)
{
tnearInt() = max(tnearInt(), pos(phase() - 0.01)*pos(0.99 - phase()));
tnearInt.ref() =
max(tnearInt(), pos(phase() - 0.01)*pos(0.99 - phase()));
}
return tnearInt;

View File

@ -80,7 +80,7 @@
}
else
{
p_rghEqnComp() += hmm;
p_rghEqnComp.ref() += hmm;
}
phasei++;

View File

@ -34,7 +34,7 @@
(
alpha1,
alphaPhi,
talphaPhiCorr0(),
talphaPhiCorr0.ref(),
mixture.alphaMax(),
0
);
@ -73,7 +73,7 @@
(
alpha1,
talphaPhiUn(),
talphaPhiCorr(),
talphaPhiCorr.ref(),
mixture.alphaMax(),
0
);

View File

@ -32,7 +32,8 @@
}
ocCoeff =
refCast<fv::CrankNicolsonDdtScheme<scalar>>(ddtAlpha()).ocCoeff();
refCast<const fv::CrankNicolsonDdtScheme<scalar>>(ddtAlpha())
.ocCoeff();
}
else
{
@ -104,7 +105,7 @@
if (alphaApplyPrevCorr && talphaPhiCorr0.valid())
{
Info<< "Applying the previous iteration compression flux" << endl;
MULES::correct(alpha1, alphaPhi, talphaPhiCorr0(), 1, 0);
MULES::correct(alpha1, alphaPhi, talphaPhiCorr0.ref(), 1, 0);
alphaPhi += talphaPhiCorr0();
}
@ -150,7 +151,7 @@
tmp<surfaceScalarField> talphaPhiCorr(talphaPhiUn() - alphaPhi);
volScalarField alpha10("alpha10", alpha1);
MULES::correct(alpha1, talphaPhiUn(), talphaPhiCorr(), 1, 0);
MULES::correct(alpha1, talphaPhiUn(), talphaPhiCorr.ref(), 1, 0);
// Under-relax the correction for all but the 1st corrector
if (aCorr == 0)

View File

@ -1,5 +1,5 @@
{
volScalarField& rDeltaT = trDeltaT();
volScalarField& rDeltaT = trDeltaT.ref();
const dictionary& pimpleDict = pimple.dict();

View File

@ -62,7 +62,7 @@
if (MULESCorr)
{
talphaPhiCorr() -= talphaPhi();
talphaPhiCorr.ref() -= talphaPhi();
volScalarField alpha100("alpha100", alpha10);
alpha10 = alpha1;
@ -72,7 +72,7 @@
geometricOneField(),
alpha1,
talphaPhi(),
talphaPhiCorr(),
talphaPhiCorr.ref(),
vDotvmcAlphal,
(
divU*(alpha10 - alpha100)
@ -85,12 +85,12 @@
// Under-relax the correction for all but the 1st corrector
if (aCorr == 0)
{
talphaPhi() += talphaPhiCorr();
talphaPhi.ref() += talphaPhiCorr();
}
else
{
alpha1 = 0.5*alpha1 + 0.5*alpha10;
talphaPhi() += 0.5*talphaPhiCorr();
talphaPhi.ref() += 0.5*talphaPhiCorr();
}
}
else
@ -100,7 +100,7 @@
geometricOneField(),
alpha1,
phi,
talphaPhiCorr(),
talphaPhiCorr.ref(),
vDotvmcAlphal,
(divU*alpha1 + vDotcAlphal)(),
1,

View File

@ -372,7 +372,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::K
{
tmp<surfaceVectorField> tnHatfv = nHatfv(phase1, phase2);
correctContactAngle(phase1, phase2, tnHatfv().boundaryField());
correctContactAngle(phase1, phase2, tnHatfv.ref().boundaryField());
// Simple expression for curvature
return -fvc::div(tnHatfv & mesh_.Sf());
@ -493,10 +493,11 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::rho() const
PtrDictionary<phaseModel>::const_iterator iter = phases_.begin();
tmp<volScalarField> trho = iter()*iter().rho();
volScalarField& rho = trho.ref();
for (++iter; iter != phases_.end(); ++iter)
{
trho() += iter()*iter().rho();
rho += iter()*iter().rho();
}
return trho;
@ -509,10 +510,11 @@ Foam::multiphaseSystem::rho(const label patchi) const
PtrDictionary<phaseModel>::const_iterator iter = phases_.begin();
tmp<scalarField> trho = iter().boundaryField()[patchi]*iter().rho().value();
scalarField& rho = trho.ref();
for (++iter; iter != phases_.end(); ++iter)
{
trho() += iter().boundaryField()[patchi]*iter().rho().value();
rho += iter().boundaryField()[patchi]*iter().rho().value();
}
return trho;
@ -524,10 +526,11 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::nu() const
PtrDictionary<phaseModel>::const_iterator iter = phases_.begin();
tmp<volScalarField> tmu = iter()*(iter().rho()*iter().nu());
volScalarField& mu = tmu.ref();
for (++iter; iter != phases_.end(); ++iter)
{
tmu() += iter()*(iter().rho()*iter().nu());
mu += iter()*(iter().rho()*iter().nu());
}
return tmu/rho();
@ -542,10 +545,11 @@ Foam::multiphaseSystem::nu(const label patchi) const
tmp<scalarField> tmu =
iter().boundaryField()[patchi]
*(iter().rho().value()*iter().nu().value());
scalarField& mu = tmu.ref();
for (++iter; iter != phases_.end(); ++iter)
{
tmu() +=
mu +=
iter().boundaryField()[patchi]
*(iter().rho().value()*iter().nu().value());
}
@ -592,7 +596,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::Cvm
if (Cvm != Cvms_.end())
{
tCvm() += Cvm()*phase2.rho()*phase2;
tCvm.ref() += Cvm()*phase2.rho()*phase2;
}
else
{
@ -600,7 +604,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::Cvm
if (Cvm != Cvms_.end())
{
tCvm() += Cvm()*phase.rho()*phase2;
tCvm.ref() += Cvm()*phase.rho()*phase2;
}
}
}
@ -648,7 +652,7 @@ Foam::tmp<Foam::volVectorField> Foam::multiphaseSystem::Svm
if (Cvm != Cvms_.end())
{
tSvm() += Cvm()*phase2.rho()*phase2*phase2.DDtU();
tSvm.ref() += Cvm()*phase2.rho()*phase2*phase2.DDtU();
}
else
{
@ -656,7 +660,7 @@ Foam::tmp<Foam::volVectorField> Foam::multiphaseSystem::Svm
if (Cvm != Cvms_.end())
{
tSvm() += Cvm()*phase.rho()*phase2*phase2.DDtU();
tSvm.ref() += Cvm()*phase.rho()*phase2*phase2.DDtU();
}
}
}
@ -673,7 +677,7 @@ Foam::tmp<Foam::volVectorField> Foam::multiphaseSystem::Svm
)
)
{
tSvm().boundaryField()[patchi] = vector::zero;
tSvm.ref().boundaryField()[patchi] = vector::zero;
}
}
@ -772,7 +776,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::dragCoeff
|| &phase == &dmIter()->phase2()
)
{
tdragCoeff() += *dcIter();
tdragCoeff.ref() += *dcIter();
}
}
@ -818,7 +822,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension
if (sigma != sigmas_.end())
{
tSurfaceTension() +=
tSurfaceTension.ref() +=
dimensionedScalar("sigma", dimSigma_, sigma())
*fvc::interpolate(K(phase1, phase2))*
(
@ -853,7 +857,7 @@ Foam::multiphaseSystem::nearInterface() const
forAllConstIter(PtrDictionary<phaseModel>, phases_, iter)
{
tnearInt() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
tnearInt.ref() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
}
return tnearInt;

View File

@ -141,10 +141,11 @@ Foam::multiphaseMixture::rho() const
PtrDictionary<phase>::const_iterator iter = phases_.begin();
tmp<volScalarField> trho = iter()*iter().rho();
volScalarField& rho = trho.ref();
for (++iter; iter != phases_.end(); ++iter)
{
trho() += iter()*iter().rho();
rho += iter()*iter().rho();
}
return trho;
@ -157,10 +158,11 @@ Foam::multiphaseMixture::rho(const label patchi) const
PtrDictionary<phase>::const_iterator iter = phases_.begin();
tmp<scalarField> trho = iter().boundaryField()[patchi]*iter().rho().value();
scalarField& rho = trho.ref();
for (++iter; iter != phases_.end(); ++iter)
{
trho() += iter().boundaryField()[patchi]*iter().rho().value();
rho += iter().boundaryField()[patchi]*iter().rho().value();
}
return trho;
@ -173,10 +175,11 @@ Foam::multiphaseMixture::mu() const
PtrDictionary<phase>::const_iterator iter = phases_.begin();
tmp<volScalarField> tmu = iter()*iter().rho()*iter().nu();
volScalarField& mu = tmu.ref();
for (++iter; iter != phases_.end(); ++iter)
{
tmu() += iter()*iter().rho()*iter().nu();
mu += iter()*iter().rho()*iter().nu();
}
return tmu;
@ -192,10 +195,11 @@ Foam::multiphaseMixture::mu(const label patchi) const
iter().boundaryField()[patchi]
*iter().rho().value()
*iter().nu(patchi);
scalarField& mu = tmu.ref();
for (++iter; iter != phases_.end(); ++iter)
{
tmu() +=
mu +=
iter().boundaryField()[patchi]
*iter().rho().value()
*iter().nu(patchi);
@ -212,10 +216,11 @@ Foam::multiphaseMixture::muf() const
tmp<surfaceScalarField> tmuf =
fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu());
surfaceScalarField& muf = tmuf.ref();
for (++iter; iter != phases_.end(); ++iter)
{
tmuf() +=
muf +=
fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu());
}
@ -267,7 +272,7 @@ Foam::multiphaseMixture::surfaceTensionForce() const
)
);
surfaceScalarField& stf = tstf();
surfaceScalarField& stf = tstf.ref();
forAllConstIter(PtrDictionary<phase>, phases_, iter1)
{
@ -518,7 +523,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::K
{
tmp<surfaceVectorField> tnHatfv = nHatfv(alpha1, alpha2);
correctContactAngle(alpha1, alpha2, tnHatfv().boundaryField());
correctContactAngle(alpha1, alpha2, tnHatfv.ref().boundaryField());
// Simple expression for curvature
return -fvc::div(tnHatfv & mesh_.Sf());
@ -545,7 +550,7 @@ Foam::multiphaseMixture::nearInterface() const
forAllConstIter(PtrDictionary<phase>, phases_, iter)
{
tnearInt() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
tnearInt.ref() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
}
return tnearInt;

View File

@ -1,6 +1,6 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> UEqn
tmp<fvVectorMatrix> tUEqn
(
fvm::ddt(U) + fvm::div(phi, U)
+ MRF.DDt(U)
@ -8,14 +8,15 @@ tmp<fvVectorMatrix> UEqn
==
fvOptions(U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn().relax();
UEqn.relax();
fvOptions.constrain(UEqn());
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p_gh));
solve(UEqn == -fvc::grad(p_gh));
fvOptions.correct(U);
}

View File

@ -1,10 +1,10 @@
volScalarField rAU(1.0/UEqn().A());
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p_gh));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_gh));
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
tUEqn.clear();
}
surfaceScalarField phiHbyA

View File

@ -1,11 +1,11 @@
{
rAU = 1.0/UEqn().A();
rAU = 1.0/UEqn.A();
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p_gh));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_gh));
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
tUEqn.clear();
}
surfaceScalarField phiHbyA

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -153,7 +153,7 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::D
)
);
volScalarField& D(tmpD());
volScalarField& D(tmpD.ref());
forAll(p, cellI)
{
@ -207,7 +207,7 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::L
)
);
volScalarField& L(tmpL());
volScalarField& L(tmpL.ref());
forAll(p, cellI)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -111,7 +111,7 @@ Foam::saturationModels::polynomial::Tsat
)
);
volScalarField& Tsat = tTsat();
volScalarField& Tsat = tTsat.ref();
forAll(Tsat,celli)
{

View File

@ -46,7 +46,7 @@ Foam::tmp<Foam::volVectorField> Foam::wallLubricationModel::zeroGradWalls
tmp<volVectorField> tFi
) const
{
volVectorField& Fi = tFi();
volVectorField& Fi = tFi.ref();
const fvPatchList& patches = Fi.mesh().boundary();
forAll(patches, patchi)

View File

@ -199,15 +199,15 @@ Foam::BlendedInterfacialModel<ModelType>::K() const
if (model_.valid())
{
x() += model_->K()*(scalar(1) - f1() - f2());
x.ref() += model_->K()*(scalar(1) - f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->K()*f1;
x.ref() += model1In2_->K()*f1;
}
if (model2In1_.valid())
{
x() += model2In1_->K()*f2;
x.ref() += model2In1_->K()*f2;
}
if
@ -216,7 +216,7 @@ Foam::BlendedInterfacialModel<ModelType>::K() const
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
)
{
correctFixedFluxBCs(x());
correctFixedFluxBCs(x.ref());
}
return x;
@ -259,15 +259,15 @@ Foam::BlendedInterfacialModel<ModelType>::K(const scalar residualAlpha) const
if (model_.valid())
{
x() += model_->K(residualAlpha)*(scalar(1) - f1() - f2());
x.ref() += model_->K(residualAlpha)*(scalar(1) - f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->K(residualAlpha)*f1;
x.ref() += model1In2_->K(residualAlpha)*f1;
}
if (model2In1_.valid())
{
x() += model2In1_->K(residualAlpha)*f2;
x.ref() += model2In1_->K(residualAlpha)*f2;
}
if
@ -276,7 +276,7 @@ Foam::BlendedInterfacialModel<ModelType>::K(const scalar residualAlpha) const
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
)
{
correctFixedFluxBCs(x());
correctFixedFluxBCs(x.ref());
}
return x;
@ -325,17 +325,17 @@ Foam::BlendedInterfacialModel<ModelType>::Kf() const
if (model_.valid())
{
x() += model_->Kf()*(scalar(1) - f1() - f2());
x.ref() += model_->Kf()*(scalar(1) - f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->Kf()*f1;
x.ref() += model1In2_->Kf()*f1;
}
if (model2In1_.valid())
{
x() += model2In1_->Kf()*f2;
x.ref() += model2In1_->Kf()*f2;
}
if
@ -344,7 +344,7 @@ Foam::BlendedInterfacialModel<ModelType>::Kf() const
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
)
{
correctFixedFluxBCs(x());
correctFixedFluxBCs(x.ref());
}
return x;
@ -388,17 +388,17 @@ Foam::BlendedInterfacialModel<ModelType>::F() const
if (model_.valid())
{
x() += model_->F()*(scalar(1) - f1() - f2());
x.ref() += model_->F()*(scalar(1) - f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->F()*f1;
x.ref() += model1In2_->F()*f1;
}
if (model2In1_.valid())
{
x() -= model2In1_->F()*f2; // note : subtraction
x.ref() -= model2In1_->F()*f2; // note : subtraction
}
if
@ -407,7 +407,7 @@ Foam::BlendedInterfacialModel<ModelType>::F() const
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
)
{
correctFixedFluxBCs(x());
correctFixedFluxBCs(x.ref());
}
return x;
@ -456,17 +456,17 @@ Foam::BlendedInterfacialModel<ModelType>::Ff() const
if (model_.valid())
{
x() += model_->Ff()*(scalar(1) - f1() - f2());
x.ref() += model_->Ff()*(scalar(1) - f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->Ff()*f1;
x.ref() += model1In2_->Ff()*f1;
}
if (model2In1_.valid())
{
x() -= model2In1_->Ff()*f2; // note : subtraction
x.ref() -= model2In1_->Ff()*f2; // note : subtraction
}
if
@ -475,7 +475,7 @@ Foam::BlendedInterfacialModel<ModelType>::Ff() const
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
)
{
correctFixedFluxBCs(x());
correctFixedFluxBCs(x.ref());
}
return x;
@ -518,15 +518,15 @@ Foam::BlendedInterfacialModel<ModelType>::D() const
if (model_.valid())
{
x() += model_->D()*(scalar(1) - f1() - f2());
x.ref() += model_->D()*(scalar(1) - f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->D()*f1;
x.ref() += model1In2_->D()*f1;
}
if (model2In1_.valid())
{
x() += model2In1_->D()*f2;
x.ref() += model2In1_->D()*f2;
}
if
@ -535,7 +535,7 @@ Foam::BlendedInterfacialModel<ModelType>::D() const
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
)
{
correctFixedFluxBCs(x());
correctFixedFluxBCs(x.ref());
}
return x;

View File

@ -218,7 +218,7 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::dmdt
{
if (phase1 == &phase)
{
tdmdt() += this->dmdt(pair);
tdmdt.ref() += this->dmdt(pair);
}
Swap(phase1, phase2);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -112,13 +112,13 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
// Add the appropriate pressure-work term
if (he.name() == this->thermo_->phasePropertyName("e"))
{
tEEqn() +=
tEEqn.ref() +=
fvc::ddt(alpha)*this->thermo().p()
+ fvc::div(alphaPhi, this->thermo().p());
}
else if (this->thermo_->dpdt())
{
tEEqn() -= alpha*this->fluid().dpdt();
tEEqn.ref() -= alpha*this->fluid().dpdt();
}
return tEEqn;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,7 +57,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::phaseSystem::calcPhi
for (label phasei=1; phasei<phaseModels.size(); phasei++)
{
tmpPhi() +=
tmpPhi.ref() +=
fvc::interpolate(phaseModels[phasei])*phaseModels[phasei].phi();
}
@ -197,7 +197,7 @@ Foam::tmp<Foam::volScalarField> Foam::phaseSystem::rho() const
for (label phasei=1; phasei<phaseModels_.size(); phasei++)
{
tmpRho() += phaseModels_[phasei]*phaseModels_[phasei].rho();
tmpRho.ref() += phaseModels_[phasei]*phaseModels_[phasei].rho();
}
return tmpRho;
@ -213,7 +213,7 @@ Foam::tmp<Foam::volVectorField> Foam::phaseSystem::U() const
for (label phasei=1; phasei<phaseModels_.size(); phasei++)
{
tmpU() += phaseModels_[phasei]*phaseModels_[phasei].U();
tmpU.ref() += phaseModels_[phasei]*phaseModels_[phasei].U();
}
return tmpU;

View File

@ -29,7 +29,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
);
EEqn->relax();
fvOptions.constrain(EEqn());
fvOptions.constrain(EEqn.ref());
EEqn->solve();
}
}

View File

@ -1,4 +1,4 @@
EXE_INC = -DCONST_TMP \
EXE_INC = \
-I../multiphaseSystem/lnInclude \
-I../../phaseSystems/lnInclude \
-I../../interfacialModels/lnInclude\

View File

@ -477,7 +477,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::K
{
tmp<surfaceVectorField> tnHatfv = nHatfv(phase1, phase2);
correctContactAngle(phase1, phase2, tnHatfv().boundaryField());
correctContactAngle(phase1, phase2, tnHatfv.ref().boundaryField());
// Simple expression for curvature
return -fvc::div(tnHatfv & mesh_.Sf());
@ -568,7 +568,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension
if (cAlpha != cAlphas_.end())
{
tSurfaceTension() +=
tSurfaceTension.ref() +=
fvc::interpolate(sigma(key12)*K(phase1, phase2))
*(
fvc::interpolate(phase2)*fvc::snGrad(phase1)
@ -602,7 +602,7 @@ Foam::multiphaseSystem::nearInterface() const
forAll(phases(), phasei)
{
tnearInt() = max
tnearInt.ref() = max
(
tnearInt(),
pos(phases()[phasei] - 0.01)*pos(0.99 - phases()[phasei])

View File

@ -457,7 +457,7 @@ while (pimple.correct())
forAll(phases, phasei)
{
phaseModel& phase = phases[phasei];
phase.rho()() += phase.thermo().psi()*(p_rgh - p_rgh_0);
phase.thermo().rho() += phase.thermo().psi()*(p_rgh - p_rgh_0);
}
// Correct p_rgh for consistency with p and the updated densities

View File

@ -1,5 +1,5 @@
{
volScalarField& rDeltaT = trDeltaT();
volScalarField& rDeltaT = trDeltaT.ref();
const dictionary& pimpleDict = pimple.dict();

View File

@ -23,7 +23,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
);
E1Eqn->relax();
fvOptions.constrain(E1Eqn());
fvOptions.constrain(E1Eqn.ref());
E1Eqn->solve();
}
}
@ -43,7 +43,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
);
E2eqn->relax();
fvOptions.constrain(E2eqn());
fvOptions.constrain(E2eqn.ref());
E2eqn->solve();
}
}

View File

@ -261,8 +261,8 @@ while (pimple.correct())
)
);
deleteDemandDrivenData(pEqnComp1().faceFluxCorrectionPtr());
pEqnComp1().relax();
deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr());
pEqnComp1.ref().relax();
}
if (phase2.compressible())
@ -286,8 +286,8 @@ while (pimple.correct())
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
)
);
deleteDemandDrivenData(pEqnComp2().faceFluxCorrectionPtr());
pEqnComp2().relax();
deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr());
pEqnComp2.ref().relax();
}
}
else
@ -317,7 +317,7 @@ while (pimple.correct())
{
if (pEqnComp1.valid())
{
pEqnComp1() -= fluid.dmdt()/rho1;
pEqnComp1.ref() -= fluid.dmdt()/rho1;
}
else
{
@ -326,7 +326,7 @@ while (pimple.correct())
if (pEqnComp2.valid())
{
pEqnComp2() += fluid.dmdt()/rho2;
pEqnComp2.ref() += fluid.dmdt()/rho2;
}
else
{

View File

@ -242,8 +242,8 @@ while (pimple.correct())
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
)
);
deleteDemandDrivenData(pEqnComp1().faceFluxCorrectionPtr());
pEqnComp1().relax();
deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr());
pEqnComp1.ref().relax();
}
if (phase2.compressible())
@ -261,8 +261,8 @@ while (pimple.correct())
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
)
);
deleteDemandDrivenData(pEqnComp2().faceFluxCorrectionPtr());
pEqnComp2().relax();
deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr());
pEqnComp2.ref().relax();
}
}
else
@ -292,7 +292,7 @@ while (pimple.correct())
{
if (pEqnComp1.valid())
{
pEqnComp1() -= fluid.dmdt()/rho1;
pEqnComp1.ref() -= fluid.dmdt()/rho1;
}
else
{
@ -301,7 +301,7 @@ while (pimple.correct())
if (pEqnComp2.valid())
{
pEqnComp2() += fluid.dmdt()/rho2;
pEqnComp2.ref() += fluid.dmdt()/rho2;
}
else
{

View File

@ -1,5 +1,5 @@
{
volScalarField& rDeltaT = trDeltaT();
volScalarField& rDeltaT = trDeltaT.ref();
const dictionary& pimpleDict = pimple.dict();

View File

@ -1,4 +1,4 @@
EXE_INC = -DCONST_TMP \
EXE_INC = \
-I../twoPhaseSystem/lnInclude \
-I../../phaseSystems/lnInclude \
-I../../interfacialModels/lnInclude\

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -299,7 +299,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
const scalarField liquidw(liquid.boundaryField()[patchi]);
// Damp boiling at high void fractions.
const scalarField W(min(liquidw/0.2, scalar(0.1)));
const scalarField W(min(liquidw/0.2, scalar(1)));
const scalarField A2(W*min(M_PI*sqr(Ddep)*N*Al/4, scalar(1)));
const scalarField A1(max(1 - A2, scalar(1e-4)));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -284,7 +284,7 @@ void Foam::twoPhaseSystem::solve()
if (tdgdt.valid())
{
scalarField& dgdt = tdgdt();
scalarField& dgdt = tdgdt.ref();
forAll(dgdt, celli)
{

View File

@ -260,8 +260,8 @@ while (pimple.correct())
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
)
);
deleteDemandDrivenData(pEqnComp1().faceFluxCorrectionPtr());
pEqnComp1().relax();
deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr());
pEqnComp1.ref().relax();
pEqnComp2 =
(
@ -276,8 +276,8 @@ while (pimple.correct())
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
)
);
deleteDemandDrivenData(pEqnComp2().faceFluxCorrectionPtr());
pEqnComp2().relax();
deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr());
pEqnComp2.ref().relax();
}
else
{

View File

@ -239,8 +239,8 @@ while (pimple.correct())
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
)
);
deleteDemandDrivenData(pEqnComp1().faceFluxCorrectionPtr());
pEqnComp1().relax();
deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr());
pEqnComp1.ref().relax();
pEqnComp2 =
(
@ -255,8 +255,8 @@ while (pimple.correct())
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
)
);
deleteDemandDrivenData(pEqnComp2().faceFluxCorrectionPtr());
pEqnComp2().relax();
deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr());
pEqnComp2.ref().relax();
}
else
{

View File

@ -1,4 +1,4 @@
EXE_INC = -DCONST_TMP \
EXE_INC = \
-I../twoPhaseSystem/lnInclude \
-I../interfacialModels/lnInclude\
-I$(LIB_SRC)/transportModels/compressible/lnInclude \

View File

@ -155,17 +155,17 @@ Foam::BlendedInterfacialModel<modelType>::K() const
if (model_.valid())
{
x() += model_->K()*(f1() - f2());
x.ref() += model_->K()*(f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->K()*(1 - f1);
x.ref() += model1In2_->K()*(1 - f1);
}
if (model2In1_.valid())
{
x() += model2In1_->K()*f2;
x.ref() += model2In1_->K()*f2;
}
if
@ -174,7 +174,7 @@ Foam::BlendedInterfacialModel<modelType>::K() const
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
)
{
correctFixedFluxBCs(x());
correctFixedFluxBCs(x.ref());
}
return x;
@ -223,17 +223,17 @@ Foam::BlendedInterfacialModel<modelType>::Kf() const
if (model_.valid())
{
x() += model_->Kf()*(f1() - f2());
x.ref() += model_->Kf()*(f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->Kf()*(1 - f1);
x.ref() += model1In2_->Kf()*(1 - f1);
}
if (model2In1_.valid())
{
x() += model2In1_->Kf()*f2;
x.ref() += model2In1_->Kf()*f2;
}
if
@ -242,7 +242,7 @@ Foam::BlendedInterfacialModel<modelType>::Kf() const
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
)
{
correctFixedFluxBCs(x());
correctFixedFluxBCs(x.ref());
}
return x;
@ -286,17 +286,17 @@ Foam::BlendedInterfacialModel<modelType>::F() const
if (model_.valid())
{
x() += model_->F()*(f1() - f2());
x.ref() += model_->F()*(f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->F()*(1 - f1);
x.ref() += model1In2_->F()*(1 - f1);
}
if (model2In1_.valid())
{
x() -= model2In1_->F()*f2; // note : subtraction
x.ref() -= model2In1_->F()*f2; // note : subtraction
}
if
@ -305,7 +305,7 @@ Foam::BlendedInterfacialModel<modelType>::F() const
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
)
{
correctFixedFluxBCs(x());
correctFixedFluxBCs(x.ref());
}
return x;
@ -354,17 +354,17 @@ Foam::BlendedInterfacialModel<modelType>::Ff() const
if (model_.valid())
{
x() += model_->Ff()*(f1() - f2());
x.ref() += model_->Ff()*(f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->Ff()*(1 - f1);
x.ref() += model1In2_->Ff()*(1 - f1);
}
if (model2In1_.valid())
{
x() -= model2In1_->Ff()*f2; // note : subtraction
x.ref() -= model2In1_->Ff()*f2; // note : subtraction
}
if
@ -373,7 +373,7 @@ Foam::BlendedInterfacialModel<modelType>::Ff() const
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
)
{
correctFixedFluxBCs(x());
correctFixedFluxBCs(x.ref());
}
return x;
@ -416,17 +416,17 @@ Foam::BlendedInterfacialModel<modelType>::D() const
if (model_.valid())
{
x() += model_->D()*(f1() - f2());
x.ref() += model_->D()*(f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->D()*(1 - f1);
x.ref() += model1In2_->D()*(1 - f1);
}
if (model2In1_.valid())
{
x() += model2In1_->D()*f2;
x.ref() += model2In1_->D()*f2;
}
if
@ -435,7 +435,7 @@ Foam::BlendedInterfacialModel<modelType>::D() const
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
)
{
correctFixedFluxBCs(x());
correctFixedFluxBCs(x.ref());
}
return x;

View File

@ -1150,7 +1150,7 @@ tmp<pointField> calcOffset
vectorField::subField fc = pp.faceCentres();
tmp<pointField> toffsets(new pointField(fc.size()));
pointField& offsets = toffsets();
pointField& offsets = toffsets.ref();
forAll(fc, i)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -280,7 +280,7 @@ Foam::tmp<Foam::pointField> Foam::DelaunayMeshTools::allPoints
)
{
tmp<pointField> tpts(new pointField(t.vertexCount(), point::max));
pointField& pts = tpts();
pointField& pts = tpts.ref();
for
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -262,7 +262,7 @@ Foam::label Foam::cellShapeControlMesh::removePoints()
Foam::tmp<Foam::pointField> Foam::cellShapeControlMesh::cellCentres() const
{
tmp<pointField> tcellCentres(new pointField(number_of_finite_cells()));
pointField& cellCentres = tcellCentres();
pointField& cellCentres = tcellCentres.ref();
label count = 0;
for

View File

@ -179,7 +179,7 @@ Foam::tmp<Foam::triadField> Foam::smoothAlignmentSolver::buildAlignmentField
(
new triadField(mesh.vertexCount(), triad::unset)
);
triadField& alignments = tAlignments();
triadField& alignments = tAlignments.ref();
for
(
@ -211,7 +211,7 @@ Foam::tmp<Foam::pointField> Foam::smoothAlignmentSolver::buildPointField
(
new pointField(mesh.vertexCount(), point(GREAT, GREAT, GREAT))
);
pointField& points = tPoints();
pointField& points = tPoints.ref();
for
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -152,7 +152,7 @@ Foam::tmp<Foam::triSurfacePointScalarField> Foam::automatic::load()
)
);
triSurfacePointScalarField& pointCellSize = tPointCellSize();
triSurfacePointScalarField& pointCellSize = tPointCellSize.ref();
if (readCurvature_)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -95,7 +95,7 @@ Foam::tmp<Foam::triSurfacePointScalarField> Foam::fieldFromFile::load()
)
);
pointCellSize() *= cellSizeMultipleCoeff_;
pointCellSize.ref() *= cellSizeMultipleCoeff_;
return pointCellSize;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -105,7 +105,7 @@ Foam::searchableBoxFeatures::features() const
edgeNormals[11][0] = 3; edgeNormals[11][1] = 0;
tmp<pointField> surfacePointsTmp(surface().points());
pointField& surfacePoints = surfacePointsTmp();
pointField& surfacePoints = surfacePointsTmp.ref();
forAll(edgeDirections, eI)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -84,7 +84,7 @@ tmp<volScalarField> createScalarField
zeroGradientFvPatchScalarField::typeName
)
);
volScalarField& fld = tfld();
volScalarField& fld = tfld.ref();
forAll(fld, cellI)
{

View File

@ -181,7 +181,7 @@ void subsetVolFields
{
if (addedPatches.found(patchI))
{
tSubFld().boundaryField()[patchI] ==
tSubFld.ref().boundaryField()[patchI] ==
pTraits<typename GeoField::value_type>::zero;
}
}
@ -233,7 +233,7 @@ void subsetSurfaceFields
{
if (addedPatches.found(patchI))
{
tSubFld().boundaryField()[patchI] ==
tSubFld.ref().boundaryField()[patchI] ==
pTraits<typename GeoField::value_type>::zero;
}
}

View File

@ -53,8 +53,8 @@ volField
(
meshSubsetter.interpolate(vf)
);
tfld().checkOut();
tfld().rename(vf.name());
tfld.ref().checkOut();
tfld.ref().rename(vf.name());
return tfld;
}
else
@ -729,7 +729,7 @@ void ensightField
(
volPointInterpolation::New(vf.mesh()).interpolate(vf)
);
pfld().rename(vf.name());
pfld.ref().rename(vf.name());
ensightPointField<Type>
(

View File

@ -37,7 +37,7 @@ Foam::tmp<Field<Type>> Foam::surfaceMeshWriter::getFaceField
const polyBoundaryMesh& patches = sfld.mesh().boundaryMesh();
tmp<Field<Type>> tfld(new Field<Type>(pp_.size()));
Field<Type>& fld = tfld();
Field<Type>& fld = tfld.ref();
forAll(pp_.addressing(), i)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -157,7 +157,7 @@ public:
if (useSubMesh())
{
tmp<GeoField> subFld = subsetter_.interpolate(fld);
subFld().rename(fld.name());
subFld.ref().rename(fld.name());
return subFld;
}
else

Some files were not shown because too many files have changed in this diff Show More