BUG: filmTurbulenceModel: fix film friction models

STYLE: filmTurbulenceModel: add default destructor
This commit is contained in:
sergio
2021-08-03 08:27:54 -07:00
committed by Andrew Heather
parent 9024441566
commit eabafe5f9e
2 changed files with 25 additions and 18 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -54,6 +54,7 @@ filmTurbulenceModel::frictionMethodTypeNames_
{ frictionMethodType::mManningStrickler, "ManningStrickler" }
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
filmTurbulenceModel::filmTurbulenceModel
@ -69,12 +70,6 @@ filmTurbulenceModel::filmTurbulenceModel
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
filmTurbulenceModel::~filmTurbulenceModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const liquidFilmBase& filmTurbulenceModel::film() const
@ -99,34 +94,45 @@ tmp<areaScalarField> filmTurbulenceModel::Cw() const
);
auto& Cw = tCw.ref();
switch (method_)
{
case mquadraticProfile:
{
const scalarField& mu = film_.mu().primitiveField();
const scalarField& h = film_.h().primitiveField();
const scalarField& rho = film_.rho().primitiveField();
const scalar h0 = film_.h0().value();
Cw.primitiveFieldRef() = 3*mu/(h + h0);
Cw.primitiveFieldRef() = 3*mu/((h + h0)*rho);
Cw.min(5000.0);
break;
}
case mlinearProfile:
{
const scalarField& mu = film_.mu().primitiveField();
const scalarField& h = film_.h().primitiveField();
const scalarField& rho = film_.rho().primitiveField();
const scalar h0 = film_.h0().value();
Cw.primitiveFieldRef() = 2*mu/(h + h0);
Cw.primitiveFieldRef() = 2*mu/((h + h0)*rho);
break;
}
case mDarcyWeisbach:
{
const uniformDimensionedVectorField& g =
meshObjects::gravity::New(film_.primaryMesh().time());
const vectorField& Uf = film_.Uf().primitiveField();
const scalarField& rho = film_.rho().primitiveField();
const scalar Cf = dict_.get<scalar>("DarcyWeisbach");
Cw.primitiveFieldRef() = Cf*mag(g.value())*mag(Uf)/rho;
scalar Cf = dict_.get<scalar>("Cf");
Cw.primitiveFieldRef() = Cf*mag(g.value())*mag(Uf);
break;
}
case mManningStrickler:
@ -134,14 +140,15 @@ tmp<areaScalarField> filmTurbulenceModel::Cw() const
const uniformDimensionedVectorField& g =
meshObjects::gravity::New(film_.primaryMesh().time());
const scalar n = dict_.get<scalar>("n");
const vectorField& Uf = film_.Uf().primitiveField();
const scalarField& h = film_.h().primitiveField();
const scalar h0 = film_.h0().value();
const scalar n = dict_.get<scalar>("n");
Cw.primitiveFieldRef() =
sqr(n)*mag(g.value())*mag(Uf)/cbrt(h+h0);
sqr(n)*mag(g.value())*mag(Uf)/cbrt(h + h0);
break;
}
default:

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -143,7 +143,7 @@ public:
//- Destructor
virtual ~filmTurbulenceModel();
virtual ~filmTurbulenceModel() = default;
// Member Functions
@ -154,7 +154,7 @@ public:
const liquidFilmBase& film() const;
// Evolution
// Evaluation
//- Return the wall film surface friction
virtual tmp<areaScalarField> Cw() const;