Removed deprecated nutRoughWallFunction
Replaced by nutkRoughWallFunction
This commit is contained in:
parent
7bc178f100
commit
8612bd74d3
2 changed files with 0 additions and 426 deletions
|
@ -1,241 +0,0 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration | Version: 4.1
|
||||
\\ / A nd | Web: http://www.foam-extend.org
|
||||
\\/ M anipulation | For copyright notice see file Copyright
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "nutRoughWallFunctionFvPatchScalarField.H"
|
||||
#include "RASModel.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "volFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace incompressible
|
||||
{
|
||||
namespace RASModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
scalar nutRoughWallFunctionFvPatchScalarField::fnRough
|
||||
(
|
||||
const scalar KsPlus,
|
||||
const scalar Cs
|
||||
) const
|
||||
{
|
||||
// Return fn based on non-dimensional roughness height
|
||||
|
||||
if (KsPlus < 90.0)
|
||||
{
|
||||
return pow
|
||||
(
|
||||
(KsPlus - 2.25)/87.75 + Cs*KsPlus,
|
||||
sin(0.4258*(log(KsPlus) - 0.811))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (1.0 + Cs*KsPlus);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tmp<scalarField> nutRoughWallFunctionFvPatchScalarField::calcNut() const
|
||||
{
|
||||
const label patchI = patch().index();
|
||||
|
||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
||||
const scalarField& y = rasModel.y()[patchI];
|
||||
const tmp<volScalarField> tk = rasModel.k();
|
||||
const volScalarField& k = tk();
|
||||
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
|
||||
|
||||
const scalar Cmu25 = pow(Cmu_, 0.25);
|
||||
|
||||
tmp<scalarField> tnutw(new scalarField(*this));
|
||||
scalarField& nutw = tnutw();
|
||||
|
||||
forAll(nutw, faceI)
|
||||
{
|
||||
label faceCellI = patch().faceCells()[faceI];
|
||||
|
||||
scalar uStar = Cmu25*sqrt(k[faceCellI]);
|
||||
scalar yPlus = uStar*y[faceI]/nuw[faceI];
|
||||
scalar KsPlus = uStar*Ks_[faceI]/nuw[faceI];
|
||||
|
||||
scalar Edash = E_;
|
||||
|
||||
if (KsPlus > 2.25)
|
||||
{
|
||||
Edash /= fnRough(KsPlus, Cs_[faceI]);
|
||||
}
|
||||
|
||||
if (yPlus > yPlusLam_)
|
||||
{
|
||||
scalar limitingNutw = max(nutw[faceI], nuw[faceI]);
|
||||
|
||||
// To avoid oscillations limit the change in the wall viscosity
|
||||
// which is particularly important if it temporarily becomes zero
|
||||
nutw[faceI] =
|
||||
max
|
||||
(
|
||||
min
|
||||
(
|
||||
nuw[faceI]
|
||||
*(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1),
|
||||
2*limitingNutw
|
||||
), 0.5*limitingNutw
|
||||
);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "yPlus = " << yPlus
|
||||
<< ", KsPlus = " << KsPlus
|
||||
<< ", Edash = " << Edash
|
||||
<< ", nutw = " << nutw[faceI]
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
return tnutw;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
nutWallFunctionFvPatchScalarField(p, iF),
|
||||
Ks_(p.size(), 0.0),
|
||||
Cs_(p.size(), 0.0)
|
||||
{}
|
||||
|
||||
|
||||
nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutRoughWallFunctionFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
|
||||
Ks_(ptf.Ks_, mapper),
|
||||
Cs_(ptf.Cs_, mapper)
|
||||
{}
|
||||
|
||||
|
||||
nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
nutWallFunctionFvPatchScalarField(p, iF, dict),
|
||||
Ks_("Ks", dict, p.size()),
|
||||
Cs_("Cs", dict, p.size())
|
||||
{}
|
||||
|
||||
|
||||
nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutRoughWallFunctionFvPatchScalarField& rwfpsf
|
||||
)
|
||||
:
|
||||
nutWallFunctionFvPatchScalarField(rwfpsf),
|
||||
Ks_(rwfpsf.Ks_),
|
||||
Cs_(rwfpsf.Cs_)
|
||||
{}
|
||||
|
||||
|
||||
nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutRoughWallFunctionFvPatchScalarField& rwfpsf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
nutWallFunctionFvPatchScalarField(rwfpsf, iF),
|
||||
Ks_(rwfpsf.Ks_),
|
||||
Cs_(rwfpsf.Cs_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void nutRoughWallFunctionFvPatchScalarField::autoMap
|
||||
(
|
||||
const fvPatchFieldMapper& m
|
||||
)
|
||||
{
|
||||
nutWallFunctionFvPatchScalarField::autoMap(m);
|
||||
Ks_.autoMap(m);
|
||||
Cs_.autoMap(m);
|
||||
}
|
||||
|
||||
|
||||
void nutRoughWallFunctionFvPatchScalarField::rmap
|
||||
(
|
||||
const fvPatchScalarField& ptf,
|
||||
const labelList& addr
|
||||
)
|
||||
{
|
||||
nutWallFunctionFvPatchScalarField::rmap(ptf, addr);
|
||||
|
||||
const nutRoughWallFunctionFvPatchScalarField& nrwfpsf =
|
||||
refCast<const nutRoughWallFunctionFvPatchScalarField>(ptf);
|
||||
|
||||
Ks_.rmap(nrwfpsf.Ks_, addr);
|
||||
Cs_.rmap(nrwfpsf.Cs_, addr);
|
||||
}
|
||||
|
||||
|
||||
void nutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<scalar>::write(os);
|
||||
writeLocalEntries(os);
|
||||
Cs_.writeEntry("Cs", os);
|
||||
Ks_.writeEntry("Ks", os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeField(fvPatchScalarField, nutRoughWallFunctionFvPatchScalarField);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace RASModels
|
||||
} // End namespace incompressible
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
|
@ -1,185 +0,0 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration | Version: 4.1
|
||||
\\ / A nd | Web: http://www.foam-extend.org
|
||||
\\/ M anipulation | For copyright notice see file Copyright
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::incompressible::RASModels::nutRoughWallFunctionFvPatchScalarField
|
||||
|
||||
Description
|
||||
Boundary condition for turbulent (kinematic) viscosity when using wall
|
||||
functions for rough walls.
|
||||
|
||||
Manipulates the E parameter to account for roughness effects, based on
|
||||
KsPlus.
|
||||
|
||||
- roughness height = sand-grain roughness (0 for smooth walls)
|
||||
- roughness constant = 0.5-1.0 (0.5 default)
|
||||
|
||||
SourceFiles
|
||||
nutRoughWallFunctionFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef nutRoughWallFunctionFvPatchScalarField_H
|
||||
#define nutRoughWallFunctionFvPatchScalarField_H
|
||||
|
||||
#include "nutWallFunctionFvPatchScalarField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace incompressible
|
||||
{
|
||||
namespace RASModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class nutRoughWallFunctionFvPatchScalarField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class nutRoughWallFunctionFvPatchScalarField
|
||||
:
|
||||
public nutWallFunctionFvPatchScalarField
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Roughness height
|
||||
scalarField Ks_;
|
||||
|
||||
//- Roughness constant
|
||||
scalarField Cs_;
|
||||
|
||||
|
||||
// Protected member functions
|
||||
|
||||
//- Compute the roughness function
|
||||
virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const;
|
||||
|
||||
//- Calculate the turbulence viscosity
|
||||
virtual tmp<scalarField> calcNut() const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("nutRoughWallFunction");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
nutRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
nutRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// nutRoughWallFunctionFvPatchScalarField
|
||||
// onto a new patch
|
||||
nutRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutRoughWallFunctionFvPatchScalarField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
nutRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutRoughWallFunctionFvPatchScalarField&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchScalarField> clone() const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new nutRoughWallFunctionFvPatchScalarField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
nutRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutRoughWallFunctionFvPatchScalarField&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchScalarField> clone
|
||||
(
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new nutRoughWallFunctionFvPatchScalarField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Mapping functions
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap(const fvPatchFieldMapper&);
|
||||
|
||||
//- Reverse map the given fvPatchField onto this fvPatchField
|
||||
virtual void rmap
|
||||
(
|
||||
const fvPatchScalarField&,
|
||||
const labelList&
|
||||
);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace RASModels
|
||||
} // End namespace incompressible
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
Reference in a new issue