Commit cab83f79 authored by mattijs's avatar mattijs
Browse files

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

parents b227751e c80a5643
......@@ -8,6 +8,12 @@ wmakeCheckPwd "$WM_PROJECT_DIR" || {
exit 1
}
[ -n "$FOAM_EXT_LIBBIN" ] || {
echo "Error: FOAM_EXT_LIBBIN not set"
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
# wmake is required for subsequent targets
( cd wmake/src && make )
......
......@@ -8,6 +8,12 @@ wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
exit 1
}
[ -n "$FOAM_EXT_LIBBIN" ] || {
echo "Error: FOAM_EXT_LIBBIN not set"
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
set -x
wmake all utilities
......
......@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
for (int corr=1; corr<=1; corr++)
{
volScalarField rAU = 1.0/UEqn.A();
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
......
......@@ -12,8 +12,10 @@
)
);
volVectorField force =
U/dimensionedScalar("dt", dimTime, runTime.deltaTValue());
volVectorField force
(
U/dimensionedScalar("dt", dimTime, runTime.deltaTValue())
);
Kmesh K(mesh);
UOprocess forceGen(K, runTime.deltaTValue(), turbulenceProperties);
if (runTime.outputTime())
{
volVectorField gradT = fvc::grad(T);
volVectorField gradT(fvc::grad(T));
volScalarField gradTx
(
......
......@@ -34,8 +34,8 @@ namespace XiEqModels
{
defineTypeNameAndDebug(basicSubGrid, 0);
addToRunTimeSelectionTable(XiEqModel, basicSubGrid, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -123,20 +123,24 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
const objectRegistry& db = Su_.db();
const volVectorField& U = db.lookupObject<volVectorField>("U");
volScalarField magU = mag(U);
volVectorField Uhat =
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4));
volScalarField magU(mag(U));
volVectorField Uhat
(
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4))
);
volScalarField n = max(N_ - (Uhat & ns_ & Uhat), scalar(1e-4));
volScalarField n(max(N_ - (Uhat & ns_ & Uhat), scalar(1e-4)));
volScalarField b = (Uhat & B_ & Uhat)/n;
volScalarField b((Uhat & B_ & Uhat)/n);
volScalarField up = sqrt((2.0/3.0)*turbulence_.k());
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
volScalarField XiSubEq =
volScalarField XiSubEq
(
scalar(1)
+ max(2.2*sqrt(b), min(0.34*magU/up, scalar(1.6)))
*min(0.25*n, scalar(1));
*min(0.25*n, scalar(1))
);
return XiSubEq*XiEqModel_->XiEq();
}
......
......@@ -34,8 +34,8 @@ namespace XiGModels
{
defineTypeNameAndDebug(basicSubGrid, 0);
addToRunTimeSelectionTable(XiGModel, basicSubGrid, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......
......@@ -31,7 +31,7 @@ namespace Foam
{
defineTypeNameAndDebug(PDRDragModel, 0);
defineRunTimeSelectionTable(PDRDragModel, dictionary);
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......
......@@ -34,8 +34,8 @@ namespace PDRDragModels
{
defineTypeNameAndDebug(basic, 0);
addToRunTimeSelectionTable(PDRDragModel, basic, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......
......@@ -78,7 +78,7 @@ void PDRkEpsilon::correct()
RASModel::correct();
volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_));
volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_)));
if (mesh_.moving())
{
......@@ -99,7 +99,7 @@ void PDRkEpsilon::correct()
const PDRDragModel& drag =
U_.db().lookupObject<PDRDragModel>("PDRDragModel");
volScalarField GR = drag.Gk();
volScalarField GR(drag.Gk());
// Dissipation equation
tmp<fvScalarMatrix> epsEqn
......
......@@ -34,9 +34,11 @@ Description
if (mesh.nInternalFaces())
{
scalarField sumPhi =
scalarField sumPhi
(
fvc::surfaceSum(mag(phiSt))().internalField()
/rho.internalField();
/ rho.internalField()
);
StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
......
......@@ -7,7 +7,7 @@
betav*rho*g
);
volSymmTensorField invA = inv(I*UEqn.A() + drag->Dcu());
volSymmTensorField invA(inv(I*UEqn.A() + drag->Dcu()));
if (momentumPredictor)
{
......
// Calculate Xi according to the selected flame wrinkling model
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Calculate coefficients for Gulder's flame speed correlation
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField up = uPrimeCoef*sqrt((2.0/3.0)*k);
volScalarField epsilonPlus = pow(uPrimeCoef, 3)*epsilon;
volScalarField tauEta = sqrt(mag(thermo->muu()/(rhou*epsilonPlus)));
volScalarField Reta = up/
(
sqrt(epsilonPlus*tauEta)
+ dimensionedScalar("1e-8", up.dimensions(), 1e-8)
);
else if (XiModel == "algebraic")
{
// Simple algebraic model for Xi based on Gulders correlation
// with a linear correction function to give a plausible profile for Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField GEta = GEtaCoef/tauEta;
volScalarField XiEqEta = 1.0 + XiCoef*sqrt(up/(Su + SuMin))*Reta;
volScalarField R =
GEta*XiEqEta/(XiEqEta - 0.999) + GIn*XiIn/(XiIn - 0.999);
volScalarField XiEqStar = R/(R - GEta - GIn);
//- Calculate the unweighted b
//volScalarField Rrho = thermo->rhou()/thermo->rhob();
//volScalarField bbar = b/(b + (Rrho*(1.0 - b)));
Xi == 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b))*(XiEqStar - 1.0);
}
else if (XiModel == "transport")
{
// Calculate Xi transport coefficients based on Gulders correlation
// and DNS data for the rate of generation
// with a linear correction function to give a plausible profile for Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField GEta = GEtaCoef/tauEta;
volScalarField XiEqEta = 1.0 + XiCoef*sqrt(up/(Su + SuMin))*Reta;
volScalarField R =
GEta*XiEqEta/(XiEqEta - 0.999) + GIn*XiIn/(XiIn - 0.999);
volScalarField XiEqStar = R/(R - GEta - GIn);
volScalarField XiEq =
1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b))*(XiEqStar - 1.0);
volScalarField G = R*(XiEq - 1.0)/XiEq;
// Calculate Xi flux
// ~~~~~~~~~~~~~~~~~
surfaceScalarField phiXi =
phiSt
+ (
- fvc::interpolate(fvc::laplacian(Dbf, b)/mgb)*nf
+ fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf
);
// Solve for the flame wrinkling
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
solve
(
betav*fvm::ddt(rho, Xi)
+ mvConvection->fvmDiv(phi, Xi)
+ fvm::div(phiXi, Xi, "div(phiXi,Xi)")
- fvm::Sp(fvc::div(phiXi), Xi)
==
betav*rho*R
- fvm::Sp(betav*rho*(R - G), Xi)
);
// Correct boundedness of Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~
Xi.max(1.0);
Xi = min(Xi, 2.0*XiEq);
Info<< "max(Xi) = " << max(Xi).value() << endl;
Info<< "max(XiEq) = " << max(XiEq).value() << endl;
}
else
{
FatalError
<< args.executable() << " : Unknown Xi model " << XiModel
<< abort(FatalError);
}
......@@ -34,8 +34,8 @@ namespace XiEqModels
{
defineTypeNameAndDebug(Gulder, 0);
addToRunTimeSelectionTable(XiEqModel, Gulder, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -64,15 +64,18 @@ Foam::XiEqModels::Gulder::~Gulder()
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
{
volScalarField up = sqrt((2.0/3.0)*turbulence_.k());
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
const volScalarField& epsilon = turbulence_.epsilon();
volScalarField tauEta = sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon)));
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
volScalarField Reta = up/
volScalarField Reta
(
sqrt(epsilon*tauEta)
+ dimensionedScalar("1e-8", up.dimensions(), 1e-8)
up
/ (
sqrt(epsilon*tauEta)
+ dimensionedScalar("1e-8", up.dimensions(), 1e-8)
)
);
return 1.0 + XiEqCoef*sqrt(up/(Su_ + SuMin))*Reta;
......
......@@ -34,8 +34,8 @@ namespace XiEqModels
{
defineTypeNameAndDebug(SCOPEBlend, 0);
addToRunTimeSelectionTable(XiEqModel, SCOPEBlend, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......
......@@ -34,8 +34,8 @@ namespace XiEqModels
{
defineTypeNameAndDebug(SCOPEXiEq, 0);
addToRunTimeSelectionTable(XiEqModel, SCOPEXiEq, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -83,13 +83,13 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
const volScalarField& k = turbulence_.k();
const volScalarField& epsilon = turbulence_.epsilon();
volScalarField up = sqrt((2.0/3.0)*k);
volScalarField l = (lCoef*sqrt(3.0/2.0))*up*k/epsilon;
volScalarField Rl = up*l*thermo_.rhou()/thermo_.muu();
volScalarField up(sqrt((2.0/3.0)*k));
volScalarField l((lCoef*sqrt(3.0/2.0))*up*k/epsilon);
volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu());
volScalarField upBySu = up/(Su_ + SuMin);
volScalarField K = 0.157*upBySu/sqrt(Rl);
volScalarField Ma = MaModel.Ma();
volScalarField upBySu(up/(Su_ + SuMin));
volScalarField K(0.157*upBySu/sqrt(Rl));
volScalarField Ma(MaModel.Ma());
tmp<volScalarField> tXiEq
(
......
......@@ -31,7 +31,7 @@ namespace Foam
{
defineTypeNameAndDebug(XiEqModel, 0);
defineRunTimeSelectionTable(XiEqModel, dictionary);
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......
......@@ -34,8 +34,8 @@ namespace XiEqModels
{
defineTypeNameAndDebug(instability, 0);
addToRunTimeSelectionTable(XiEqModel, instability, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -64,7 +64,7 @@ Foam::XiEqModels::instability::~instability()
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::instability::XiEq() const
{
volScalarField turbXiEq = XiEqModel_->XiEq();
volScalarField turbXiEq(XiEqModel_->XiEq());
return XiEqIn/turbXiEq + turbXiEq;
}
......
......@@ -34,8 +34,8 @@ namespace XiGModels
{
defineTypeNameAndDebug(KTS, 0);
addToRunTimeSelectionTable(XiGModel, KTS, dictionary);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -63,10 +63,11 @@ Foam::XiGModels::KTS::~KTS()
Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const
{
volScalarField up = sqrt((2.0/3.0)*turbulence_.k());
// volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
const volScalarField& epsilon = turbulence_.epsilon();
volScalarField tauEta = sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon)));
tmp<volScalarField> tauEta =
sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon)));
return GEtaCoef/tauEta;
}
......
......@@ -31,7 +31,7 @@ namespace Foam
{
defineTypeNameAndDebug(XiGModel, 0);
defineRunTimeSelectionTable(XiGModel, dictionary);
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment