Splitting immersed boundary turbulence libraries to incompressible and compressible; Added compressible wall functions

This commit is contained in:
Hrvoje Jasak 2019-06-18 12:46:03 +01:00
parent 624b6a72b8
commit 94af00fa04
34 changed files with 2398 additions and 1482 deletions

View file

@ -80,7 +80,8 @@ wmake libso solidModels
wmake libso dbns wmake libso dbns
wmake libso immersedBoundary/immersedBoundary wmake libso immersedBoundary/immersedBoundary
wmake libso immersedBoundary/immersedBoundaryTurbulence wmake libso immersedBoundary/immersedBoundaryTurbulence/incompressible
wmake libso immersedBoundary/immersedBoundaryTurbulence/compressible
wmake libso immersedBoundary/immersedBoundaryDynamicMesh wmake libso immersedBoundary/immersedBoundaryDynamicMesh
wmake libso overset/oversetMesh wmake libso overset/oversetMesh

View file

@ -32,3 +32,4 @@
add_subdirectory(immersedBoundary) add_subdirectory(immersedBoundary)
add_subdirectory(immersedBoundaryDynamicMesh) add_subdirectory(immersedBoundaryDynamicMesh)
add_subdirectory(immersedBoundaryTurbulence)

View file

@ -0,0 +1,34 @@
# --------------------------------------------------------------------------
# ======== |
# \ / 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/>.
#
# Description
# CMakeLists.txt file for libraries and applications
#
# Author
# Hrvoje Jasak, Wikki Ltd, 2019. All rights reserved
#
#
# --------------------------------------------------------------------------
add_subdirectory(incompressible)
add_subdirectory(compressible)

View file

@ -0,0 +1,8 @@
wallFunctions/immersedBoundaryKqRWallFunction/immersedBoundaryKqRWallFunctionFvPatchFields.C
wallFunctions/immersedBoundaryEpsilonWallFunction/immersedBoundaryEpsilonWallFunctionFvPatchScalarField.C
wallFunctions/immersedBoundaryOmegaWallFunctions/immersedBoundaryOmegaWallFunctionFvPatchScalarField.C
wallFunctions/immersedBoundaryMutWallFunction/immersedBoundaryMutWallFunctionFvPatchScalarField.C
wallFunctions/immersedBoundaryAlphatWallFunction/immersedBoundaryAlphatWallFunctionFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libcompressibleImmersedBoundaryTurbulence

View file

@ -0,0 +1,17 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/immersedBoundary/immersedBoundary/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-limmersedBoundary \
-lcompressibleTurbulenceModel \
-lbasicThermophysicalModels \
-lspecie

View file

@ -0,0 +1,229 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / 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 "immersedBoundaryAlphatWallFunctionFvPatchScalarField.H"
#include "RASModel.H"
#include "fvPatchFieldMapper.H"
#include "standAlonePatch.H"
#include "surfaceWriter.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace RASModels
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
immersedBoundaryAlphatWallFunctionFvPatchScalarField::
immersedBoundaryAlphatWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
alphatWallFunctionFvPatchScalarField(p, iF),
immersedBoundaryFieldBase<scalar>(p, true, 1e-6)
{}
immersedBoundaryAlphatWallFunctionFvPatchScalarField::
immersedBoundaryAlphatWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
alphatWallFunctionFvPatchScalarField(p, iF), // Do not read mixed data
immersedBoundaryFieldBase<scalar>(p, true, 1e-6)
{
this->readPatchType(dict);
if (!isType<immersedBoundaryFvPatch>(p))
{
FatalIOErrorInFunction(dict)
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalIOError);
}
scalarField::operator=(this->patchInternalField());
}
immersedBoundaryAlphatWallFunctionFvPatchScalarField::
immersedBoundaryAlphatWallFunctionFvPatchScalarField
(
const immersedBoundaryAlphatWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
alphatWallFunctionFvPatchScalarField(p, iF), // Do not map mixed data. Set patchType later
immersedBoundaryFieldBase<scalar>(p, true, 1e-6)
{
// Note: NO MAPPING. Fields are created on the immersed boundary
// HJ, 12/Apr/2012
if (!isType<immersedBoundaryFvPatch>(p))
{
FatalErrorInFunction
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalIOError);
}
this->setPatchType(ptf);
// On creation of the mapped field, the internal field is dummy and
// cannot be used. Initialise the value to avoid errors
// HJ, 1/Dec/2017
scalarField::operator=(scalar(0));
}
immersedBoundaryAlphatWallFunctionFvPatchScalarField::
immersedBoundaryAlphatWallFunctionFvPatchScalarField
(
const immersedBoundaryAlphatWallFunctionFvPatchScalarField& ptf
)
:
alphatWallFunctionFvPatchScalarField(ptf),
immersedBoundaryFieldBase<scalar>(ptf.ibPatch(), true, 1e-6)
{
this->setPatchType(ptf);
}
immersedBoundaryAlphatWallFunctionFvPatchScalarField::
immersedBoundaryAlphatWallFunctionFvPatchScalarField
(
const immersedBoundaryAlphatWallFunctionFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
alphatWallFunctionFvPatchScalarField(ptf, iF),
immersedBoundaryFieldBase<scalar>(ptf.ibPatch(), true, 1e-6)
{
this->setPatchType(ptf);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void immersedBoundaryAlphatWallFunctionFvPatchScalarField::autoMap
(
const fvPatchFieldMapper&
)
{
scalarField::operator=(this->patchInternalField());
}
void immersedBoundaryAlphatWallFunctionFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList&
)
{}
void immersedBoundaryAlphatWallFunctionFvPatchScalarField::updateOnMotion()
{
if (size() != ibPatch().size())
{
// Use internal values, resizing the file if needed
scalarField::operator=(this->patchInternalField());
}
}
void immersedBoundaryAlphatWallFunctionFvPatchScalarField::evaluate
(
const Pstream::commsTypes commsType
)
{
// Resize fields
if (size() != patch().size())
{
Info<< "Resizing immersedBoundaryAlphatWallFunction in evaluate"
<< endl;
scalarField::operator=(patchInternalField());
}
// Get non-constant reference to internal field
scalarField& intField = const_cast<scalarField&>(this->internalField());
// Set dead value
this->setDeadValues(intField);
alphatWallFunctionFvPatchScalarField::evaluate(commsType);
}
void immersedBoundaryAlphatWallFunctionFvPatchScalarField::write
(
Ostream& os
) const
{
fvPatchScalarField::write(os);
writeLocalEntries(os);
// The value entry needs to be written with zero size
scalarField::null().writeEntry("value", os);
// this->writeEntry("value", os);
writeField(*this);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
immersedBoundaryAlphatWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,186 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / 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::compressible::RASModels::immersedBoundaryAlphatWallFunctionFvPatchScalarField
Description
Boundary condition for turbulent (kinematic) viscosity when using wall
functions on immersed boundary patches
- replicates OpenFOAM v1.5 (and earlier) behaviour
SourceFiles
immersedBoundaryAlphatWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef immersedBoundaryAlphatWallFunctionFvPatchScalarField_H
#define immersedBoundaryAlphatWallFunctionFvPatchScalarField_H
#include "alphatWallFunctionFvPatchScalarField.H"
#include "immersedBoundaryFieldBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class immersedBoundaryAlphatWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class immersedBoundaryAlphatWallFunctionFvPatchScalarField
:
public alphatWallFunctionFvPatchScalarField,
public immersedBoundaryFieldBase<scalar>
{
public:
//- Runtime type information
TypeName("immersedBoundaryAlphatWallFunction");
// Constructors
//- Construct from patch and internal field
immersedBoundaryAlphatWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
immersedBoundaryAlphatWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// immersedBoundaryAlphatWallFunctionFvPatchScalarField
// onto a new patch
immersedBoundaryAlphatWallFunctionFvPatchScalarField
(
const immersedBoundaryAlphatWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
immersedBoundaryAlphatWallFunctionFvPatchScalarField
(
const immersedBoundaryAlphatWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new immersedBoundaryAlphatWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
immersedBoundaryAlphatWallFunctionFvPatchScalarField
(
const immersedBoundaryAlphatWallFunctionFvPatchScalarField&,
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 immersedBoundaryAlphatWallFunctionFvPatchScalarField
(
*this,
iF
)
);
}
//- Destructor
virtual ~immersedBoundaryAlphatWallFunctionFvPatchScalarField()
{}
// 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&
);
//- Update on mesh motion
virtual void updateOnMotion();
// Evaluation functions
//- Evaluate the patchField
virtual void evaluate
(
const Pstream::commsTypes = Pstream::blocking
);
// I-O
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -35,7 +35,7 @@ License
namespace Foam namespace Foam
{ {
namespace incompressible namespace compressible
{ {
namespace RASModels namespace RASModels
{ {
@ -279,7 +279,7 @@ makePatchTypeField
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels } // End namespace RASModels
} // End namespace incompressible } // End namespace compressible
} // End namespace Foam } // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View file

@ -0,0 +1,191 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::compressible::RASModels::immersedBoundaryEpsilonWallFunctionFvPatchScalarField
Description
Boundary condition for epsilon when using wall functions
on immersed boundary patches
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved
SourceFiles
immersedBoundaryEpsilonWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef immersedBoundaryEpsilonWallFunctionFvPatchScalarField_H
#define immersedBoundaryEpsilonWallFunctionFvPatchScalarField_H
#include "epsilonWallFunctionFvPatchScalarField.H"
#include "immersedBoundaryFieldBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class immersedBoundaryEpsilonWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class immersedBoundaryEpsilonWallFunctionFvPatchScalarField
:
public epsilonWallFunctionFvPatchScalarField,
public immersedBoundaryFieldBase<scalar>
{
public:
//- Runtime type information
TypeName("compressible::immersedBoundaryEpsilonWallFunction");
// Constructors
//- Construct from patch and internal field
immersedBoundaryEpsilonWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
immersedBoundaryEpsilonWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// immersedBoundaryEpsilonWallFunctionFvPatchScalarField
// onto a new patch
immersedBoundaryEpsilonWallFunctionFvPatchScalarField
(
const immersedBoundaryEpsilonWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
immersedBoundaryEpsilonWallFunctionFvPatchScalarField
(
const immersedBoundaryEpsilonWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new immersedBoundaryEpsilonWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
immersedBoundaryEpsilonWallFunctionFvPatchScalarField
(
const immersedBoundaryEpsilonWallFunctionFvPatchScalarField&,
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 immersedBoundaryEpsilonWallFunctionFvPatchScalarField
(
*this,
iF
)
);
}
//- Destructor
virtual ~immersedBoundaryEpsilonWallFunctionFvPatchScalarField()
{}
// 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&
);
//- Update on mesh motion
virtual void updateOnMotion();
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Evaluate the patchField
virtual void evaluate
(
const Pstream::commsTypes = Pstream::blocking
);
// I-O
//- Write
void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,243 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / 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 "immersedBoundaryKqRWallFunctionFvPatchField.H"
#include "fvPatchFieldMapper.H"
#include "standAlonePatch.H"
#include "surfaceWriter.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace RASModels
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void immersedBoundaryKqRWallFunctionFvPatchField<Type>::checkType()
{
if (!this->patch().isWall())
{
FatalErrorIn("immersedBoundaryKqRWallFunctionFvPatchField::checkType()")
<< "Invalid wall function specification" << nl
<< " Patch type for patch " << this->patch().name()
<< " must be wall" << nl
<< " Current patch type is " << this->patch().type()
<< nl << endl
<< abort(FatalError);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
immersedBoundaryKqRWallFunctionFvPatchField<Type>::
immersedBoundaryKqRWallFunctionFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
kqRWallFunctionFvPatchField<Type>(p, iF),
immersedBoundaryFieldBase<Type>(p, true, pTraits<Type>::one*SMALL)
{
this->checkType();
}
template<class Type>
immersedBoundaryKqRWallFunctionFvPatchField<Type>::
immersedBoundaryKqRWallFunctionFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
kqRWallFunctionFvPatchField<Type>(p, iF), // Do not read mixed data
immersedBoundaryFieldBase<Type>
(
p,
Switch(dict.lookup("setDeadValue")),
pTraits<Type>(dict.lookup("deadValue"))
)
{
this->readPatchType(dict);
this->checkType();
Field<Type>::operator=(this->patchInternalField());
}
template<class Type>
immersedBoundaryKqRWallFunctionFvPatchField<Type>::
immersedBoundaryKqRWallFunctionFvPatchField
(
const immersedBoundaryKqRWallFunctionFvPatchField& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
kqRWallFunctionFvPatchField<Type>(p, iF), // Do not map mixed data. Set patchType later
immersedBoundaryFieldBase<Type>
(
p,
ptf.setDeadValue(),
ptf.deadValue()
)
{
this->setPatchType(ptf);
this->checkType();
// cannot be used. Initialise the value to avoid errors
// HJ, 1/Dec/2017
Field<Type>::operator=(pTraits<Type>::zero);
}
template<class Type>
immersedBoundaryKqRWallFunctionFvPatchField<Type>::
immersedBoundaryKqRWallFunctionFvPatchField
(
const immersedBoundaryKqRWallFunctionFvPatchField& ptf
)
:
kqRWallFunctionFvPatchField<Type>(ptf),
immersedBoundaryFieldBase<Type>
(
ptf.ibPatch(),
ptf.setDeadValue(),
ptf.deadValue()
)
{
this->setPatchType(ptf);
this->checkType();
}
template<class Type>
immersedBoundaryKqRWallFunctionFvPatchField<Type>::
immersedBoundaryKqRWallFunctionFvPatchField
(
const immersedBoundaryKqRWallFunctionFvPatchField& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
kqRWallFunctionFvPatchField<Type>(ptf, iF),
immersedBoundaryFieldBase<Type>
(
ptf.ibPatch(),
ptf.setDeadValue(),
ptf.deadValue()
)
{
this->setPatchType(ptf);
this->checkType();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void immersedBoundaryKqRWallFunctionFvPatchField<Type>::autoMap
(
const fvPatchFieldMapper&
)
{
Field<Type>::operator=(this->patchInternalField());
}
template<class Type>
void immersedBoundaryKqRWallFunctionFvPatchField<Type>::rmap
(
const fvPatchField<Type>& ptf,
const labelList&
)
{}
template<class Type>
void immersedBoundaryKqRWallFunctionFvPatchField<Type>::updateOnMotion()
{
if (this->size() != this->ibPatch().size())
{
// Use internal values, resizing the file if needed
Field<Type>::operator=(this->patchInternalField());
}
}
template<class Type>
void immersedBoundaryKqRWallFunctionFvPatchField<Type>::evaluate
(
const Pstream::commsTypes commsType
)
{
// Resize on evaluation if needed
if (this->size() != this->ibPatch().size())
{
// Use internal values, resizing the file if needed
Field<Type>::operator=(this->patchInternalField());
}
// Get non-constant reference to internal field
Field<Type>& intField = const_cast<Field<Type>&>(this->internalField());
// Set dead value
this->setDeadValues(intField);
kqRWallFunctionFvPatchField<Type>::evaluate(commsType);
}
template<class Type>
void immersedBoundaryKqRWallFunctionFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
this->writeDeadData(os);
// The value entry needs to be written with zero size
Field<Type>::null().writeEntry("value", os);
// this->writeEntry("value", os);
this->writeField(*this);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,194 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / 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::compressible::RASModels::immersedBoundaryKqRWallFunctionFvPatchField
Description
Boundary condition for turbulence k, Q, and R when using wall functions.
Simply acts as a zero gradient condition.
SourceFiles
immersedBoundaryKqRWallFunctionFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef immersedBoundaryKqRWallFunctionFvPatchField_H
#define immersedBoundaryKqRWallFunctionFvPatchField_H
#include "kqRWallFunctionFvPatchFields.H"
#include "immersedBoundaryFieldBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class immersedBoundaryKqRWallFunctionFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class immersedBoundaryKqRWallFunctionFvPatchField
:
public kqRWallFunctionFvPatchField<Type>,
public immersedBoundaryFieldBase<Type>
{
// Private member functions
//- Check the type of the patch
void checkType();
public:
//- Runtime type information
TypeName("compressible::immersedBoundaryKqRWallFunction");
// Constructors
//- Construct from patch and internal field
immersedBoundaryKqRWallFunctionFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
immersedBoundaryKqRWallFunctionFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// immersedBoundaryKqRWallFunctionFvPatchField
// onto a new patch
immersedBoundaryKqRWallFunctionFvPatchField
(
const immersedBoundaryKqRWallFunctionFvPatchField&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
immersedBoundaryKqRWallFunctionFvPatchField
(
const immersedBoundaryKqRWallFunctionFvPatchField&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new immersedBoundaryKqRWallFunctionFvPatchField(*this)
);
}
//- Construct as copy setting internal field reference
immersedBoundaryKqRWallFunctionFvPatchField
(
const immersedBoundaryKqRWallFunctionFvPatchField&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new immersedBoundaryKqRWallFunctionFvPatchField(*this, iF)
);
}
//- Destructor
virtual ~immersedBoundaryKqRWallFunctionFvPatchField()
{}
// 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 fvPatchField<Type>&,
const labelList&
);
//- Update on mesh motion
virtual void updateOnMotion();
// Evaluation functions
//- Evaluate the patchField
virtual void evaluate
(
const Pstream::commsTypes commsType = Pstream::blocking
);
// I-O
//- Write
void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "immersedBoundaryKqRWallFunctionFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / 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 "immersedBoundaryKqRWallFunctionFvPatchFields.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace RASModels
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(immersedBoundaryKqRWallFunction);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,55 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / 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/>.
\*---------------------------------------------------------------------------*/
#ifndef immersedBoundaryKqRWallFunctionFvPatchFields_H
#define immersedBoundaryKqRWallFunctionFvPatchFields_H
#include "immersedBoundaryKqRWallFunctionFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace RASModels
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(immersedBoundaryKqRWallFunction)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,226 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / 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 "immersedBoundaryMutWallFunctionFvPatchScalarField.H"
#include "RASModel.H"
#include "fvPatchFieldMapper.H"
#include "standAlonePatch.H"
#include "surfaceWriter.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace RASModels
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
immersedBoundaryMutWallFunctionFvPatchScalarField::
immersedBoundaryMutWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
mutkWallFunctionFvPatchScalarField(p, iF),
immersedBoundaryFieldBase<scalar>(p, true, 1e-6)
{}
immersedBoundaryMutWallFunctionFvPatchScalarField::
immersedBoundaryMutWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
mutkWallFunctionFvPatchScalarField(p, iF), // Do not read mixed data
immersedBoundaryFieldBase<scalar>(p, true, 1e-6)
{
this->readPatchType(dict);
if (!isType<immersedBoundaryFvPatch>(p))
{
FatalIOErrorInFunction(dict)
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalIOError);
}
scalarField::operator=(this->patchInternalField());
}
immersedBoundaryMutWallFunctionFvPatchScalarField::
immersedBoundaryMutWallFunctionFvPatchScalarField
(
const immersedBoundaryMutWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
mutkWallFunctionFvPatchScalarField(p, iF), // Do not map mixed data. Set patchType later
immersedBoundaryFieldBase<scalar>(p, true, 1e-6)
{
// Note: NO MAPPING. Fields are created on the immersed boundary
// HJ, 12/Apr/2012
if (!isType<immersedBoundaryFvPatch>(p))
{
FatalErrorInFunction
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalIOError);
}
this->setPatchType(ptf);
// On creation of the mapped field, the internal field is dummy and
// cannot be used. Initialise the value to avoid errors
// HJ, 1/Dec/2017
scalarField::operator=(scalar(0));
}
immersedBoundaryMutWallFunctionFvPatchScalarField::
immersedBoundaryMutWallFunctionFvPatchScalarField
(
const immersedBoundaryMutWallFunctionFvPatchScalarField& ptf
)
:
mutkWallFunctionFvPatchScalarField(ptf),
immersedBoundaryFieldBase<scalar>(ptf.ibPatch(), true, 1e-6)
{
this->setPatchType(ptf);
}
immersedBoundaryMutWallFunctionFvPatchScalarField::
immersedBoundaryMutWallFunctionFvPatchScalarField
(
const immersedBoundaryMutWallFunctionFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
mutkWallFunctionFvPatchScalarField(ptf, iF),
immersedBoundaryFieldBase<scalar>(ptf.ibPatch(), true, 1e-6)
{
this->setPatchType(ptf);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void immersedBoundaryMutWallFunctionFvPatchScalarField::autoMap
(
const fvPatchFieldMapper&
)
{
scalarField::operator=(this->patchInternalField());
}
void immersedBoundaryMutWallFunctionFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList&
)
{}
void immersedBoundaryMutWallFunctionFvPatchScalarField::updateOnMotion()
{
if (size() != ibPatch().size())
{
// Use internal values, resizing the file if needed
scalarField::operator=(this->patchInternalField());
}
}
void immersedBoundaryMutWallFunctionFvPatchScalarField::evaluate
(
const Pstream::commsTypes commsType
)
{
// Resize fields
if (size() != patch().size())
{
Info<< "Resizing immersedBoundaryMutWallFunction in evaluate"
<< endl;
scalarField::operator=(patchInternalField());
}
// Get non-constant reference to internal field
scalarField& intField = const_cast<scalarField&>(this->internalField());
// Set dead value
this->setDeadValues(intField);
mutkWallFunctionFvPatchScalarField::evaluate(commsType);
}
void immersedBoundaryMutWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
writeLocalEntries(os);
// The value entry needs to be written with zero size
scalarField::null().writeEntry("value", os);
// this->writeEntry("value", os);
writeField(*this);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
immersedBoundaryMutWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,182 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / 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::compressible::RASModels::immersedBoundaryMutWallFunctionFvPatchScalarField
Description
Boundary condition for turbulent (kinematic) viscosity when using wall
functions on immersed boundary patches
- replicates OpenFOAM v1.5 (and earlier) behaviour
SourceFiles
immersedBoundaryMutWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef immersedBoundaryMutWallFunctionFvPatchScalarField_H
#define immersedBoundaryMutWallFunctionFvPatchScalarField_H
#include "mutkWallFunctionFvPatchScalarField.H"
#include "immersedBoundaryFieldBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class immersedBoundaryMutWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class immersedBoundaryMutWallFunctionFvPatchScalarField
:
public mutkWallFunctionFvPatchScalarField,
public immersedBoundaryFieldBase<scalar>
{
public:
//- Runtime type information
TypeName("immersedBoundaryMutWallFunction");
// Constructors
//- Construct from patch and internal field
immersedBoundaryMutWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
immersedBoundaryMutWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// immersedBoundaryMutWallFunctionFvPatchScalarField
// onto a new patch
immersedBoundaryMutWallFunctionFvPatchScalarField
(
const immersedBoundaryMutWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
immersedBoundaryMutWallFunctionFvPatchScalarField
(
const immersedBoundaryMutWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new immersedBoundaryMutWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
immersedBoundaryMutWallFunctionFvPatchScalarField
(
const immersedBoundaryMutWallFunctionFvPatchScalarField&,
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 immersedBoundaryMutWallFunctionFvPatchScalarField(*this, iF)
);
}
//- Destructor
virtual ~immersedBoundaryMutWallFunctionFvPatchScalarField()
{}
// 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&
);
//- Update on mesh motion
virtual void updateOnMotion();
// Evaluation functions
//- Evaluate the patchField
virtual void evaluate
(
const Pstream::commsTypes = Pstream::blocking
);
// I-O
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,283 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / 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 "immersedBoundaryOmegaWallFunctionFvPatchScalarField.H"
#include "RASModel.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace RASModels
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
immersedBoundaryOmegaWallFunctionFvPatchScalarField::
immersedBoundaryOmegaWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
omegaWallFunctionFvPatchScalarField(p, iF),
immersedBoundaryFieldBase<scalar>(p, true, 90)
{}
immersedBoundaryOmegaWallFunctionFvPatchScalarField::
immersedBoundaryOmegaWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
omegaWallFunctionFvPatchScalarField(p, iF), // Do not read mixed data
immersedBoundaryFieldBase<scalar>
(
p,
Switch(dict.lookup("setDeadValue")),
readScalar(dict.lookup("deadValue"))
)
{
this->readPatchType(dict);
if (!isType<immersedBoundaryFvPatch>(p))
{
FatalIOErrorInFunction(dict)
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalIOError);
}
scalarField::operator=(this->patchInternalField());
}
immersedBoundaryOmegaWallFunctionFvPatchScalarField::
immersedBoundaryOmegaWallFunctionFvPatchScalarField
(
const immersedBoundaryOmegaWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
omegaWallFunctionFvPatchScalarField(p, iF), // Do not map mixed data. Set patchType later
immersedBoundaryFieldBase<scalar>
(
p,
ptf.setDeadValue(),
ptf.deadValue()
)
{
// Note: NO MAPPING. Fields are created on the immersed boundary
// HJ, 12/Apr/2012
if (!isType<immersedBoundaryFvPatch>(p))
{
FatalErrorInFunction
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalIOError);
}
this->setPatchType(ptf);
// On creation of the mapped field, the internal field is dummy and
// cannot be used. Initialise the value to avoid errors
// HJ, 1/Dec/2017
scalarField::operator=(SMALL);
}
immersedBoundaryOmegaWallFunctionFvPatchScalarField::
immersedBoundaryOmegaWallFunctionFvPatchScalarField
(
const immersedBoundaryOmegaWallFunctionFvPatchScalarField& ptf
)
:
omegaWallFunctionFvPatchScalarField(ptf),
immersedBoundaryFieldBase<scalar>
(
ptf.ibPatch(),
ptf.setDeadValue(),
ptf.deadValue()
)
{
this->setPatchType(ptf);
}
immersedBoundaryOmegaWallFunctionFvPatchScalarField::
immersedBoundaryOmegaWallFunctionFvPatchScalarField
(
const immersedBoundaryOmegaWallFunctionFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
omegaWallFunctionFvPatchScalarField(ptf, iF),
immersedBoundaryFieldBase<scalar>
(
ptf.ibPatch(),
ptf.setDeadValue(),
ptf.deadValue()
)
{
this->setPatchType(ptf);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void immersedBoundaryOmegaWallFunctionFvPatchScalarField::autoMap
(
const fvPatchFieldMapper&
)
{
scalarField::operator=(this->patchInternalField());
// Resize refValue as well. HJ, 10/Jul/2018
refValue() = this->patchInternalField();
}
void immersedBoundaryOmegaWallFunctionFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList&
)
{}
void immersedBoundaryOmegaWallFunctionFvPatchScalarField::updateOnMotion()
{
if (size() != ibPatch().size())
{
// Use internal values, resizing the file if needed
scalarField::operator=(this->patchInternalField());
// Resize refValue as well. HJ, 10/Jul/2018
refValue() = this->patchInternalField();
}
}
void immersedBoundaryOmegaWallFunctionFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
// Resize fields
if (size() != this->ibPatch().size())
{
Info<< "Resizing immersedBoundaryOmegaWallFunction in evaluate: "
<< "patch: " << patch().size() << " field: " << size()
<< endl;
*this == patchInternalField();
refValue() = patchInternalField();
}
// If G field is present, execute evaluation
// Remove the warning from the IB patch
// HJ, 20/May/2018
if (db().foundObject<volScalarField>(GName()))
{
omegaWallFunctionFvPatchScalarField::updateCoeffs();
}
}
void immersedBoundaryOmegaWallFunctionFvPatchScalarField::evaluate
(
const Pstream::commsTypes commsType
)
{
// Resize fields
if (size() != this->ibPatch().size())
{
Info<< "Resizing immersedBoundaryOmegaWallFunction in evaluate"
<< endl;
*this == patchInternalField();
refValue() = patchInternalField();
}
// Get non-constant reference to internal field
scalarField& intField = const_cast<scalarField&>(this->internalField());
// Set dead value
this->setDeadValues(intField);
omegaWallFunctionFvPatchScalarField::evaluate(commsType);
}
void immersedBoundaryOmegaWallFunctionFvPatchScalarField::write
(
Ostream& os
) const
{
fvPatchScalarField::write(os);
writeLocalEntries(os);
this->writeDeadData(os);
// The value entry needs to be written with zero size
scalarField::null().writeEntry("value", os);
// this->writeEntry("value", os);
writeField(*this);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
immersedBoundaryOmegaWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,205 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / 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::compressible::RASModels::omegaWallFunctionFvPatchScalarField
Description
Provides a wall function boundary condition/constraint on omega
Computed value is:
omega = sqrt(omega_vis^2 + omega_log^2)
where
omega_vis = omega in viscous region
omega_log = omega in logarithmic region
Model described by Eq.(15) of:
@verbatim
Menter, F., Esch, T.
"Elements of Industrial Heat Transfer Prediction"
16th Brazilian Congress of Mechanical Engineering (COBEM),
Nov. 2001
@endverbatim
Description
Boundary condition for omega when using wall functions
on immersed boundary patches
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved
SourceFiles
immersedBoundaryOmegaWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef immersedBoundaryOmegaWallFunctionFvPatchScalarField_H
#define immersedBoundaryOmegaWallFunctionFvPatchScalarField_H
#include "omegaWallFunctionFvPatchScalarField.H"
#include "immersedBoundaryFieldBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class immersedBoundaryOmegaWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class immersedBoundaryOmegaWallFunctionFvPatchScalarField
:
public omegaWallFunctionFvPatchScalarField,
public immersedBoundaryFieldBase<scalar>
{
public:
//- Runtime type information
TypeName("compressible::immersedBoundaryOmegaWallFunction");
// Constructors
//- Construct from patch and internal field
immersedBoundaryOmegaWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
immersedBoundaryOmegaWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// immersedBoundaryOmegaWallFunctionFvPatchScalarField
// onto a new patch
immersedBoundaryOmegaWallFunctionFvPatchScalarField
(
const immersedBoundaryOmegaWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
immersedBoundaryOmegaWallFunctionFvPatchScalarField
(
const immersedBoundaryOmegaWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new immersedBoundaryOmegaWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
immersedBoundaryOmegaWallFunctionFvPatchScalarField
(
const immersedBoundaryOmegaWallFunctionFvPatchScalarField&,
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 immersedBoundaryOmegaWallFunctionFvPatchScalarField
(
*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&
);
//- Update on mesh motion
virtual void updateOnMotion();
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Evaluate the patchField
virtual void evaluate
(
const Pstream::commsTypes = Pstream::blocking
);
// I-O
//- Write
void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -3,7 +3,4 @@ wallFunctions/immersedBoundaryNutWallFunction/immersedBoundaryNutWallFunctionFvP
wallFunctions/immersedBoundaryEpsilonWallFunction/immersedBoundaryEpsilonWallFunctionFvPatchScalarField.C wallFunctions/immersedBoundaryEpsilonWallFunction/immersedBoundaryEpsilonWallFunctionFvPatchScalarField.C
wallFunctions/immersedBoundaryOmegaWallFunctions/immersedBoundaryOmegaWallFunctionFvPatchScalarField.C wallFunctions/immersedBoundaryOmegaWallFunctions/immersedBoundaryOmegaWallFunctionFvPatchScalarField.C
turbulenceModels/incompressible/RAS/backwardsCompability/wallFunctions/backwardsCompatibilityIbWallFunctions.C LIB = $(FOAM_LIBBIN)/libincompressibleImmersedBoundaryTurbulence
turbulenceModels/incompressible/RAS/immersedBoundaryKOmegaSST/immersedBoundaryKOmegaSST.C
LIB = $(FOAM_LIBBIN)/libimmersedBoundaryTurbulence

View file

@ -0,0 +1,289 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "immersedBoundaryEpsilonWallFunctionFvPatchScalarField.H"
#include "RASModel.H"
#include "fvPatchFieldMapper.H"
#include "standAlonePatch.H"
#include "surfaceWriter.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace incompressible
{
namespace RASModels
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
immersedBoundaryEpsilonWallFunctionFvPatchScalarField::
immersedBoundaryEpsilonWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
epsilonWallFunctionFvPatchScalarField(p, iF),
immersedBoundaryFieldBase<scalar>(p, true, 0.09)
{}
immersedBoundaryEpsilonWallFunctionFvPatchScalarField::
immersedBoundaryEpsilonWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
epsilonWallFunctionFvPatchScalarField(p, iF), // Do not read mixed data
immersedBoundaryFieldBase<scalar>
(
p,
Switch(dict.lookup("setDeadValue")),
readScalar(dict.lookup("deadValue"))
)
{
// Since patch does not read a dictionary, the patch type needs to be read
// manually. HJ, 6/Sep/2018
this->readPatchType(dict);
if (!isType<immersedBoundaryFvPatch>(p))
{
FatalIOErrorInFunction(dict)
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalIOError);
}
scalarField::operator=(this->patchInternalField());
}
immersedBoundaryEpsilonWallFunctionFvPatchScalarField::
immersedBoundaryEpsilonWallFunctionFvPatchScalarField
(
const immersedBoundaryEpsilonWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
epsilonWallFunctionFvPatchScalarField(p, iF), // Do not map mixed data. Set patchType later
immersedBoundaryFieldBase<scalar>
(
p,
ptf.setDeadValue(),
ptf.deadValue()
)
{
// Note: NO MAPPING. Fields are created on the immersed boundary
// HJ, 12/Apr/2012
if (!isType<immersedBoundaryFvPatch>(p))
{
FatalErrorInFunction
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalIOError);
}
// Copy the patch type since mixed data was not mapped
this->setPatchType(ptf);
// On creation of the mapped field, the internal field is dummy and
// cannot be used. Initialise the value to avoid errors
// HJ, 1/Dec/2017
scalarField::operator=(SMALL);
}
immersedBoundaryEpsilonWallFunctionFvPatchScalarField::
immersedBoundaryEpsilonWallFunctionFvPatchScalarField
(
const immersedBoundaryEpsilonWallFunctionFvPatchScalarField& ptf
)
:
epsilonWallFunctionFvPatchScalarField(ptf),
immersedBoundaryFieldBase<scalar>
(
ptf.ibPatch(),
ptf.setDeadValue(),
ptf.deadValue()
)
{}
immersedBoundaryEpsilonWallFunctionFvPatchScalarField::
immersedBoundaryEpsilonWallFunctionFvPatchScalarField
(
const immersedBoundaryEpsilonWallFunctionFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
epsilonWallFunctionFvPatchScalarField(ptf, iF),
immersedBoundaryFieldBase<scalar>
(
ptf.ibPatch(),
ptf.setDeadValue(),
ptf.deadValue()
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void immersedBoundaryEpsilonWallFunctionFvPatchScalarField::autoMap
(
const fvPatchFieldMapper&
)
{
scalarField::operator=(this->patchInternalField());
// Resize refValue as well. HJ, 10/Jul/2018
refValue() = this->patchInternalField();
}
void immersedBoundaryEpsilonWallFunctionFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList&
)
{}
void immersedBoundaryEpsilonWallFunctionFvPatchScalarField::updateOnMotion()
{
if (size() != ibPatch().size())
{
// Use internal values, resizing the file if needed
scalarField::operator=(this->patchInternalField());
// Resize refValue as well. HJ, 10/Jul/2018
refValue() = this->patchInternalField();
}
}
void immersedBoundaryEpsilonWallFunctionFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
// Resize fields
if (size() != patch().size())
{
Info<< "Resizing immersedBoundaryEpsilonWallFunction in evaluate: "
<< "patch: " << patch().size() << " field: " << size()
<< endl;
*this == patchInternalField();
refValue() = patchInternalField();
}
// If G field is present, execute evaluation
// Remove the warning from the IB patch
// HJ, 20/May/2018
if (db().foundObject<volScalarField>(GName()))
{
epsilonWallFunctionFvPatchScalarField::updateCoeffs();
}
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patch().index()];
Info<< "Patch y: (" << min(y) << " " << max(y) << ")" << endl;
}
void immersedBoundaryEpsilonWallFunctionFvPatchScalarField::evaluate
(
const Pstream::commsTypes commsType
)
{
// Resize fields
if (size() != patch().size())
{
Info<< "Resizing immersedBoundaryEpsilonWallFunction in evaluate"
<< endl;
*this == patchInternalField();
refValue() = patchInternalField();
}
// Get non-constant reference to internal field
scalarField& intField = const_cast<scalarField&>(this->internalField());
// Set dead value
this->setDeadValues(intField);
epsilonWallFunctionFvPatchScalarField::evaluate(commsType);
}
void immersedBoundaryEpsilonWallFunctionFvPatchScalarField::write
(
Ostream& os
) const
{
fvPatchScalarField::write(os);
writeLocalEntries(os);
this->writeDeadData(os);
// The value entry needs to be written with zero size
scalarField::null().writeEntry("value", os);
// this->writeEntry("value", os);
writeField(*this);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
immersedBoundaryEpsilonWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace incompressible
} // End namespace Foam
// ************************************************************************* //

View file

@ -182,7 +182,7 @@ void immersedBoundaryNutWallFunctionFvPatchScalarField::evaluate
Info<< "Resizing immersedBoundaryNutWallFunction in evaluate" Info<< "Resizing immersedBoundaryNutWallFunction in evaluate"
<< endl; << endl;
*this == patchInternalField(); scalarField::operator=(patchInternalField());
} }
// Get non-constant reference to internal field // Get non-constant reference to internal field

View file

@ -1,336 +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 "backwardsCompatibilityIbWallFunctions.H"
#include "calculatedFvPatchField.H"
#include "nutkWallFunctionFvPatchScalarField.H"
#include "nutLowReWallFunctionFvPatchScalarField.H"
#include "epsilonWallFunctionFvPatchScalarField.H"
#include "kqRWallFunctionFvPatchField.H"
#include "RWallFunctionFvPatchSymmTensorField.H"
#include "omegaWallFunctionFvPatchScalarField.H"
#include "immersedBoundaryEpsilonWallFunctionFvPatchScalarField.H"
#include "immersedBoundaryKqRWallFunctionFvPatchField.H"
#include "immersedBoundaryOmegaWallFunctionFvPatchScalarField.H"
#include "immersedBoundaryNutWallFunctionFvPatchScalarField.H"
#include "immersedBoundaryFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace incompressible
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
tmp<volScalarField> autoCreateIbNut
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
)
{
IOobject nutHeader
(
fieldName,
mesh.time().timeName(),
obj,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
if (nutHeader.headerOk())
{
return tmp<volScalarField>(new volScalarField(nutHeader, mesh));
}
else
{
Info<< "--> Creating " << fieldName
<< " to employ run-time selectable wall functions" << endl;
const fvBoundaryMesh& bm = mesh.boundary();
wordList nutBoundaryTypes(bm.size());
forAll(bm, patchI)
{
if (isA<immersedBoundaryFvPatch>(bm[patchI]) && bm[patchI].isWall())
{
nutBoundaryTypes[patchI] =
RASModels::immersedBoundaryNutWallFunctionFvPatchScalarField::typeName;
}
else if (bm[patchI].isWall())
{
nutBoundaryTypes[patchI] =
RASModels::nutkWallFunctionFvPatchScalarField::typeName;
}
else
{
nutBoundaryTypes[patchI] =
calculatedFvPatchField<scalar>::typeName;
}
}
tmp<volScalarField> nut
(
new volScalarField
(
IOobject
(
fieldName,
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("zero", dimArea/dimTime, 0.0),
nutBoundaryTypes
)
);
Info<< " Writing new " << fieldName << endl;
nut().write();
return nut;
}
}
tmp<volScalarField> autoCreateIbNut
(
const word& fieldName,
const fvMesh& mesh
)
{
return autoCreateIbNut(fieldName, mesh, mesh);
}
tmp<volScalarField> autoCreateIbEpsilon
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
)
{
return
autoCreateWallFunctionField
<
scalar,
RASModels::epsilonWallFunctionFvPatchScalarField,
RASModels::immersedBoundaryEpsilonWallFunctionFvPatchScalarField
>
(
fieldName,
mesh,
obj
);
}
tmp<volScalarField> autoCreateIbEpsilon
(
const word& fieldName,
const fvMesh& mesh
)
{
return
autoCreateWallFunctionField
<
scalar,
RASModels::epsilonWallFunctionFvPatchScalarField,
RASModels::immersedBoundaryEpsilonWallFunctionFvPatchScalarField
>
(
fieldName,
mesh,
mesh
);
}
tmp<volScalarField> autoCreateIbOmega
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
)
{
return
autoCreateWallFunctionField
<
scalar,
RASModels::omegaWallFunctionFvPatchScalarField,
RASModels::immersedBoundaryOmegaWallFunctionFvPatchScalarField
>
(
fieldName,
mesh,
obj
);
}
tmp<volScalarField> autoCreateIbOmega
(
const word& fieldName,
const fvMesh& mesh
)
{
return
autoCreateWallFunctionField
<
scalar,
RASModels::omegaWallFunctionFvPatchScalarField,
RASModels::immersedBoundaryOmegaWallFunctionFvPatchScalarField
>
(
fieldName,
mesh,
mesh
);
}
tmp<volScalarField> autoCreateIbK
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
)
{
return
autoCreateWallFunctionField
<
scalar,
RASModels::kqRWallFunctionFvPatchField<scalar>,
RASModels::immersedBoundaryKqRWallFunctionFvPatchField<scalar>
>
(
fieldName,
mesh,
obj
);
}
tmp<volScalarField> autoCreateIbK
(
const word& fieldName,
const fvMesh& mesh
)
{
return
autoCreateWallFunctionField
<
scalar,
RASModels::kqRWallFunctionFvPatchField<scalar>,
RASModels::immersedBoundaryKqRWallFunctionFvPatchField<scalar>
>
(
fieldName,
mesh,
mesh
);
}
tmp<volScalarField> autoCreateIbQ
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
)
{
return
autoCreateWallFunctionField
<
scalar,
RASModels::kqRWallFunctionFvPatchField<scalar>,
RASModels::immersedBoundaryKqRWallFunctionFvPatchField<scalar>
>
(
fieldName,
mesh,
obj
);
}
tmp<volScalarField> autoCreateIbQ
(
const word& fieldName,
const fvMesh& mesh
)
{
return
autoCreateWallFunctionField
<
scalar,
RASModels::kqRWallFunctionFvPatchField<scalar>,
RASModels::immersedBoundaryKqRWallFunctionFvPatchField<scalar>
>
(
fieldName,
mesh,
mesh
);
}
tmp<volSymmTensorField> autoCreateIbR
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
)
{
return
autoCreateWallFunctionField
<
symmTensor,
RASModels::kqRWallFunctionFvPatchField<symmTensor>,
RASModels::immersedBoundaryKqRWallFunctionFvPatchField<symmTensor>
>
(
fieldName,
mesh,
obj
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace incompressible
} // End namespace Foam
// ************************************************************************* //

View file

@ -1,158 +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
Description
Auto creation of fields to provide backwards compatibility with
runtime selectable wall functions
SourceFiles
backwardsCompatibilityIbWallFunctions.C
backwardsCompatibilityIbWallFunctionsTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef backwardsCompatibilityIbWallFunctions_H
#define backwardsCompatibilityIbWallFunctions_H
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace incompressible
{
//- nut
tmp<volScalarField> autoCreateIbNut
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
);
tmp<volScalarField> autoCreateIbNut
(
const word& fieldName,
const fvMesh& mesh
);
//- epsilon
tmp<volScalarField> autoCreateIbEpsilon
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
);
tmp<volScalarField> autoCreateIbEpsilon
(
const word& fieldName,
const fvMesh& mesh
);
//- omega
tmp<volScalarField> autoCreateIbOmega
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
);
tmp<volScalarField> autoCreateIbOmega
(
const word& fieldName,
const fvMesh& mesh
);
//- k
tmp<volScalarField> autoCreateIbK
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
);
tmp<volScalarField> autoCreateIbK
(
const word& fieldName,
const fvMesh& mesh
);
//- Q
tmp<volScalarField> autoCreateIbQ
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
);
tmp<volScalarField> autoCreateIbQ
(
const word& fieldName,
const fvMesh& mesh
);
//- R
tmp<volSymmTensorField> autoCreateIbR
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
);
tmp<volSymmTensorField> autoCreateIbR
(
const word& fieldName,
const fvMesh& mesh
);
//- Helper function to create the new field
template<class Type, class PatchType, class ibPatchName >
tmp<GeometricField<Type, fvPatchField, volMesh> >
autoCreateIbWallFunctionField
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace incompressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "backwardsCompatibilityIbWallFunctionsTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -1,184 +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 "backwardsCompatibilityIbWallFunctions.H"
#include "foamTime.H"
#include "OSspecific.H"
#include "immersedBoundaryFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace incompressible
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type, class PatchType, class ibPatchType>
tmp<GeometricField<Type, fvPatchField, volMesh> >
autoCreateWallFunctionField
(
const word& fieldName,
const fvMesh& mesh,
const objectRegistry& obj
)
{
IOobject nutHeader
(
"nut",
mesh.time().timeName(),
obj,
IOobject::MUST_READ
);
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
if (nutHeader.headerOk())
{
return tmp<fieldType>
(
new fieldType
(
IOobject
(
fieldName,
mesh.time().timeName(),
obj,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
),
mesh
)
);
}
else
{
Info<< "--> Upgrading " << fieldName
<< " to employ run-time selectable wall functions" << endl;
// Read existing field
IOobject ioObj
(
fieldName,
mesh.time().timeName(),
obj,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
tmp<fieldType> fieldOrig
(
new fieldType
(
ioObj,
mesh
)
);
// rename file
Info<< " Backup original " << fieldName << " to "
<< fieldName << ".old" << endl;
mvBak(ioObj.objectPath(), "old");
PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size());
const fvBoundaryMesh& bm = mesh.boundary();
forAll(newPatchFields, patchI)
{
if (isA<immersedBoundaryFvPatch>(bm[patchI]) && bm[patchI].isWall())
{
newPatchFields.set
(
patchI,
new ibPatchType
(
mesh.boundary()[patchI],
fieldOrig().dimensionedInternalField()
)
);
newPatchFields[patchI] == fieldOrig().boundaryField()[patchI];
}
else if (bm[patchI].isWall())
{
newPatchFields.set
(
patchI,
new PatchType
(
mesh.boundary()[patchI],
fieldOrig().dimensionedInternalField()
)
);
newPatchFields[patchI] == fieldOrig().boundaryField()[patchI];
}
else
{
newPatchFields.set
(
patchI,
fieldOrig().boundaryField()[patchI].clone()
);
}
}
tmp<fieldType> fieldNew
(
new fieldType
(
IOobject
(
fieldName,
mesh.time().timeName(),
obj,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
fieldOrig().dimensions(),
fieldOrig().internalField(),
newPatchFields
)
);
Info<< " Writing updated " << fieldName << endl;
fieldNew().write();
return fieldNew;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace incompressible
} // End namespace Foam
// ************************************************************************* //

View file

@ -1,483 +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 "immersedBoundaryKOmegaSST.H"
#include "addToRunTimeSelectionTable.H"
#include "backwardsCompatibilityIbWallFunctions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace incompressible
{
namespace RASModels
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(immersedBoundaryKOmegaSST, 0);
addToRunTimeSelectionTable(RASModel, immersedBoundaryKOmegaSST, dictionary);
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
tmp<volScalarField> immersedBoundaryKOmegaSST::F1
(
const volScalarField& CDkOmega
) const
{
volScalarField CDkOmegaPlus = max
(
CDkOmega,
dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10)
);
volScalarField arg1 = min
(
min
(
max
(
(scalar(1)/betaStar_)*sqrt(k_)/(omega_*y_),
scalar(500)*nu()/(sqr(y_)*omega_)
),
(4*alphaOmega2_)*k_/(CDkOmegaPlus*sqr(y_))
),
scalar(10)
);
return tanh(pow4(arg1));
}
tmp<volScalarField> immersedBoundaryKOmegaSST::F2() const
{
volScalarField arg2 = min
(
max
(
(scalar(2)/betaStar_)*sqrt(k_)/(omega_*y_),
scalar(500)*nu()/(sqr(y_)*omega_)
),
scalar(100)
);
return tanh(sqr(arg2));
}
tmp<volScalarField> immersedBoundaryKOmegaSST::F3() const
{
tmp<volScalarField> arg3 = min
(
150*nu()/(omega_*sqr(y_)),
scalar(10)
);
return 1 - tanh(pow4(arg3));
}
tmp<volScalarField> immersedBoundaryKOmegaSST::F23() const
{
tmp<volScalarField> f23(F2());
if (F3_)
{
f23() *= F3();
}
return f23;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
immersedBoundaryKOmegaSST::immersedBoundaryKOmegaSST
(
const volVectorField& U,
const surfaceScalarField& phi,
transportModel& transport,
const word& turbulenceModelName,
const word& modelName
)
:
RASModel(modelName, U, phi, transport, turbulenceModelName),
alphaK1_
(
dimensionedScalar::lookupOrAddToDict
(
"alphaK1",
coeffDict_,
0.85
)
),
alphaK2_
(
dimensionedScalar::lookupOrAddToDict
(
"alphaK2",
coeffDict_,
1.0
)
),
alphaOmega1_
(
dimensionedScalar::lookupOrAddToDict
(
"alphaOmega1",
coeffDict_,
0.5
)
),
alphaOmega2_
(
dimensionedScalar::lookupOrAddToDict
(
"alphaOmega2",
coeffDict_,
0.856
)
),
gamma1_
(
dimensionedScalar::lookupOrAddToDict
(
"gamma1",
coeffDict_,
5.0/9.0
)
),
gamma2_
(
dimensionedScalar::lookupOrAddToDict
(
"gamma2",
coeffDict_,
0.44
)
),
beta1_
(
dimensionedScalar::lookupOrAddToDict
(
"beta1",
coeffDict_,
0.075
)
),
beta2_
(
dimensionedScalar::lookupOrAddToDict
(
"beta2",
coeffDict_,
0.0828
)
),
betaStar_
(
dimensionedScalar::lookupOrAddToDict
(
"betaStar",
coeffDict_,
0.09
)
),
a1_
(
dimensionedScalar::lookupOrAddToDict
(
"a1",
coeffDict_,
0.31
)
),
b1_
(
dimensionedScalar::lookupOrAddToDict
(
"b1",
coeffDict_,
1.0
)
),
c1_
(
dimensionedScalar::lookupOrAddToDict
(
"c1",
coeffDict_,
10.0
)
),
F3_
(
Switch::lookupOrAddToDict
(
"F3",
coeffDict_,
false
)
),
y_(mesh_),
k_
(
IOobject
(
"k",
runTime_.timeName(),
U_.db(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
autoCreateIbK("k", mesh_, U_.db())
),
omega_
(
IOobject
(
"omega",
runTime_.timeName(),
U_.db(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
autoCreateIbOmega("omega", mesh_, U_.db())
),
nut_
(
IOobject
(
"nut",
runTime_.timeName(),
U_.db(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
autoCreateIbNut("nut", mesh_, U_.db())
)
{
bound(k_, k0_);
bound(omega_, omega0_);
nut_ =
(
a1_*k_/
max
(
a1_*omega_,
b1_*F23()*sqrt(2.0)*mag(symm(fvc::grad(U_)))
)
);
nut_.correctBoundaryConditions();
printCoeffs();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<volSymmTensorField> immersedBoundaryKOmegaSST::R() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"R",
runTime_.timeName(),
U_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)),
k_.boundaryField().types()
)
);
}
tmp<volSymmTensorField> immersedBoundaryKOmegaSST::devReff() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"devRhoReff",
runTime_.timeName(),
U_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
-nuEff()*dev(twoSymm(fvc::grad(U_)))
)
);
}
tmp<fvVectorMatrix> immersedBoundaryKOmegaSST::divDevReff() const
{
const volScalarField nuEffective = nuEff();
return
(
- fvm::laplacian(nuEffective, U_)
- (fvc::grad(U_) & fvc::grad(nuEffective))
);
}
bool immersedBoundaryKOmegaSST::read()
{
if (RASModel::read())
{
alphaK1_.readIfPresent(coeffDict());
alphaK2_.readIfPresent(coeffDict());
alphaOmega1_.readIfPresent(coeffDict());
alphaOmega2_.readIfPresent(coeffDict());
gamma1_.readIfPresent(coeffDict());
gamma2_.readIfPresent(coeffDict());
beta1_.readIfPresent(coeffDict());
beta2_.readIfPresent(coeffDict());
betaStar_.readIfPresent(coeffDict());
a1_.readIfPresent(coeffDict());
b1_.readIfPresent(coeffDict());
c1_.readIfPresent(coeffDict());
F3_.readIfPresent("F3", coeffDict());
return true;
}
else
{
return false;
}
}
void immersedBoundaryKOmegaSST::correct()
{
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(omega_, omega0_);
}
RASModel::correct();
if (!turbulence_)
{
return;
}
if (mesh_.changing())
{
y_.correct();
}
const volScalarField S2(2*magSqr(symm(fvc::grad(U_))));
volScalarField G("RASModel::G", nut_*S2);
// Update omega and G at the wall
omega_.boundaryField().updateCoeffs();
const volScalarField CDkOmega
(
(2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_
);
const volScalarField F1(this->F1(CDkOmega));
// Turbulent frequency equation
fvScalarMatrix omegaEqn
(
fvm::ddt(omega_)
+ fvm::div(phi_, omega_)
+ fvm::SuSp(-fvc::div(phi_), omega_)
- fvm::laplacian(DomegaEff(F1), omega_)
==
gamma(F1)
*min
(
S2,
(c1_/a1_)*betaStar_*omega_*max(a1_*omega_, b1_*F23()*sqrt(S2))
)
- fvm::Sp(beta(F1)*omega_, omega_)
- fvm::SuSp
(
(F1 - scalar(1))*CDkOmega/omega_,
omega_
)
);
omegaEqn.relax();
// No longer needed: matrix completes at the point of solution
// HJ, 17/Apr/2012
// omegaEqn.completeAssembly();
solve(omegaEqn);
bound(omega_, omega0_);
// Turbulent kinetic energy equation
fvScalarMatrix kEqn
(
fvm::ddt(k_)
+ fvm::div(phi_, k_)
+ fvm::SuSp(-fvc::div(phi_), k_)
- fvm::laplacian(DkEff(F1), k_)
==
min(G, c1_*betaStar_*k_*omega_)
- fvm::Sp(betaStar_*omega_, k_)
);
kEqn.relax();
solve(kEqn);
bound(k_, k0_);
// Re-calculate viscosity
// Fixed sqrt(2) error. HJ, 10/Jun/2015
nut_ = a1_*k_/max(a1_*omega_, b1_*F23()*sqrt(S2));
nut_ = min(nut_, nuRatio()*nu());
nut_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace incompressible
} // End namespace Foam
// ************************************************************************* //

View file

@ -1,313 +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::immersedBoundaryKOmegaSST
Description
Implementation of the k-omega-SST turbulence model for incompressible
flows.
Turbulence model described in:
@verbatim
Menter, F., Esch, T.
"Elements of Industrial Heat Transfer Prediction"
16th Brazilian Congress of Mechanical Engineering (COBEM),
Nov. 2001.
@endverbatim
with updated coefficients from
@verbatim
Menter, F. R., Kuntz, M., and Langtry, R.,
"Ten Years of Industrial Experience with the SST Turbulence Model",
Turbulence, Heat and Mass Transfer 4, 2003,
pp. 625 - 632.
@endverbatim
but with the consistent production terms from the 2001 paper as form in the
2003 paper is a typo, see
@verbatim
http://turbmodels.larc.nasa.gov/sst.html
@endverbatim
and the addition of the optional F3 term for rough walls from
\verbatim
Hellsten, A.
"Some Improvements in Menters k-omega-SST turbulence model"
29th AIAA Fluid Dynamics Conference,
AIAA-98-2554,
June 1998.
\endverbatim
Note that this implementation is written in terms of alpha diffusion
coefficients rather than the more traditional sigma (alpha = 1/sigma) so
that the blending can be applied to all coefficuients in a consistent
manner. The paper suggests that sigma is blended but this would not be
consistent with the blending of the k-epsilon and k-omega models.
Also note that the error in the last term of equation (2) relating to
sigma has been corrected.
The default model coefficients correspond to the following:
@verbatim
immersedBoundaryKOmegaSSTCoeffs
{
alphaK1 0.85;
alphaK2 1.0;
alphaOmega1 0.5;
alphaOmega2 0.856;
beta1 0.075;
beta2 0.0828;
betaStar 0.09;
gamma1 5/9;
gamma2 0.44;
a1 0.31;
b1 1.0;
c1 10.0;
F3 no;
}
@endverbatim
SourceFiles
immersedBoundaryKOmegaSST.C
\*---------------------------------------------------------------------------*/
#ifndef immersedBoundaryKOmegaSST_H
#define immersedBoundaryKOmegaSST_H
#include "RASModel.H"
#include "wallDist.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace incompressible
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class kOmega Declaration
\*---------------------------------------------------------------------------*/
class immersedBoundaryKOmegaSST
:
public RASModel
{
// Private data
// Model coefficients
dimensionedScalar alphaK1_;
dimensionedScalar alphaK2_;
dimensionedScalar alphaOmega1_;
dimensionedScalar alphaOmega2_;
dimensionedScalar gamma1_;
dimensionedScalar gamma2_;
dimensionedScalar beta1_;
dimensionedScalar beta2_;
dimensionedScalar betaStar_;
dimensionedScalar a1_;
dimensionedScalar b1_;
dimensionedScalar c1_;
Switch F3_;
//- Wall distance field
// Note: different to wall distance in parent RASModel
wallDist y_;
// Fields
volScalarField k_;
volScalarField omega_;
volScalarField nut_;
// Private member functions
tmp<volScalarField> F1(const volScalarField& CDkOmega) const;
tmp<volScalarField> F2() const;
tmp<volScalarField> F3() const;
tmp<volScalarField> F23() const;
tmp<volScalarField> blend
(
const volScalarField& F1,
const dimensionedScalar& psi1,
const dimensionedScalar& psi2
) const
{
return F1*(psi1 - psi2) + psi2;
}
tmp<volScalarField> alphaK
(
const volScalarField& F1
) const
{
return blend(F1, alphaK1_, alphaK2_);
}
tmp<volScalarField> alphaOmega
(
const volScalarField& F1
) const
{
return blend(F1, alphaOmega1_, alphaOmega2_);
}
tmp<volScalarField> beta
(
const volScalarField& F1
) const
{
return blend(F1, beta1_, beta2_);
}
tmp<volScalarField> gamma
(
const volScalarField& F1
) const
{
return blend(F1, gamma1_, gamma2_);
}
public:
//- Runtime type information
TypeName("immersedBoundaryKOmegaSST");
// Constructors
//- Construct from components
immersedBoundaryKOmegaSST
(
const volVectorField& U,
const surfaceScalarField& phi,
transportModel& transport,
const word& turbulenceModelName = turbulenceModel::typeName,
const word& modelName = typeName
);
//- Destructor
virtual ~immersedBoundaryKOmegaSST()
{}
// Member Functions
//- Return the turbulence viscosity
virtual tmp<volScalarField> nut() const
{
return nut_;
}
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff(const volScalarField& F1) const
{
return tmp<volScalarField>
(
new volScalarField("DkEff", alphaK(F1)*nut_ + nu())
);
}
//- Return the effective diffusivity for omega
tmp<volScalarField> DomegaEff(const volScalarField& F1) const
{
return tmp<volScalarField>
(
new volScalarField("DomegaEff", alphaOmega(F1)*nut_ + nu())
);
}
//- Return the turbulence kinetic energy
virtual tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return omega_;
}
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
mesh_.time().timeName(),
mesh_
),
betaStar_*k_*omega_,
omega_.boundaryField().types()
)
);
}
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devReff() const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff() const;
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
//- Read RASProperties dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // namespace incompressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //