Commit ef1d4d77 authored by Mark Olesen's avatar Mark Olesen

COMP: fixes for clang compilation

parent 8db9df21
......@@ -49,11 +49,11 @@ Foam::entrainmentModels::Front::Front
(
const word& name,
const dictionary& entrainmentProperties,
const areaVectorField &Us,
const areaScalarField &h,
const areaScalarField &hentrain,
const areaScalarField &pb,
const areaVectorField &tau
const areaVectorField& Us,
const areaScalarField& h,
const areaScalarField& hentrain,
const areaScalarField& pb,
const areaVectorField& tau
)
:
entrainmentModel(name, entrainmentProperties, Us, h, hentrain, pb, tau),
......@@ -67,14 +67,16 @@ Foam::entrainmentModels::Front::Front
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::areaScalarField &Foam::entrainmentModels::Front::Sm() const
const Foam::areaScalarField& Foam::entrainmentModels::Front::Sm() const
{
areaScalarField eflag = pos(h_-htrigger_);
const areaScalarField eflag(pos(h_-htrigger_));
Sm_ = eflag*hentrain_/Us_.db().time().deltaT();
return Sm_;
}
bool Foam::entrainmentModels::Front::read
(
const dictionary& entrainmentProperties
......
......@@ -74,25 +74,27 @@ Foam::entrainmentModels::IsslerFC::IsslerFC
const Foam::areaScalarField &Foam::entrainmentModels::IsslerFC::Sm() const
{
areaScalarField u = mag(Us_);
areaScalarField gs = mag(gs_);
areaScalarField gamma_c =5./2.*u/h_;
areaScalarField uthr = h_*gamma_c*gamma_c/2. *
K_*gamma_c/
(
h_*(gs+mu_*gn_)+4.*K_*gamma_c*gamma_c
);
areaScalarField weinf = (h_*(gs+mu_*gn_)+4*K_*pow(gamma_c,2))/
(
h_*gamma_c+dimensionedScalar("small", dimVelocity, SMALL)
);
const areaScalarField u(mag(Us_));
const areaScalarField gs(mag(gs_));
const areaScalarField gamma_c(5./2.*u/h_);
const areaScalarField uthr
(
h_*gamma_c*gamma_c/2.
* K_*gamma_c
/ ( h_*(gs+mu_*gn_)+4.*K_*gamma_c*gamma_c )
);
const areaScalarField weinf
(
(h_*(gs+mu_*gn_)+4*K_*pow(gamma_c,2))
/ (h_*gamma_c+dimensionedScalar("small", dimVelocity, SMALL))
);
Sm_ = pos(u-uthr)*weinf*(1-uthr/(u+dimensionedScalar("small", dimVelocity, SMALL)));
areaScalarField hlimit = h_*mag(gs_)-(tauc_-5*K_*gamma_c*gamma_c);
areaScalarField hlimit2 = h_-dimensionedScalar("small", dimLength, 1e-2);
const areaScalarField hlimit(h_*mag(gs_)-(tauc_-5*K_*gamma_c*gamma_c));
const areaScalarField hlimit2(h_-dimensionedScalar("small", dimLength, 1e-2));
Sm_ = pos(hlimit2)*pos(hlimit)*Sm_;
......
......@@ -50,11 +50,11 @@ Foam::entrainmentModels::Medina::Medina
(
const word& name,
const dictionary& entrainmentProperties,
const areaVectorField &Us,
const areaScalarField &h,
const areaScalarField &hentrain,
const areaScalarField &pb,
const areaVectorField &tau
const areaVectorField& Us,
const areaScalarField& h,
const areaScalarField& hentrain,
const areaScalarField& pb,
const areaVectorField& tau
)
:
entrainmentModel(name, entrainmentProperties, Us, h, hentrain, pb, tau),
......@@ -74,10 +74,10 @@ Foam::entrainmentModels::Medina::Medina
const Foam::areaScalarField &Foam::entrainmentModels::Medina::Sm() const
{
areaScalarField taures =tauc_ + pb_*mu_;
areaScalarField taures(tauc_ + pb_*mu_);
//no entrainment in "dry" areas:
areaScalarField eflag = pos(h_*rho_*gn_-tauc_/10.);
areaScalarField hent = eflag*(mag(tau_) - taures)/(rho_*(gn_*mu_-mag(gs_)));
areaScalarField eflag(pos(h_*rho_*gn_-tauc_/10.));
areaScalarField hent(eflag*(mag(tau_) - taures)/(rho_*(gn_*mu_-mag(gs_))));
Sm_ = hent/Us_.db().time().deltaT();
Sm_ = max(Sm_, dimensionedScalar("0", dimVelocity, 0.));
......
......@@ -73,14 +73,20 @@ Foam::depositionModels::Stopingprofile::Stopingprofile
const Foam::areaScalarField &Foam::depositionModels::Stopingprofile::Sd() const
{
areaScalarField a = pow(max(min(1. - mag(Us_)/ud_, 1.), 0.), ad_);
const dimensionedScalar smallVel("small", dimVelocity, SMALL);
const dimensionedScalar zeroVel("0", dimVelocity, Zero);
areaScalarField hUddt = (-tau_/rho_+gs_*h_-fac::grad(pb_*h_/(2.*rho_)))//-gn_*h_*gradhentrain_)
&Us_.oldTime()/(mag(Us_.oldTime())+ dimensionedScalar("small", dimVelocity, SMALL));
areaScalarField a(pow(max(min(1. - mag(Us_)/ud_, 1.), 0.), ad_));
areaScalarField hUddt
(
(-tau_/rho_+gs_*h_-fac::grad(pb_*h_/(2.*rho_)))
& Us_.oldTime()/(mag(Us_.oldTime()) + smallVel)
);
hUddt = min(hUddt, 0.);
Sd_ = -a/(mag(Us_.oldTime())+dimensionedScalar("small", dimVelocity, SMALL))*hUddt;
Sd_ = max(Sd_, dimensionedScalar("0", dimVelocity, 0));
Sd_ = -a/(mag(Us_.oldTime())+smallVel)*hUddt;
Sd_ = max(Sd_, zeroVel);
Sd_ = min(Sd_, h_/Us_.db().time().deltaT());
forAll(Sd_, i)
......
......@@ -72,9 +72,7 @@ const Foam::areaVectorField &Foam::frictionModels::DarcyWeisbach::tauSc() const
const Foam::areaScalarField &Foam::frictionModels::DarcyWeisbach::tauSp() const
{
tauSp_ = dimensionedScalar("0", dimensionSet(0, 1, -1, 0, 0, 0, 0), 0);
areaScalarField u = mag(Us_);
tauSp_ += Cf_*g_*u;
tauSp_ += Cf_ * g_ * mag(Us_);
return tauSp_;
}
......
......@@ -63,17 +63,19 @@ Foam::frictionModels::ManningStrickler::ManningStrickler
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::areaVectorField &Foam::frictionModels::ManningStrickler::tauSc() const
const Foam::areaVectorField&
Foam::frictionModels::ManningStrickler::tauSc() const
{
tauSc_ = dimensionedVector("0", dimensionSet(0, 2, -2, 0, 0, 0, 0), vector::zero);
tauSc_ = dimensionedVector("0", dimensionSet(0, 2, -2, 0, 0, 0, 0), Zero);
return tauSc_;
}
const Foam::areaScalarField &Foam::frictionModels::ManningStrickler::tauSp() const
const Foam::areaScalarField&
Foam::frictionModels::ManningStrickler::tauSp() const
{
tauSp_ = dimensionedScalar("0", dimVelocity, 0);
areaScalarField u = mag(Us_);
tauSp_ = dimensionedScalar("0", dimVelocity, Zero);
areaScalarField u(mag(Us_));
tauSp_ += sqr(n_)*g_*(u+u0_)/pow(h_+h0_, 1/3.);
......
......@@ -97,26 +97,39 @@ Foam::frictionModels::PoliquenForterre::PoliquenForterre
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::areaVectorField &Foam::frictionModels::PoliquenForterre::tauSc() const
const Foam::areaVectorField&
Foam::frictionModels::PoliquenForterre::tauSc() const
{
tauSc_ = dimensionedVector("0", dimensionSet(0, 2, -2, 0, 0, 0, 0), vector::zero);
tauSc_ = dimensionedVector
(
"0",
dimensionSet(0, 2, -2, 0, 0, 0, 0),
vector::zero
);
return tauSc_;
}
const Foam::areaScalarField &Foam::frictionModels::PoliquenForterre::tauSp() const
const Foam::areaScalarField&
Foam::frictionModels::PoliquenForterre::tauSp() const
{
tauSp_ = dimensionedScalar("0", dimVelocity, 0);
const areaVectorField &n = Us_.mesh().faceAreaNormals();
const areaScalarField gn = g_&n;
const areaScalarField u = mag(Us_);
const areaVectorField& n = Us_.mesh().faceAreaNormals();
const areaScalarField gn(g_ & n);
const areaScalarField u(mag(Us_));
const areaScalarField Fr = (u+u0_)/sqrt((h_+h0_)*gn);
const areaScalarField hs = h_*beta_/Fr;
const areaScalarField Fr((u+u0_)/sqrt((h_+h0_)*gn));
const areaScalarField hs(h_*beta_/Fr);
const areaScalarField mu_stop = tan(zeta1_)+(tan(zeta2_)-tan(zeta1_))/(1.+hs/L_);
const areaScalarField mu_start = tan(zeta3_)+(tan(zeta2_)-tan(zeta1_))*exp(-hs/L_);
const areaScalarField mu_stop
(
tan(zeta1_)+(tan(zeta2_)-tan(zeta1_))/(1.+hs/L_)
);
const areaScalarField mu_start
(
tan(zeta3_)+(tan(zeta2_)-tan(zeta1_))*exp(-hs/L_)
);
mu_ = mu_stop;
......@@ -124,7 +137,9 @@ const Foam::areaScalarField &Foam::frictionModels::PoliquenForterre::tauSp() con
{
if (Fr[i] < beta_.value())
{
mu_[i] = pow(Fr[i]/beta_.value(), gamma_.value())*(mu_stop[i]-mu_start[i])+mu_start[i];
mu_[i] =
pow(Fr[i]/beta_.value(), gamma_.value())
* (mu_stop[i]-mu_start[i]) + mu_start[i];
}
}
......
......@@ -52,11 +52,10 @@ Foam::frictionModels::Voellmy::Voellmy
:
frictionModel(name, frictionProperties, Us, h, p),
mu_(frictionProperties_.subDict("VoellmyCoeffs").lookup("mu")),
xi_(frictionProperties_.subDict("VoellmyCoeffs").lookup("xi"))
xi_(frictionProperties_.subDict("VoellmyCoeffs").lookup("xi"))
{
Info<< " " << mu_ << endl
<< " " << xi_ << endl << endl;
}
......@@ -73,8 +72,11 @@ const Foam::areaVectorField &Foam::frictionModels::Voellmy::tauSc() const
const Foam::areaScalarField &Foam::frictionModels::Voellmy::tauSp() const
{
tauSp_ = dimensionedScalar("0", dimVelocity, 0);
areaScalarField u = mag(Us_);
dimensionedScalar lambda = rho_*dimensionedScalar("g", dimensionSet(0, 1, -2, 0, 0, 0, 0), 9.81)/xi_;
areaScalarField u(mag(Us_));
dimensionedScalar lambda
(
rho_*dimensionedScalar("g", dimensionSet(0, 1, -2, 0, 0, 0, 0), 9.81)/xi_
);
/*Coulomb Part*/
tauSp_ += 1./rho_ * p_ * mu_ *
......
......@@ -73,8 +73,8 @@ const Foam::areaVectorField &Foam::frictionModels::kt::tauSc() const
const Foam::areaScalarField &Foam::frictionModels::kt::tauSp() const
{
tauSp_ = dimensionedScalar("0", dimVelocity, 0);
areaScalarField u = mag(Us_);
dimensionedScalar lambda = dimensionedScalar("g", dimensionSet(0, 1, -2, 0, 0, 0, 0), 9.81)/chi_;
areaScalarField u(mag(Us_));
dimensionedScalar lambda(dimensionedScalar("g", dimensionSet(0, 1, -2, 0, 0, 0, 0), 9.81)/chi_);
/*Coulomb Part*/
tauSp_ += 1./rho_ * p_ * mu_ *
......
......@@ -92,10 +92,10 @@ const Foam::areaVectorField &Foam::frictionModels::MuI::tauSc() const
const Foam::areaScalarField &Foam::frictionModels::MuI::tauSp() const
{
tauSp_ = dimensionedScalar("0", dimVelocity, 0);
areaScalarField u = mag(Us_);
const areaScalarField u(mag(Us_));
areaScalarField gamma = 5./2.*u/(h_+h0_);
areaScalarField I = gamma*d_/(sqrt(p_/rhop_)+u0_);
const areaScalarField gamma(5./2.*u/(h_+h0_));
const areaScalarField I(gamma*d_/(sqrt(p_/rhop_)+u0_));
mu_ = mus_ + (mu2_-mus_)/(I0_/(I+SMALL)+1.);
......
......@@ -38,9 +38,11 @@ scalar meanCoNum = 0.0;
scalar velMag = 0.0;
if (aMesh.nInternalEdges())
{
edgeScalarField edgeSpeed = (xi*fac::interpolate(Us) & aMesh.Le()/aMesh.magLe())
+Foam::sqrt(max(dimensionedScalar("gh_min", dimensionSet(0, 2, -2, 0, 0, 0, 0), 0), fac::interpolate(h)*fac::interpolate(g&n)));
edgeScalarField edgeSpeed
(
(xi*fac::interpolate(Us) & aMesh.Le()/aMesh.magLe())
+ Foam::sqrt(max(dimensionedScalar("gh_min", dimensionSet(0, 2, -2, 0, 0, 0, 0), 0), fac::interpolate(h)*fac::interpolate(g&n)))
);
velMag = max(edgeSpeed.internalField()).value();
......
......@@ -58,7 +58,6 @@ Foam::elevationModels::SimpleSlope::SimpleSlope
{
alpha_ = alpha_/180.*M_PI;
beta_ = beta_/180.*M_PI;
a_ = a_;
ab_ = b_-a_;
Info << "Creating simple slope, transfer between " << globalZ(a_) << " and " << globalZ(b_) << endl;
......
......@@ -51,7 +51,6 @@ Author
#include "faMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
......
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