Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2012-09-17 13:52:31 +01:00
7 changed files with 106 additions and 40 deletions

View File

@ -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
@ -44,7 +44,6 @@ uniformTotalPressureFvPatchScalarField
rhoName_("none"),
psiName_("none"),
gamma_(0.0),
p0_(0.0),
pressure_()
{}
@ -63,7 +62,6 @@ uniformTotalPressureFvPatchScalarField
rhoName_(dict.lookupOrDefault<word>("rho", "none")),
psiName_(dict.lookupOrDefault<word>("psi", "none")),
gamma_(readScalar(dict.lookup("gamma"))),
p0_(readScalar(dict.lookup("p0"))),
pressure_(DataEntry<scalar>::New("pressure", dict))
{
if (dict.found("value"))
@ -75,7 +73,8 @@ uniformTotalPressureFvPatchScalarField
}
else
{
fvPatchField<scalar>::operator=(p0_);
scalar p0 = pressure_->value(this->db().time().timeOutputValue());
fvPatchField<scalar>::operator=(p0);
}
}
@ -95,7 +94,6 @@ uniformTotalPressureFvPatchScalarField
rhoName_(ptf.rhoName_),
psiName_(ptf.psiName_),
gamma_(ptf.gamma_),
p0_(ptf.p0_),
pressure_(ptf.pressure_().clone().ptr())
{}
@ -112,7 +110,6 @@ uniformTotalPressureFvPatchScalarField
rhoName_(tppsf.rhoName_),
psiName_(tppsf.psiName_),
gamma_(tppsf.gamma_),
p0_(tppsf.p0_),
pressure_(tppsf.pressure_().clone().ptr())
{}
@ -130,7 +127,6 @@ uniformTotalPressureFvPatchScalarField
rhoName_(tppsf.rhoName_),
psiName_(tppsf.psiName_),
gamma_(tppsf.gamma_),
p0_(tppsf.p0_),
pressure_(tppsf.pressure_().clone().ptr())
{}
@ -147,14 +143,14 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
return;
}
p0_ = pressure_->value(this->db().time().timeOutputValue());
scalar p0 = pressure_->value(this->db().time().timeOutputValue());
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
if (psiName_ == "none" && rhoName_ == "none")
{
operator==(p0_ - 0.5*(1.0 - pos(phip))*magSqr(Up));
operator==(p0 - 0.5*(1.0 - pos(phip))*magSqr(Up));
}
else if (rhoName_ == "none")
{
@ -167,7 +163,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
operator==
(
p0_
p0
/pow
(
(1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)),
@ -177,7 +173,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
}
else
{
operator==(p0_/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up)));
operator==(p0/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up)));
}
}
else if (psiName_ == "none")
@ -185,7 +181,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(p0_ - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
operator==(p0 - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
}
else
{
@ -219,7 +215,6 @@ void Foam::uniformTotalPressureFvPatchScalarField::write(Ostream& os) const
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
os.writeKeyword("p0") << p0_ << token::END_STATEMENT << nl;
pressure_->writeData(os);
writeEntry("value", os);
}

View File

@ -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
@ -75,9 +75,6 @@ class uniformTotalPressureFvPatchScalarField
//- Heat capacity ratio
scalar gamma_;
//- Total pressure
scalar p0_;
//- Table of time vs total pressure, including the bounding treatment
autoPtr<DataEntry<scalar> > pressure_;
@ -178,18 +175,6 @@ public:
return gamma_;
}
//- Return the total pressure
scalar p0() const
{
return p0_;
}
//- Return reference to the total pressure to allow adjustment
scalar p0()
{
return p0_;
}
// Evaluation functions

View File

@ -636,7 +636,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
*(sum(dMassSRGas) + sum(dMassSRLiquid) + sum(dMassSRSolid))
);
const scalar xsi = min(T/5000.0, 1.0);
const scalar xsi = min(T/td.cloud().constProps().TMax(), 1.0);
const scalar coeff =
(1.0 - xsi*xsi)*td.cloud().constProps().hRetentionCoeff();

View File

@ -108,7 +108,21 @@ public:
//- Return sub-grid disipation rate
virtual tmp<volScalarField> epsilon() const
{
return ce_*k()*sqrt(k())/delta();
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
ce_*k()*sqrt(k())/delta()
)
);
}
//- Return viscosity

View File

@ -109,14 +109,43 @@ public:
//- Return the SGS turbulent kinetic energy
virtual tmp<volScalarField> k() const
{
return 0.5*tr(B_);
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"k",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
0.5*tr(B_)
)
);
}
//- Return the SGS turbulent dissipation
virtual tmp<volScalarField> epsilon() const
{
const volScalarField K(k());
return ce_*K*sqrt(K)/delta();
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
ce_*K*sqrt(K)/delta()
)
);
}
//- Return the SGS viscosity

View File

@ -104,7 +104,21 @@ public:
//- Return sub-grid disipation rate
virtual tmp<volScalarField> epsilon() const
{
return ce_*k()*sqrt(k())/delta();
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
ce_*k()*sqrt(k())/delta()
)
);
}
//- Return the SGS viscosity.

View File

@ -104,14 +104,43 @@ public:
//- Return the SGS turbulent kinetic energy.
virtual tmp<volScalarField> k() const
{
return 0.5*tr(B_);
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"k",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
0.5*tr(B_)
)
);
}
//- Return the SGS turbulent dissipation.
virtual tmp<volScalarField> epsilon() const
{
const volScalarField K(k());
return ce_*K*sqrt(K)/delta();
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
ce_*K*sqrt(K)/delta()
)
);
}
//- Return the SGS viscosity.