COMP: avoid ambiguous construct from tmp - solvers/ compressible

This commit is contained in:
Mark Olesen
2010-12-21 09:50:07 +01:00
parent c5ee4e1b04
commit 0ff0b5cb86
18 changed files with 202 additions and 123 deletions

View File

@ -181,13 +181,16 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
) )
); );
Field<scalar> C2 = pmu/prho Field<scalar> C2
(
pmu/prho
*sqrt(ppsi*constant::mathematical::piByTwo) *sqrt(ppsi*constant::mathematical::piByTwo)
*2.0*gamma_/Pr.value()/(gamma_ + 1.0) *2.0*gamma_/Pr.value()/(gamma_ + 1.0)
*(2.0 - accommodationCoeff_)/accommodationCoeff_; *(2.0 - accommodationCoeff_)/accommodationCoeff_
);
Field<scalar> aCoeff = prho.snGrad() - prho/C2; Field<scalar> aCoeff(prho.snGrad() - prho/C2);
Field<scalar> KEbyRho = 0.5*magSqr(pU); Field<scalar> KEbyRho(0.5*magSqr(pU));
valueFraction() = (1.0/(1.0 + patch().deltaCoeffs()*C2)); valueFraction() = (1.0/(1.0 + patch().deltaCoeffs()*C2));
refValue() = Twall_; refValue() = Twall_;
@ -214,9 +217,11 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
namespace Foam namespace Foam
{ {
makeNonTemplatedPatchTypeField
makePatchTypeField(fvPatchScalarField, smoluchowskiJumpTFvPatchScalarField); (
fvPatchScalarField,
smoluchowskiJumpTFvPatchScalarField
);
} }

View File

@ -83,8 +83,7 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
if if
( (
mag(accommodationCoeff_) < SMALL mag(accommodationCoeff_) < SMALL
|| || mag(accommodationCoeff_) > 2.0
mag(accommodationCoeff_) > 2.0
) )
{ {
FatalIOErrorIn FatalIOErrorIn
@ -142,10 +141,13 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
const fvPatchField<scalar>& ppsi = const fvPatchField<scalar>& ppsi =
patch().lookupPatchField<volScalarField, scalar>("psi"); patch().lookupPatchField<volScalarField, scalar>("psi");
Field<scalar> C1 = sqrt(ppsi*constant::mathematical::piByTwo) Field<scalar> C1
*(2.0 - accommodationCoeff_)/accommodationCoeff_; (
sqrt(ppsi*constant::mathematical::piByTwo)
* (2.0 - accommodationCoeff_)/accommodationCoeff_
);
Field<scalar> pnu = pmu/prho; Field<scalar> pnu(pmu/prho);
valueFraction() = (1.0/(1.0 + patch().deltaCoeffs()*C1*pnu)); valueFraction() = (1.0/(1.0 + patch().deltaCoeffs()*C1*pnu));
refValue() = Uwall_; refValue() = Uwall_;
@ -156,8 +158,8 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
this->db().objectRegistry::lookupObject<volScalarField>("T"); this->db().objectRegistry::lookupObject<volScalarField>("T");
label patchi = this->patch().index(); label patchi = this->patch().index();
const fvPatchScalarField& pT = vsfT.boundaryField()[patchi]; const fvPatchScalarField& pT = vsfT.boundaryField()[patchi];
Field<vector> gradpT = fvc::grad(vsfT)().boundaryField()[patchi]; Field<vector> gradpT(fvc::grad(vsfT)().boundaryField()[patchi]);
vectorField n = patch().nf(); vectorField n(patch().nf());
refValue() -= 3.0*pnu/(4.0*pT)*transform(I - n*n, gradpT); refValue() -= 3.0*pnu/(4.0*pT)*transform(I - n*n, gradpT);
} }
@ -166,7 +168,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
{ {
const fvPatchTensorField& ptauMC = const fvPatchTensorField& ptauMC =
patch().lookupPatchField<volTensorField, tensor>("tauMC"); patch().lookupPatchField<volTensorField, tensor>("tauMC");
vectorField n = patch().nf(); vectorField n(patch().nf());
refValue() -= C1/prho*transform(I - n*n, (n & ptauMC)); refValue() -= C1/prho*transform(I - n*n, (n & ptauMC));
} }
@ -196,7 +198,11 @@ void maxwellSlipUFvPatchVectorField::write(Ostream& os) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField(fvPatchVectorField, maxwellSlipUFvPatchVectorField); makeNonTemplatedPatchTypeField
(
fvPatchVectorField,
maxwellSlipUFvPatchVectorField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -135,8 +135,8 @@ void mixedFixedValueSlipFvPatchField<Type>::rmap
template<class Type> template<class Type>
tmp<Field<Type> > mixedFixedValueSlipFvPatchField<Type>::snGrad() const tmp<Field<Type> > mixedFixedValueSlipFvPatchField<Type>::snGrad() const
{ {
vectorField nHat = this->patch().nf(); tmp<vectorField> nHat = this->patch().nf();
Field<Type> pif = this->patchInternalField(); Field<Type> pif(this->patchInternalField());
return return
( (
@ -155,7 +155,7 @@ void mixedFixedValueSlipFvPatchField<Type>::evaluate(const Pstream::commsTypes)
this->updateCoeffs(); this->updateCoeffs();
} }
vectorField nHat = this->patch().nf(); vectorField nHat(this->patch().nf());
Field<Type>::operator= Field<Type>::operator=
( (
@ -174,7 +174,7 @@ template<class Type>
tmp<Field<Type> > tmp<Field<Type> >
mixedFixedValueSlipFvPatchField<Type>::snGradTransformDiag() const mixedFixedValueSlipFvPatchField<Type>::snGradTransformDiag() const
{ {
vectorField nHat = this->patch().nf(); vectorField nHat(this->patch().nf());
vectorField diag(nHat.size()); vectorField diag(nHat.size());
diag.replace(vector::X, mag(nHat.component(vector::X))); diag.replace(vector::X, mag(nHat.component(vector::X)));

View File

@ -112,7 +112,11 @@ void fixedRhoFvPatchScalarField::updateCoeffs()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField(fvPatchScalarField, fixedRhoFvPatchScalarField); makeNonTemplatedPatchTypeField
(
fvPatchScalarField,
fixedRhoFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -34,8 +34,10 @@ scalar meanCoNum = 0.0;
if (mesh.nInternalFaces()) if (mesh.nInternalFaces())
{ {
surfaceScalarField amaxSfbyDelta = surfaceScalarField amaxSfbyDelta
mesh.surfaceInterpolation::deltaCoeffs()*amaxSf; (
mesh.surfaceInterpolation::deltaCoeffs()*amaxSf
);
CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaTValue(); CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaTValue();

View File

@ -62,52 +62,76 @@ int main(int argc, char *argv[])
{ {
// --- upwind interpolation of primitive fields on faces // --- upwind interpolation of primitive fields on faces
surfaceScalarField rho_pos = surfaceScalarField rho_pos
fvc::interpolate(rho, pos, "reconstruct(rho)"); (
surfaceScalarField rho_neg = fvc::interpolate(rho, pos, "reconstruct(rho)")
fvc::interpolate(rho, neg, "reconstruct(rho)"); );
surfaceScalarField rho_neg
(
fvc::interpolate(rho, neg, "reconstruct(rho)")
);
surfaceVectorField rhoU_pos = surfaceVectorField rhoU_pos
fvc::interpolate(rhoU, pos, "reconstruct(U)"); (
surfaceVectorField rhoU_neg = fvc::interpolate(rhoU, pos, "reconstruct(U)")
fvc::interpolate(rhoU, neg, "reconstruct(U)"); );
surfaceVectorField rhoU_neg
(
fvc::interpolate(rhoU, neg, "reconstruct(U)")
);
volScalarField rPsi = 1.0/psi; volScalarField rPsi(1.0/psi);
surfaceScalarField rPsi_pos = surfaceScalarField rPsi_pos
fvc::interpolate(rPsi, pos, "reconstruct(T)"); (
surfaceScalarField rPsi_neg = fvc::interpolate(rPsi, pos, "reconstruct(T)")
fvc::interpolate(rPsi, neg, "reconstruct(T)"); );
surfaceScalarField rPsi_neg
(
fvc::interpolate(rPsi, neg, "reconstruct(T)")
);
surfaceScalarField e_pos = surfaceScalarField e_pos
fvc::interpolate(e, pos, "reconstruct(T)"); (
surfaceScalarField e_neg = fvc::interpolate(e, pos, "reconstruct(T)")
fvc::interpolate(e, neg, "reconstruct(T)"); );
surfaceScalarField e_neg
(
fvc::interpolate(e, neg, "reconstruct(T)")
);
surfaceVectorField U_pos = rhoU_pos/rho_pos; surfaceVectorField U_pos(rhoU_pos/rho_pos);
surfaceVectorField U_neg = rhoU_neg/rho_neg; surfaceVectorField U_neg(rhoU_neg/rho_neg);
surfaceScalarField p_pos = rho_pos*rPsi_pos; surfaceScalarField p_pos(rho_pos*rPsi_pos);
surfaceScalarField p_neg = rho_neg*rPsi_neg; surfaceScalarField p_neg(rho_neg*rPsi_neg);
surfaceScalarField phiv_pos = U_pos & mesh.Sf(); surfaceScalarField phiv_pos(U_pos & mesh.Sf());
surfaceScalarField phiv_neg = U_neg & mesh.Sf(); surfaceScalarField phiv_neg(U_neg & mesh.Sf());
volScalarField c = sqrt(thermo.Cp()/thermo.Cv()*rPsi); volScalarField c(sqrt(thermo.Cp()/thermo.Cv()*rPsi));
surfaceScalarField cSf_pos = surfaceScalarField cSf_pos
fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf(); (
surfaceScalarField cSf_neg = fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf()
fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf(); );
surfaceScalarField cSf_neg
(
fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf()
);
surfaceScalarField ap = surfaceScalarField ap
max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero); (
surfaceScalarField am = max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero)
min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero); );
surfaceScalarField am
(
min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero)
);
surfaceScalarField a_pos = ap/(ap - am); surfaceScalarField a_pos(ap/(ap - am));
surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap))); surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap)));
surfaceScalarField aSf = am*a_pos; surfaceScalarField aSf(am*a_pos);
if (fluxScheme == "Tadmor") if (fluxScheme == "Tadmor")
{ {
@ -115,13 +139,13 @@ int main(int argc, char *argv[])
a_pos = 0.5; a_pos = 0.5;
} }
surfaceScalarField a_neg = (1.0 - a_pos); surfaceScalarField a_neg(1.0 - a_pos);
phiv_pos *= a_pos; phiv_pos *= a_pos;
phiv_neg *= a_neg; phiv_neg *= a_neg;
surfaceScalarField aphiv_pos = phiv_pos - aSf; surfaceScalarField aphiv_pos(phiv_pos - aSf);
surfaceScalarField aphiv_neg = phiv_neg + aSf; surfaceScalarField aphiv_neg(phiv_neg + aSf);
// Reuse amaxSf for the maximum positive and negative fluxes // Reuse amaxSf for the maximum positive and negative fluxes
// estimated by the central scheme // estimated by the central scheme
@ -148,14 +172,18 @@ int main(int argc, char *argv[])
surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg); surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg);
surfaceVectorField phiUp = surfaceVectorField phiUp
(
(aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg) (aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg)
+ (a_pos*p_pos + a_neg*p_neg)*mesh.Sf(); + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf()
);
surfaceScalarField phiEp = surfaceScalarField phiEp
(
aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos) aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos)
+ aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg) + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg)
+ aSf*p_pos - aSf*p_neg; + aSf*p_pos - aSf*p_neg
);
volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T())); volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T()));
@ -185,7 +213,7 @@ int main(int argc, char *argv[])
} }
// --- Solve energy // --- Solve energy
surfaceScalarField sigmaDotU = surfaceScalarField sigmaDotU
( (
( (
fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U) fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U)

View File

@ -59,48 +59,72 @@ int main(int argc, char *argv[])
{ {
// --- upwind interpolation of primitive fields on faces // --- upwind interpolation of primitive fields on faces
surfaceScalarField rho_pos = surfaceScalarField rho_pos
fvc::interpolate(rho, pos, "reconstruct(rho)"); (
surfaceScalarField rho_neg = fvc::interpolate(rho, pos, "reconstruct(rho)")
fvc::interpolate(rho, neg, "reconstruct(rho)"); );
surfaceScalarField rho_neg
(
fvc::interpolate(rho, neg, "reconstruct(rho)")
);
surfaceVectorField rhoU_pos = surfaceVectorField rhoU_pos
fvc::interpolate(rhoU, pos, "reconstruct(U)"); (
surfaceVectorField rhoU_neg = fvc::interpolate(rhoU, pos, "reconstruct(U)")
fvc::interpolate(rhoU, neg, "reconstruct(U)"); );
surfaceVectorField rhoU_neg
(
fvc::interpolate(rhoU, neg, "reconstruct(U)")
);
volScalarField rPsi = 1.0/psi; volScalarField rPsi(1.0/psi);
surfaceScalarField rPsi_pos = surfaceScalarField rPsi_pos
fvc::interpolate(rPsi, pos, "reconstruct(T)"); (
surfaceScalarField rPsi_neg = fvc::interpolate(rPsi, pos, "reconstruct(T)")
fvc::interpolate(rPsi, neg, "reconstruct(T)"); );
surfaceScalarField rPsi_neg
(
fvc::interpolate(rPsi, neg, "reconstruct(T)")
);
surfaceScalarField e_pos = surfaceScalarField e_pos
fvc::interpolate(e, pos, "reconstruct(T)"); (
surfaceScalarField e_neg = fvc::interpolate(e, pos, "reconstruct(T)")
fvc::interpolate(e, neg, "reconstruct(T)"); );
surfaceScalarField e_neg
(
fvc::interpolate(e, neg, "reconstruct(T)")
);
surfaceVectorField U_pos = rhoU_pos/rho_pos; surfaceVectorField U_pos(rhoU_pos/rho_pos);
surfaceVectorField U_neg = rhoU_neg/rho_neg; surfaceVectorField U_neg(rhoU_neg/rho_neg);
surfaceScalarField p_pos = rho_pos*rPsi_pos; surfaceScalarField p_pos(rho_pos*rPsi_pos);
surfaceScalarField p_neg = rho_neg*rPsi_neg; surfaceScalarField p_neg(rho_neg*rPsi_neg);
surfaceScalarField phiv_pos = U_pos & mesh.Sf(); surfaceScalarField phiv_pos(U_pos & mesh.Sf());
surfaceScalarField phiv_neg = U_neg & mesh.Sf(); surfaceScalarField phiv_neg(U_neg & mesh.Sf());
volScalarField c = sqrt(thermo.Cp()/thermo.Cv()*rPsi); volScalarField c(sqrt(thermo.Cp()/thermo.Cv()*rPsi));
surfaceScalarField cSf_pos = surfaceScalarField cSf_pos
fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf(); (
surfaceScalarField cSf_neg = fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf()
fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf(); );
surfaceScalarField cSf_neg
(
fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf()
);
surfaceScalarField ap = surfaceScalarField ap
max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero); (
surfaceScalarField am = max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero)
min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero); );
surfaceScalarField am
(
min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero)
);
surfaceScalarField a_pos = ap/(ap - am); surfaceScalarField a_pos(ap/(ap - am));
surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap))); surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap)));
@ -112,7 +136,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
surfaceScalarField aSf = am*a_pos; surfaceScalarField aSf(am*a_pos);
if (fluxScheme == "Tadmor") if (fluxScheme == "Tadmor")
{ {
@ -120,24 +144,28 @@ int main(int argc, char *argv[])
a_pos = 0.5; a_pos = 0.5;
} }
surfaceScalarField a_neg = (1.0 - a_pos); surfaceScalarField a_neg(1.0 - a_pos);
phiv_pos *= a_pos; phiv_pos *= a_pos;
phiv_neg *= a_neg; phiv_neg *= a_neg;
surfaceScalarField aphiv_pos = phiv_pos - aSf; surfaceScalarField aphiv_pos(phiv_pos - aSf);
surfaceScalarField aphiv_neg = phiv_neg + aSf; surfaceScalarField aphiv_neg(phiv_neg + aSf);
surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg); surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg);
surfaceVectorField phiUp = surfaceVectorField phiUp
(
(aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg) (aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg)
+ (a_pos*p_pos + a_neg*p_neg)*mesh.Sf(); + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf()
);
surfaceScalarField phiEp = surfaceScalarField phiEp
(
aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos) aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos)
+ aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg) + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg)
+ aSf*p_pos - aSf*p_neg; + aSf*p_pos - aSf*p_neg
);
volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T())); volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T()));
@ -167,7 +195,7 @@ int main(int argc, char *argv[])
} }
// --- Solve energy // --- Solve energy
surfaceScalarField sigmaDotU = surfaceScalarField sigmaDotU
( (
( (
fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U) fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U)

View File

@ -9,7 +9,7 @@ tmp<fvVectorMatrix> UEqn
UEqn().relax(); UEqn().relax();
volScalarField rAU = 1.0/UEqn().A(); volScalarField rAU(1.0/UEqn().A());
if (momentumPredictor) if (momentumPredictor)
{ {

View File

@ -52,5 +52,7 @@
); );
Info<< "Creating field DpDt\n" << endl; Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt = volScalarField DpDt
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); (
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);

View File

@ -12,7 +12,7 @@ UEqn().relax();
mrfZones.addCoriolis(rho, UEqn()); mrfZones.addCoriolis(rho, UEqn());
pZones.addResistance(UEqn()); pZones.addResistance(UEqn());
volScalarField rAU = 1.0/UEqn().A(); volScalarField rAU(1.0/UEqn().A());
if (momentumPredictor) if (momentumPredictor)
{ {

View File

@ -65,8 +65,10 @@
Info<< "Creating field DpDt\n" << endl; Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt = volScalarField DpDt
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); (
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);
MRFZones mrfZones(mesh); MRFZones mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U); mrfZones.correctBoundaryVelocity(U);

View File

@ -1,6 +1,6 @@
rho = thermo.rho(); rho = thermo.rho();
volScalarField rAU = 1.0/UEqn().A(); volScalarField rAU(1.0/UEqn().A());
U = rAU*UEqn().H(); U = rAU*UEqn().H();
if (nCorr <= 1) if (nCorr <= 1)

View File

@ -22,7 +22,7 @@
trTU = inv(tTU()); trTU = inv(tTU());
trTU().rename("rAU"); trTU().rename("rAU");
volVectorField gradp = fvc::grad(p); volVectorField gradp(fvc::grad(p));
for (int UCorr=0; UCorr<nUCorr; UCorr++) for (int UCorr=0; UCorr<nUCorr; UCorr++)
{ {

View File

@ -3,7 +3,7 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax); rho = min(rho, rhoMax);
rho.relax(); rho.relax();
volScalarField rAU = 1.0/UEqn().A(); volScalarField rAU(1.0/UEqn().A());
U = rAU*UEqn().H(); U = rAU*UEqn().H();
UEqn.clear(); UEqn.clear();

View File

@ -3,10 +3,10 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax); rho = min(rho, rhoMax);
rho.relax(); rho.relax();
volScalarField p0 = p; volScalarField p0(p);
volScalarField AU = UEqn().A(); volScalarField AU(UEqn().A());
volScalarField AtU = AU - UEqn().H1(); volScalarField AtU(AU - UEqn().H1());
U = UEqn().H()/AU; U = UEqn().H()/AU;
UEqn.clear(); UEqn.clear();

View File

@ -51,5 +51,7 @@
); );
Info<< "Creating field DpDt\n" << endl; Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt = volScalarField DpDt
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); (
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);

View File

@ -1,6 +1,6 @@
rho = thermo.rho(); rho = thermo.rho();
volScalarField rAU = 1.0/UEqn.A(); volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H(); U = rAU*UEqn.H();
surfaceScalarField phid surfaceScalarField phid

View File

@ -71,7 +71,7 @@ int main(int argc, char *argv[])
for (int corr=0; corr<nCorr; corr++) for (int corr=0; corr<nCorr; corr++)
{ {
volScalarField rAU = 1.0/UEqn.A(); volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H(); U = rAU*UEqn.H();
surfaceScalarField phid surfaceScalarField phid