Commit 0b416be9 authored by Henry's avatar Henry
Browse files

Correct for SP compilation

parent 736e4596
......@@ -5,7 +5,7 @@
surfaceScalarField phic("phic", phi);
surfaceScalarField phir("phir", phi1 - phi2);
surfaceScalarField alpha1f(fvc::interpolate(max(alpha1, 0.0)));
surfaceScalarField alpha1f(fvc::interpolate(max(alpha1, scalar(0))));
tmp<surfaceScalarField> pPrimeByA;
......
......@@ -349,7 +349,7 @@ Foam::RASModels::kineticTheoryModel::divDevRhoReff
void Foam::RASModels::kineticTheoryModel::correct()
{
// Local references
volScalarField alpha(max(this->alpha_, 0.0));
volScalarField alpha(max(this->alpha_, scalar(0)));
const volScalarField& rho = phase_.rho();
const surfaceScalarField& alphaPhi = this->alphaPhi_;
const volVectorField& U = this->U_;
......
......@@ -88,7 +88,7 @@ Foam::kineticTheoryModels::radialModels::SinclairJackson::g0prime
{
volScalarField aByaMax
(
cbrt(min(max(alpha, 1e-3), alphaMinFriction)/alphaMax)
cbrt(min(max(alpha, scalar(1e-3)), alphaMinFriction)/alphaMax)
);
return (1.0/(3*alphaMax))/sqr(aByaMax - sqr(aByaMax));
......
......@@ -52,6 +52,9 @@ makeBaseTurbulenceModel
#include "kEpsilon.H"
makeRASModel(kEpsilon);
#include "mixtureKEpsilon.H"
makeRASModel(mixtureKEpsilon);
#include "LaheyKEpsilon.H"
makeRASModel(LaheyKEpsilon);
......
......@@ -200,7 +200,7 @@ NicenoKEqn<BasicTurbulenceModel>::phaseTransferCoeff() const
return
(
max(alphaInversion_ - alpha, 0.0)
max(alphaInversion_ - alpha, scalar(0))
*rho
*min
(
......
......@@ -137,7 +137,7 @@ continuousGasKEqn<BasicTurbulenceModel>::phaseTransferCoeff() const
return
(
max(alphaInversion_ - alpha, 0.0)
max(alphaInversion_ - alpha, scalar(0))
*rho
*min
(
......
......@@ -83,6 +83,16 @@ LaheyKEpsilon<BasicTurbulenceModel>::LaheyKEpsilon
)
),
C3_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Cp",
this->coeffDict_,
this->C2_.value()
)
),
Cmub_
(
dimensioned<scalar>::lookupOrAddToDict
......@@ -110,6 +120,7 @@ bool LaheyKEpsilon<BasicTurbulenceModel>::read()
{
alphaInversion_.readIfPresent(this->coeffDict());
Cp_.readIfPresent(this->coeffDict());
C3_.readIfPresent(this->coeffDict());
Cmub_.readIfPresent(this->coeffDict());
return true;
......@@ -207,7 +218,7 @@ LaheyKEpsilon<BasicTurbulenceModel>::phaseTransferCoeff() const
return
(
max(alphaInversion_ - alpha, 0.0)
max(alphaInversion_ - alpha, scalar(0))
*rho
*min(gasTurbulence.epsilon()/gasTurbulence.k(), 1.0/U.time().deltaT())
);
......@@ -244,7 +255,7 @@ tmp<fvScalarMatrix> LaheyKEpsilon<BasicTurbulenceModel>::epsilonSource() const
const volScalarField phaseTransferCoeff(this->phaseTransferCoeff());
return
alpha*rho*this->C2_*this->epsilon_*bubbleG()/this->k_
alpha*rho*this->C3_*this->epsilon_*bubbleG()/this->k_
+ phaseTransferCoeff*gasTurbulence.epsilon()
- fvm::Sp(phaseTransferCoeff, this->epsilon_);
}
......
......@@ -110,6 +110,7 @@ protected:
dimensionedScalar alphaInversion_;
dimensionedScalar Cp_;
dimensionedScalar C3_;
dimensionedScalar Cmub_;
......
......@@ -123,7 +123,7 @@ void continuousGasKEpsilon<BasicTurbulenceModel>::correctNut()
volScalarField thetal(liquidTurbulence.k()/liquidTurbulence.epsilon());
volScalarField thetag((1.0/(18*liquid.nu()))*sqr(gas.d()));
volScalarField expThetar(exp(min(thetal/thetag, 50.0)));
volScalarField expThetar(exp(min(thetal/thetag, scalar(50))));
volScalarField omega(sqr(expThetar - 1)/(sqr(expThetar) - 1));
nutEff_ = omega*liquidTurbulence.nut();
......@@ -163,7 +163,15 @@ continuousGasKEpsilon<BasicTurbulenceModel>::nuEff() const
{
volScalarField blend
(
max(min((this->alpha_ - 0.5)/(alphaInversion_ - 0.5), 1.0), 0.0)
max
(
min
(
(this->alpha_ - scalar(0.5))/(alphaInversion_ - 0.5),
scalar(1)
),
scalar(0)
)
);
return tmp<volScalarField>
......@@ -210,7 +218,7 @@ continuousGasKEpsilon<BasicTurbulenceModel>::phaseTransferCoeff() const
return
(
max(alphaInversion_ - alpha, 0.0)
max(alphaInversion_ - alpha, scalar(0))
*rho
*min
(
......
......@@ -205,7 +205,7 @@ void Foam::patchInjectionBase::setPositionAndCell
const point pf(tri.randomPoint(rnd));
// position perturbed away from face (into domain)
const scalar a = rnd.position(0.1, 0.5);
const scalar a = rnd.position(scalar(0.1), scalar(0.5));
const vector& pc = mesh.cellCentres()[cellOwner];
const vector d = mag(pf - pc)*patchNormal_[faceI];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment