Merge commit 'OpenCFD/master' into olesenm

This commit is contained in:
Mark Olesen
2009-07-27 08:31:06 +02:00
115 changed files with 878 additions and 1142 deletions

76
README
View File

@ -22,37 +22,35 @@
If the user wishes to run OpenFOAM in 32/64-bit mode they should consult the If the user wishes to run OpenFOAM in 32/64-bit mode they should consult the
section "Running OpenFOAM in 32-bit mode". section "Running OpenFOAM in 32-bit mode".
** Qt (from http://trolltech.com/products/qt) *** Qt (from http://trolltech.com/products/qt)
The ParaView 3.6 visualisation package requires that Qt version 4.3.x MUST The ParaView 3.6.1 visualisation package suggests that Qt version 4.3.x
be installed on the system. Earlier or more recent versions (4.2.x or be installed on the system. The source may build against more recent
4.4.x) will NOT work. To check whether Qt4 is installed, and the version, versions, but this is done at the user's own risk. To check whether Qt4 is
type: installed, and the version, type:
+ qmake --version + qmake --version
The ParaView binary executables in the ThirdParty distribution will only Both 32-bit and 64-bit version of ParaView were compiled with Qt-4.4.3 (with
work with PRECISELY the same version of Qt with which it was compiled. The openSUSE-11.1). If the user finds that a ParaView binary fails to run, then
64-bit version of ParaView was compiled with Qt-4.3.1 (with openSuSE-10.3) it is almost certainly due to a conflict in compiled and installed Qt
and the 32-bit version of ParaView was compiled with Qt-4.3.2 (with versions and they will need to consult the section below on "Compiling
ubuntu-7.10). If the user finds that a ParaView binary fails to run, then ParaView and the PV3FoamReader module."
it is almost certainly due to a conflict in compiled and installed Qt
versions and they will need to consult the section below on "Compiling
ParaView and the PV3FoamReader module."
The default versions of Qt used by some GNU/Linux releases are as follows. The default versions of Qt used by some GNU/Linux releases are as follows.
+ ubuntu-7.10: Version 4.3.2 + ubuntu-7.10: Version 4.3.2
+ ubuntu-8.04: Version 4.3.4 + ubuntu-8.04: Version 4.3.4
+ openSuSE-10.2: Version 4.2.1 - too old + openSUSE-10.2: Version 4.2.1 - too old
+ openSuSE-10.3: Version 4.3.1 + openSUSE-10.3: Version 4.3.1
+ openSuSE-11.0: Version 4.4.0 - too new + openSUSE-11.0: Version 4.4.0
+ openSUSE-11.1: Version 4.4.3
Compilation and running of ParaView has been successful using the libraries Compilation and running of ParaView has been successful using the libraries
downloaded in the "libqt4-dev" package on ubuntu. downloaded in the "libqt4-dev" package on ubuntu.
If you don't have an appropriate version of Qt installed you can download If you don't have an appropriate version of Qt installed you can download
the sources from TrollTech e.g.: the sources from TrollTech e.g.:
ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-4.3.5.tar.bz2 ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-4.3.5.tar.bz2
and compile and install in /usr/local or some other location that does to and compile and install in /usr/local or some other location that does not
conflict with the pre-installed version. conflict with the pre-installed version.
* Installation * Installation
Download and unpack the files in the $HOME/OpenFOAM directory as described in: Download and unpack the files in the $HOME/OpenFOAM directory as described in:
@ -62,7 +60,7 @@
in the OpenFOAM release. e.g. in in the OpenFOAM release. e.g. in
+ $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/ + $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/
+ where <VERSION> corresponds to the version 1.5, 1.6, ... + where <VERSION> corresponds to the version 1.6, 1.7, ...
1) EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), source the 1) EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), source the
etc/bashrc file by adding the following line to the end of your etc/bashrc file by adding the following line to the end of your
@ -113,7 +111,7 @@
which may be obtained from http://gcc.gnu.org/. which may be obtained from http://gcc.gnu.org/.
Install the compiler in Install the compiler in
$WM_PROJECT_INST_DIR/ThirdParty/gcc-<GCC_VERSION>/platforms/$WM_ARCH$WM_COMPILER_ARCH/ $WM_THIRD_PARTY_DIR/gcc-<GCC_VERSION>/platforms/$WM_ARCH$WM_COMPILER_ARCH/
and change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and and change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and
$WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the $WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the
environment variables as in section 3. environment variables as in section 3.
@ -121,10 +119,12 @@
Now go to the top-level source directory $WM_PROJECT_DIR and execute the Now go to the top-level source directory $WM_PROJECT_DIR and execute the
top-level build script './Allwmake'. In principle this will build everything, top-level build script './Allwmake'. In principle this will build everything,
but if problems occur with the build order it may be necessary to update the but if problems occur with the build order it may be necessary to update the
environment variables and re-execute 'Allwmake'. If you experience environment variables and re-execute './Allwmake'.
difficulties with building the source-pack, or your platform is not currently
supported, please contact <enquiries@OpenCFD.co.uk> to negotiate a support If you experience difficulties with building the source-pack, or your platform
contract and we will do the port and maintain it for future releases. is not currently supported, please contact <enquiries@OpenCFD.co.uk> to
negotiate a support contract and we will do the port and maintain it for
future releases.
* Testing the installation * Testing the installation
To check your installation setup, execute the 'foamInstallationTest' script To check your installation setup, execute the 'foamInstallationTest' script
@ -154,14 +154,14 @@
+ icoFoam + icoFoam
+ paraFoam + paraFoam
* Compiling Paraview 3 and the PV3FoamReader module * Compiling Paraview 3.6.1 and the PV3FoamReader module
A version of Qt 4.3.x must be installed to compile ParaView. The A version of Qt 4.3.x must be installed to fully compile ParaView. The
compilation is a fairly simple process using the makeParaView script compilation is a fairly simple process using the makeParaView script
(found in ThirdParty directory) that has worked in our tests with other (found in ThirdParty directory), which has worked in our tests with other
packages supplied in the ThirdParty directory, namely cmake-2.6.4 and packages supplied in the ThirdParty directory, namely cmake-2.6.4 and
gcc-4.3.3. Execute the following: gcc-4.3.3. Execute the following:
+ cd $WM_THIRD_PARTY_DIR + cd $WM_THIRD_PARTY_DIR
+ rm -rf paraview-3.6/platforms + rm -rf paraview-3.6.1/platforms
+ ./makeParaView + ./makeParaView

View File

@ -7,7 +7,7 @@ autoPtr<basicPsiThermo> pThermo
basicPsiThermo& thermo = pThermo(); basicPsiThermo& thermo = pThermo();
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
volScalarField& h = thermo.h(); volScalarField& e = thermo.e();
const volScalarField& T = thermo.T(); const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
const volScalarField& mu = thermo.mu(); const volScalarField& mu = thermo.mu();
@ -70,7 +70,7 @@ volScalarField rhoE
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
rho*(h + 0.5*magSqr(U)) - p rho*(e + 0.5*magSqr(U))
); );
surfaceScalarField pos surfaceScalarField pos

View File

@ -76,10 +76,10 @@ int main(int argc, char *argv[])
surfaceScalarField rPsi_neg = surfaceScalarField rPsi_neg =
fvc::interpolate(rPsi, neg, "reconstruct(T)"); fvc::interpolate(rPsi, neg, "reconstruct(T)");
surfaceScalarField h_pos = surfaceScalarField e_pos =
fvc::interpolate(h, pos, "reconstruct(T)"); fvc::interpolate(e, pos, "reconstruct(T)");
surfaceScalarField h_neg = surfaceScalarField e_neg =
fvc::interpolate(h, neg, "reconstruct(T)"); fvc::interpolate(e, neg, "reconstruct(T)");
surfaceVectorField U_pos = rhoU_pos/rho_pos; surfaceVectorField U_pos = rhoU_pos/rho_pos;
surfaceVectorField U_neg = rhoU_neg/rho_neg; surfaceVectorField U_neg = rhoU_neg/rho_neg;
@ -132,8 +132,8 @@ int main(int argc, char *argv[])
+ (a_pos*p_pos + a_neg*p_neg)*mesh.Sf(); + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf();
surfaceScalarField phiEp = surfaceScalarField phiEp =
aphiv_pos*rho_pos*(h_pos + 0.5*magSqr(U_pos)) aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos)
+ aphiv_neg*rho_neg*(h_neg + 0.5*magSqr(U_neg)) + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg)
+ aSf*p_pos - aSf*p_neg; + aSf*p_pos - aSf*p_neg;
volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T())); volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T()));
@ -156,7 +156,7 @@ int main(int argc, char *argv[])
{ {
solve solve
( (
fvm::ddt(rho, U) - fvc::ddt(rho,U) fvm::ddt(rho, U) - fvc::ddt(rho, U)
- fvm::laplacian(mu, U) - fvm::laplacian(mu, U)
- fvc::div(tauMC) - fvc::div(tauMC)
); );
@ -180,28 +180,27 @@ int main(int argc, char *argv[])
- fvc::div(sigmaDotU) - fvc::div(sigmaDotU)
); );
h = (rhoE + p)/rho - 0.5*magSqr(U); e = rhoE/rho - 0.5*magSqr(U);
h.correctBoundaryConditions(); e.correctBoundaryConditions();
thermo.correct(); thermo.correct();
rhoE.boundaryField() = rhoE.boundaryField() =
rho.boundaryField()* rho.boundaryField()*
( (
h.boundaryField() + 0.5*magSqr(U.boundaryField()) e.boundaryField() + 0.5*magSqr(U.boundaryField())
) );
- p.boundaryField();
if (!inviscid) if (!inviscid)
{ {
volScalarField k("k", thermo.Cp()*mu/Pr); volScalarField k("k", thermo.Cp()*mu/Pr);
solve solve
( (
fvm::ddt(rho, h) - fvc::ddt(rho, h) fvm::ddt(rho, e) - fvc::ddt(rho, e)
- fvm::laplacian(thermo.alpha(), h) - fvm::laplacian(thermo.alpha(), e)
+ fvc::laplacian(thermo.alpha(), h) + fvc::laplacian(thermo.alpha(), e)
- fvc::laplacian(k, T) - fvc::laplacian(k, T)
); );
thermo.correct(); thermo.correct();
rhoE = rho*(h + 0.5*magSqr(U)) - p; rhoE = rho*(e + 0.5*magSqr(U));
} }
p.dimensionedInternalField() = p.dimensionedInternalField() =

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5.x | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -71,10 +71,13 @@ void calcIncompressibleYPlus
const volScalarField::GeometricBoundaryField nutPatches = const volScalarField::GeometricBoundaryField nutPatches =
RASModel->nut()().boundaryField(); RASModel->nut()().boundaryField();
bool foundNutPatch = false;
forAll(nutPatches, patchi) forAll(nutPatches, patchi)
{ {
if (isA<wallFunctionPatchField>(nutPatches[patchi])) if (isA<wallFunctionPatchField>(nutPatches[patchi]))
{ {
foundNutPatch = true;
const wallFunctionPatchField& nutPw = const wallFunctionPatchField& nutPw =
dynamic_cast<const wallFunctionPatchField&> dynamic_cast<const wallFunctionPatchField&>
(nutPatches[patchi]); (nutPatches[patchi]);
@ -88,6 +91,12 @@ void calcIncompressibleYPlus
<< " average: " << average(Yp) << nl << endl; << " average: " << average(Yp) << nl << endl;
} }
} }
if (!foundNutPatch)
{
Info<< " no " << wallFunctionPatchField::typeName << " patches"
<< endl;
}
} }
@ -142,10 +151,13 @@ void calcCompressibleYPlus
const volScalarField::GeometricBoundaryField mutPatches = const volScalarField::GeometricBoundaryField mutPatches =
RASModel->mut()().boundaryField(); RASModel->mut()().boundaryField();
bool foundMutPatch = false;
forAll(mutPatches, patchi) forAll(mutPatches, patchi)
{ {
if (isA<wallFunctionPatchField>(mutPatches[patchi])) if (isA<wallFunctionPatchField>(mutPatches[patchi]))
{ {
foundMutPatch = true;
const wallFunctionPatchField& mutPw = const wallFunctionPatchField& mutPw =
dynamic_cast<const wallFunctionPatchField&> dynamic_cast<const wallFunctionPatchField&>
(mutPatches[patchi]); (mutPatches[patchi]);
@ -159,6 +171,12 @@ void calcCompressibleYPlus
<< " average: " << average(Yp) << nl << endl; << " average: " << average(Yp) << nl << endl;
} }
} }
if (!foundMutPatch)
{
Info<< " no " << wallFunctionPatchField::typeName << " patches"
<< endl;
}
} }

View File

@ -1,6 +1,13 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lfiniteVolume -lfiniteVolume

View File

@ -26,14 +26,13 @@ Application
applyWallFunctionBounaryConditions applyWallFunctionBounaryConditions
Description Description
Updates OpenFOAM RAS cases to use the new wall function framework Updates OpenFOAM RAS cases to use the new (v1.6) wall function framework
Attempts to determine whether case is compressible or incompressible, or Attempts to determine whether case is compressible or incompressible, or
can be supplied with -compressible command line argument can be supplied with -compressible command line argument
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "argList.H" #include "argList.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "Time.H" #include "Time.H"
@ -42,6 +41,16 @@ Description
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H"
using namespace Foam; using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -105,25 +114,6 @@ bool caseIsCompressible(const fvMesh& mesh)
} }
} }
// Attempt hydrostatic pressure field
IOobject pdHeader
(
"pd",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (pdHeader.headerOk())
{
volScalarField pd(pdHeader, mesh);
if (pd.dimensions() == dimMass/sqr(dimTime)/dimLength)
{
return true;
}
}
// If none of the above are true, assume that the case is incompressible // If none of the above are true, assume that the case is incompressible
return false; return false;
} }
@ -231,15 +221,125 @@ void replaceBoundaryType
} }
void updateCompressibleCase(const fvMesh& mesh)
{
Info<< "Case treated as compressible" << nl << endl;
createVolScalarField
(
mesh,
"mut",
dimArea/dimTime*dimDensity
);
replaceBoundaryType
(
mesh,
"mut",
compressible::RASModels::mutWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"epsilon",
compressible::RASModels::epsilonWallFunctionFvPatchScalarField::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"omega",
compressible::RASModels::omegaWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"k",
compressible::RASModels::kqRWallFunctionFvPatchField<scalar>::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"q",
compressible::RASModels::kqRWallFunctionFvPatchField<scalar>::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"R",
compressible::RASModels::kqRWallFunctionFvPatchField<symmTensor>::
typeName,
"(0 0 0 0 0 0)"
);
}
void updateIncompressibleCase(const fvMesh& mesh)
{
Info<< "Case treated as incompressible" << nl << endl;
createVolScalarField(mesh, "nut", dimArea/dimTime);
replaceBoundaryType
(
mesh,
"nut",
incompressible::RASModels::nutWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"epsilon",
incompressible::RASModels::epsilonWallFunctionFvPatchScalarField::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"omega",
incompressible::RASModels::omegaWallFunctionFvPatchScalarField::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"k",
incompressible::RASModels::kqRWallFunctionFvPatchField<scalar>::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"q",
incompressible::RASModels::kqRWallFunctionFvPatchField<scalar>::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"R",
incompressible::RASModels::kqRWallFunctionFvPatchField<symmTensor>::
typeName,
"(0 0 0 0 0 0)"
);
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "addTimeOptions.H"
# include "addTimeOptions.H"
argList::validOptions.insert("compressible", ""); argList::validOptions.insert("compressible", "");
# include "setRootCase.H" #include "setRootCase.H"
# include "createTime.H" #include "createTime.H"
# include "createMesh.H" #include "createMesh.H"
bool compressible = args.optionFound("compressible"); bool compressible = args.optionFound("compressible");
@ -249,28 +349,13 @@ int main(int argc, char *argv[])
if (compressible || caseIsCompressible(mesh)) if (compressible || caseIsCompressible(mesh))
{ {
Info<< "Case treated as compressible" << nl << endl; updateCompressibleCase(mesh);
createVolScalarField
(
mesh,
"mut",
dimArea/dimTime*dimDensity
);
replaceBoundaryType(mesh, "mut", "mutWallFunction", "0");
} }
else else
{ {
Info<< "Case treated as incompressible" << nl << endl; updateIncompressibleCase(mesh);
createVolScalarField(mesh, "nut", dimArea/dimTime);
replaceBoundaryType(mesh, "nut", "nutWallFunction", "0");
} }
replaceBoundaryType(mesh, "epsilon", "epsilonWallFunction", "0");
replaceBoundaryType(mesh, "omega", "omegaWallFunction", "0");
replaceBoundaryType(mesh, "k", "kqRWallFunction", "0");
replaceBoundaryType(mesh, "q", "kqRWallFunction", "0");
replaceBoundaryType(mesh, "R", "kqRWallFunction", "(0 0 0 0 0 0)");
Info<< "End\n" << endl; Info<< "End\n" << endl;
return 0; return 0;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5.x | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -29,6 +29,7 @@ License
#include "perfectGas.H" #include "perfectGas.H"
#include "eConstThermo.H" #include "eConstThermo.H"
#include "hConstThermo.H"
#include "janafThermo.H" #include "janafThermo.H"
#include "specieThermo.H" #include "specieThermo.H"
@ -63,6 +64,24 @@ makeBasicPsiThermo
perfectGas perfectGas
); );
makeBasicPsiThermo
(
ePsiThermo,
pureMixture,
constTransport,
hConstThermo,
perfectGas
);
makeBasicPsiThermo
(
ePsiThermo,
pureMixture,
sutherlandTransport,
hConstThermo,
perfectGas
);
makeBasicPsiThermo makeBasicPsiThermo
( (
ePsiThermo, ePsiThermo,

View File

@ -26,7 +26,8 @@ Class
Foam::MarshakRadiationFvPatchScalarField Foam::MarshakRadiationFvPatchScalarField
Description Description
Radiation temperature taken from calculated temperaure Marshak boundary for radiation G field
- radiation temperature taken from patch value
SourceFiles SourceFiles
MarshakRadiationFvPatchScalarField.C MarshakRadiationFvPatchScalarField.C

View File

@ -26,7 +26,8 @@ Class
Foam::MarshakRadiationFixedTMixedFvPatchScalarField Foam::MarshakRadiationFixedTMixedFvPatchScalarField
Description Description
Radiation temperature specified Marshak boundary for radiation G field
- radiation temperature specified
SourceFiles SourceFiles
MarshakRadiationFixedTMixedFvPatchScalarField.C MarshakRadiationFixedTMixedFvPatchScalarField.C

View File

@ -27,7 +27,7 @@ Class
Description Description
Finite Volume Discrete Ordinary Method. Solves the RTE equation for n Finite Volume Discrete Ordinates Method. Solves the RTE equation for n
directions in a participating media, not including scatter. directions in a participating media, not including scatter.
Available absorption models: Available absorption models:

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,8 +36,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef alphatWallFunctionFvPatchScalarField_H #ifndef compressibleAlphatWallFunctionFvPatchScalarField_H
#define alphatWallFunctionFvPatchScalarField_H #define compressibleAlphatWallFunctionFvPatchScalarField_H
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef epsilonWallFunctionFvPatchScalarField_H #ifndef compressibleEpsilonWallFunctionFvPatchScalarField_H
#define epsilonWallFunctionFvPatchScalarField_H #define compressibleEpsilonWallFunctionFvPatchScalarField_H
#include "fixedInternalValueFvPatchField.H" #include "fixedInternalValueFvPatchField.H"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -34,8 +34,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef kqRWallFunctionFvPatchField_H #ifndef compressiblekqRWallFunctionFvPatchField_H
#define kqRWallFunctionFvPatchField_H #define compressiblekqRWallFunctionFvPatchField_H
#include "zeroGradientFvPatchField.H" #include "zeroGradientFvPatchField.H"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,7 +40,7 @@ namespace RASModels
{ {
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
scalar mutRoughWallFunctionFvPatchScalarField::fnRough scalar mutRoughWallFunctionFvPatchScalarField::fnRough
( (
@ -65,6 +65,60 @@ scalar mutRoughWallFunctionFvPatchScalarField::fnRough
} }
tmp<scalarField> mutRoughWallFunctionFvPatchScalarField::calcMut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
const tmp<volScalarField> tk = rasModel.k();
const volScalarField& k = tk();
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
const scalar Cmu25 = pow(Cmu_, 0.25);
tmp<scalarField> tmutw(new scalarField(patch().size(), 0.0));
scalarField& mutw = tmutw();
forAll(mutw, faceI)
{
label faceCellI = patch().faceCells()[faceI];
scalar uStar = Cmu25*sqrt(k[faceCellI]);
scalar yPlus = uStar*y[faceI]/(muw[faceI]/rhow[faceI]);
scalar KsPlus = uStar*Ks_[faceI]/(muw[faceI]/rhow[faceI]);
scalar Edash = E_;
scalar yPlusLamNew = yPlusLam_;
if (KsPlus > 2.25)
{
Edash /= fnRough(KsPlus, Cs_[faceI]);
yPlusLamNew = rasModel.yPlusLam(kappa_, Edash);
}
if (debug)
{
Info<< "yPlus = " << yPlus
<< ", KsPlus = " << KsPlus
<< ", Edash = " << Edash
<< ", yPlusLam = " << yPlusLam_
<< endl;
}
if (yPlus > yPlusLamNew)
{
mutw[faceI] =
muw[faceI]*(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1);
}
}
return tmutw;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
mutRoughWallFunctionFvPatchScalarField::mutRoughWallFunctionFvPatchScalarField mutRoughWallFunctionFvPatchScalarField::mutRoughWallFunctionFvPatchScalarField
@ -158,61 +212,6 @@ void mutRoughWallFunctionFvPatchScalarField::rmap
} }
tmp<scalarField> mutRoughWallFunctionFvPatchScalarField::calcMut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const scalarField& y = rasModel.y()[patchI];
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
const tmp<volScalarField> tk = rasModel.k();
const volScalarField& k = tk();
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
const scalar Cmu25 = pow(Cmu_, 0.25);
tmp<scalarField> tmutw(new scalarField(patch().size(), 0.0));
scalarField& mutw = tmutw();
forAll(mutw, faceI)
{
label faceCellI = patch().faceCells()[faceI];
scalar uStar = Cmu25*sqrt(k[faceCellI]);
scalar yPlus = uStar*y[faceI]/(muw[faceI]/rhow[faceI]);
scalar KsPlus = uStar*Ks_[faceI]/(muw[faceI]/rhow[faceI]);
scalar Edash = E_;
scalar yPlusLamNew = yPlusLam;
if (KsPlus > 2.25)
{
Edash /= fnRough(KsPlus, Cs_[faceI]);
yPlusLamNew = rasModel.yPlusLam(kappa_, Edash);
}
if (debug)
{
Info<< "yPlus = " << yPlus
<< ", KsPlus = " << KsPlus
<< ", Edash = " << Edash
<< ", yPlusLam = " << yPlusLam
<< endl;
}
if (yPlus > yPlusLamNew)
{
mutw[faceI] =
muw[faceI]*(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1);
}
}
return tmutw;
}
void mutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const void mutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,8 +40,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef mutRoughWallFunctionFvPatchScalarField_H #ifndef compressibleMutRoughWallFunctionFvPatchScalarField_H
#define mutRoughWallFunctionFvPatchScalarField_H #define compressibleMutRoughWallFunctionFvPatchScalarField_H
#include "mutWallFunctionFvPatchScalarField.H" #include "mutWallFunctionFvPatchScalarField.H"

View File

@ -39,6 +39,8 @@ namespace compressible
namespace RASModels namespace RASModels
{ {
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
tmp<scalarField> tmp<scalarField>
mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
( (
@ -48,7 +50,6 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
const label patchI = patch().index(); const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const scalarField& y = rasModel.y()[patchI]; const scalarField& y = rasModel.y()[patchI];
const scalarField& muw = rasModel.mu().boundaryField()[patchI]; const scalarField& muw = rasModel.mu().boundaryField()[patchI];
const fvPatchScalarField& rho = rasModel.rho().boundaryField()[patchI]; const fvPatchScalarField& rho = rasModel.rho().boundaryField()[patchI];
@ -74,7 +75,7 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
const scalar Re = rho[facei]*magUpara*y[facei]/muw[facei]; const scalar Re = rho[facei]*magUpara*y[facei]/muw[facei];
const scalar kappaRe = kappa_*Re; const scalar kappaRe = kappa_*Re;
scalar yp = yPlusLam; scalar yp = yPlusLam_;
const scalar ryPlusLam = 1.0/yp; const scalar ryPlusLam = 1.0/yp;
int iter = 0; int iter = 0;
@ -146,7 +147,7 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
const scalar Re = rho[facei]*magUpara*y[facei]/muw[facei]; const scalar Re = rho[facei]*magUpara*y[facei]/muw[facei];
const scalar kappaRe = kappa_*Re; const scalar kappaRe = kappa_*Re;
scalar yp = yPlusLam; scalar yp = yPlusLam_;
const scalar ryPlusLam = 1.0/yp; const scalar ryPlusLam = 1.0/yp;
int iter = 0; int iter = 0;
@ -171,6 +172,38 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
} }
tmp<scalarField>
mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcMut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
const fvPatchScalarField& rho = rasModel.rho().boundaryField()[patchI];
scalarField magUp = mag(Uw.patchInternalField() - Uw);
tmp<scalarField> tyPlus = calcYPlus(magUp);
scalarField& yPlus = tyPlus();
tmp<scalarField> tmutw(new scalarField(patch().size(), 0.0));
scalarField& mutw = tmutw();
forAll(yPlus, facei)
{
if (yPlus[facei] > yPlusLam_)
{
const scalar Re = rho[facei]*magUp[facei]*y[facei]/muw[facei];
mutw[facei] = muw[facei]*(sqr(yPlus[facei])/Re - 1);
}
}
return tmutw;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::
@ -247,39 +280,6 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<scalarField>
mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcMut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const scalarField& y = rasModel.y()[patchI];
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
const fvPatchScalarField& rho = rasModel.rho().boundaryField()[patchI];
scalarField magUp = mag(Uw.patchInternalField() - Uw);
tmp<scalarField> tyPlus = calcYPlus(magUp);
scalarField& yPlus = tyPlus();
tmp<scalarField> tmutw(new scalarField(patch().size(), 0.0));
scalarField& mutw = tmutw();
forAll(yPlus, facei)
{
if (yPlus[facei] > yPlusLam)
{
const scalar Re = rho[facei]*magUp[facei]*y[facei]/muw[facei];
mutw[facei] = muw[facei]*(sqr(yPlus[facei])/Re - 1);
}
}
return tmutw;
}
tmp<scalarField> tmp<scalarField>
mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::yPlus() const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::yPlus() const
{ {

View File

@ -34,8 +34,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H #ifndef compressibleMutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H
#define mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H #define compressibleMutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H
#include "mutWallFunctionFvPatchScalarField.H" #include "mutWallFunctionFvPatchScalarField.H"

View File

@ -50,7 +50,6 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcYPlus
const label patchI = patch().index(); const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const scalarField& y = rasModel.y()[patchI]; const scalarField& y = rasModel.y()[patchI];
const fvPatchScalarField& rhow = rasModel.rho().boundaryField()[patchI]; const fvPatchScalarField& rhow = rasModel.rho().boundaryField()[patchI];
const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI]; const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI];
@ -62,7 +61,7 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcYPlus
{ {
scalar kappaRe = kappa_*magUp[faceI]*y[faceI]/(muw[faceI]/rhow[faceI]); scalar kappaRe = kappa_*magUp[faceI]*y[faceI]/(muw[faceI]/rhow[faceI]);
scalar yp = yPlusLam; scalar yp = yPlusLam_;
scalar ryPlusLam = 1.0/yp; scalar ryPlusLam = 1.0/yp;
int iter = 0; int iter = 0;
@ -82,6 +81,35 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcYPlus
} }
tmp<scalarField>
mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcMut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI];
tmp<scalarField> tyPlus = calcYPlus(magUp);
scalarField& yPlus = tyPlus();
tmp<scalarField> tmutw(new scalarField(patch().size(), 0.0));
scalarField& mutw = tmutw();
forAll(yPlus, faceI)
{
if (yPlus[faceI] > yPlusLam_)
{
mutw[faceI] =
muw[faceI]*(yPlus[faceI]*kappa_/log(E_*yPlus[faceI]) - 1.0);
}
}
return tmutw;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::
@ -143,36 +171,6 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<scalarField>
mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcMut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI];
tmp<scalarField> tyPlus = calcYPlus(magUp);
scalarField& yPlus = tyPlus();
tmp<scalarField> tmutw(new scalarField(patch().size(), 0.0));
scalarField& mutw = tmutw();
forAll(yPlus, faceI)
{
if (yPlus[faceI] > yPlusLam)
{
mutw[faceI] =
muw[faceI]*(yPlus[faceI]*kappa_/log(E_*yPlus[faceI]) - 1.0);
}
}
return tmutw;
}
tmp<scalarField> tmp<scalarField>
mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::yPlus() const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::yPlus() const
{ {

View File

@ -34,8 +34,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef mutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H #ifndef compressibleMutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H
#define mutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H #define compressibleMutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H
#include "mutWallFunctionFvPatchScalarField.H" #include "mutWallFunctionFvPatchScalarField.H"

View File

@ -105,6 +105,21 @@ tmp<scalarField> mutSpalartAllmarasWallFunctionFvPatchScalarField::calcUTau
} }
tmp<scalarField>
mutSpalartAllmarasWallFunctionFvPatchScalarField::calcMut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField magGradU = mag(Uw.snGrad());
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
return max(0.0, rhow*sqr(calcUTau(magGradU))/magGradU - muw);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
mutSpalartAllmarasWallFunctionFvPatchScalarField:: mutSpalartAllmarasWallFunctionFvPatchScalarField::
@ -166,21 +181,6 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<scalarField>
mutSpalartAllmarasWallFunctionFvPatchScalarField::calcMut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField magGradU = mag(Uw.snGrad());
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
return max(0.0, rhow*sqr(calcUTau(magGradU))/magGradU - muw);
}
tmp<scalarField> tmp<scalarField>
mutSpalartAllmarasWallFunctionFvPatchScalarField::yPlus() const mutSpalartAllmarasWallFunctionFvPatchScalarField::yPlus() const
{ {

View File

@ -34,8 +34,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef mutSpalartAllmarasWallFunctionFvPatchScalarField_H #ifndef compressibleMutSpalartAllmarasWallFunctionFvPatchScalarField_H
#define mutSpalartAllmarasWallFunctionFvPatchScalarField_H #define compressibleMutSpalartAllmarasWallFunctionFvPatchScalarField_H
#include "mutWallFunctionFvPatchScalarField.H" #include "mutWallFunctionFvPatchScalarField.H"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,7 +40,7 @@ namespace compressible
namespace RASModels namespace RASModels
{ {
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void mutWallFunctionFvPatchScalarField::checkType() void mutWallFunctionFvPatchScalarField::checkType()
{ {
@ -56,82 +56,20 @@ void mutWallFunctionFvPatchScalarField::checkType()
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // scalar mutWallFunctionFvPatchScalarField::calcYPlusLam
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
( (
const fvPatch& p, const scalar kappa,
const DimensionedField<scalar, volMesh>& iF const scalar E
) ) const
:
fixedValueFvPatchScalarField(p, iF),
Cmu_(0.09),
kappa_(0.41),
E_(9.8)
{}
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
(
const mutWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
Cmu_(ptf.Cmu_),
kappa_(ptf.kappa_),
E_(ptf.E_)
{}
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF, dict),
Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
E_(dict.lookupOrDefault<scalar>("E", 9.8))
{}
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
(
const mutWallFunctionFvPatchScalarField& wfpsf
)
:
fixedValueFvPatchScalarField(wfpsf),
Cmu_(wfpsf.Cmu_),
kappa_(wfpsf.kappa_),
E_(wfpsf.E_)
{}
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
(
const mutWallFunctionFvPatchScalarField& wfpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(wfpsf, iF),
Cmu_(wfpsf.Cmu_),
kappa_(wfpsf.kappa_),
E_(wfpsf.E_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void mutWallFunctionFvPatchScalarField::updateCoeffs()
{ {
operator==(calcMut()); scalar ypl = 11.0;
fixedValueFvPatchScalarField::updateCoeffs(); for (int i=0; i<10; i++)
{
ypl = log(E*ypl)/kappa;
}
return ypl;
} }
@ -139,7 +77,6 @@ tmp<scalarField> mutWallFunctionFvPatchScalarField::calcMut() const
{ {
const label patchI = patch().index(); const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const scalarField& y = rasModel.y()[patchI]; const scalarField& y = rasModel.y()[patchI];
const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
const tmp<volScalarField> tk = rasModel.k(); const tmp<volScalarField> tk = rasModel.k();
@ -156,10 +93,9 @@ tmp<scalarField> mutWallFunctionFvPatchScalarField::calcMut() const
label faceCellI = patch().faceCells()[faceI]; label faceCellI = patch().faceCells()[faceI];
scalar yPlus = scalar yPlus =
Cmu25*y[faceI]*sqrt(k[faceCellI]) Cmu25*y[faceI]*sqrt(k[faceCellI])/(muw[faceI]/rhow[faceI]);
/(muw[faceI]/rhow[faceI]);
if (yPlus > yPlusLam) if (yPlus > yPlusLam_)
{ {
mutw[faceI] = muw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1); mutw[faceI] = muw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1);
} }
@ -169,6 +105,98 @@ tmp<scalarField> mutWallFunctionFvPatchScalarField::calcMut() const
} }
void mutWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
{
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(p, iF),
Cmu_(0.09),
kappa_(0.41),
E_(9.8),
yPlusLam_(calcYPlusLam(kappa_, E_))
{}
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
(
const mutWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
Cmu_(ptf.Cmu_),
kappa_(ptf.kappa_),
E_(ptf.E_),
yPlusLam_(ptf.yPlusLam_)
{}
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF, dict),
Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
yPlusLam_(calcYPlusLam(kappa_, E_))
{}
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
(
const mutWallFunctionFvPatchScalarField& wfpsf
)
:
fixedValueFvPatchScalarField(wfpsf),
Cmu_(wfpsf.Cmu_),
kappa_(wfpsf.kappa_),
E_(wfpsf.E_),
yPlusLam_(wfpsf.yPlusLam_)
{}
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
(
const mutWallFunctionFvPatchScalarField& wfpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(wfpsf, iF),
Cmu_(wfpsf.Cmu_),
kappa_(wfpsf.kappa_),
E_(wfpsf.E_),
yPlusLam_(wfpsf.yPlusLam_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void mutWallFunctionFvPatchScalarField::updateCoeffs()
{
operator==(calcMut());
fixedValueFvPatchScalarField::updateCoeffs();
}
tmp<scalarField> mutWallFunctionFvPatchScalarField::yPlus() const tmp<scalarField> mutWallFunctionFvPatchScalarField::yPlus() const
{ {
const label patchI = patch().index(); const label patchI = patch().index();
@ -194,14 +222,6 @@ void mutWallFunctionFvPatchScalarField::write(Ostream& os) const
} }
void mutWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
{
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField(fvPatchScalarField, mutWallFunctionFvPatchScalarField); makePatchTypeField(fvPatchScalarField, mutWallFunctionFvPatchScalarField);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef mutWallFunctionFvPatchScalarField_H #ifndef compressibleMutWallFunctionFvPatchScalarField_H
#define mutWallFunctionFvPatchScalarField_H #define compressibleMutWallFunctionFvPatchScalarField_H
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"
@ -70,12 +70,18 @@ protected:
//- E coefficient //- E coefficient
scalar E_; scalar E_;
//- Y+ at the edge of the laminar sublayer
scalar yPlusLam_;
// Protected member functions // Protected member functions
//- Check the type of the patch //- Check the type of the patch
virtual void checkType(); virtual void checkType();
//- Calculate the Y+ at the edge of the laminar sublayer
virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
//- Calculate the turbulence viscosity //- Calculate the turbulence viscosity
virtual tmp<scalarField> calcMut() const; virtual tmp<scalarField> calcMut() const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -197,7 +197,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
const scalarField magGradUw = mag(Uw.snGrad()); const scalarField magGradUw = mag(Uw.snGrad());
// Set epsilon and G // Set omega and G
forAll(mutw, faceI) forAll(mutw, faceI)
{ {
label faceCellI = patch().faceCells()[faceI]; label faceCellI = patch().faceCells()[faceI];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,8 +33,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef omegaWallFunctionFvPatchScalarField_H #ifndef compressibleOmegaWallFunctionFvPatchScalarField_H
#define omegaWallFunctionFvPatchScalarField_H #define compressibleOmegaWallFunctionFvPatchScalarField_H
#include "fixedInternalValueFvPatchField.H" #include "fixedInternalValueFvPatchField.H"

View File

@ -1,51 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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 2 of the License, or (at your
option) any later version.
OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Global
wallDissipation
Description
Set wall dissipation in the epsilon matrix
\*---------------------------------------------------------------------------*/
{
const fvPatchList& patches = mesh_.boundary();
forAll(patches, patchi)
{
const fvPatch& p = patches[patchi];
if (isType<wallFvPatch>(p))
{
epsEqn().setValues
(
p.faceCells(),
epsilon_.boundaryField()[patchi].patchInternalField()
);
}
}
}
// ************************************************************************* //

View File

@ -1,128 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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 2 of the License, or (at your
option) any later version.
OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Global
wallFunctions
Description
Calculate wall dissipation from wall-functions.
\*---------------------------------------------------------------------------*/
{
labelList cellBoundaryFaceCount(epsilon_.size(), 0);
scalar Cmu25 = pow(Cmu_.value(), 0.25);
scalar Cmu75 = pow(Cmu_.value(), 0.75);
const fvPatchList& patches = mesh_.boundary();
//- Initialise the near-wall G field to zero
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
epsilon_[faceCelli] = 0.0;
G[faceCelli] = 0.0;
}
}
}
//- Accumulate the wall face contributions to epsilon and G
// Increment cellBoundaryFaceCount for each face for averaging
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
{
# include "checkPatchFieldTypes.H"
const scalarField& rhow = rho_.boundaryField()[patchi];
const scalarField& muw = mu().boundaryField()[patchi];
const scalarField& mutw = mut_.boundaryField()[patchi];
scalarField magFaceGradU =
mag(U_.boundaryField()[patchi].snGrad());
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
scalar yPlus =
Cmu25*RASModel::y_[patchi][facei]
*sqrt(k_[faceCelli])
/(muw[facei]/rhow[facei]);
// For corner cells (with two boundary or more faces),
// epsilon and G in the near-wall cell are calculated
// as an average
cellBoundaryFaceCount[faceCelli]++;
epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5)
/(kappa_.value()*RASModel::y_[patchi][facei]);
if (yPlus > yPlusLam_)
{
G[faceCelli] +=
(mutw[facei] + muw[facei])
*magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli])
/(kappa_.value()*RASModel::y_[patchi][facei]);
}
}
}
}
// Perform the averaging
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
epsilon_[faceCelli] /= cellBoundaryFaceCount[faceCelli];
G[faceCelli] /= cellBoundaryFaceCount[faceCelli];
}
}
}
}
// ************************************************************************* //

View File

@ -1,73 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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 2 of the License, or (at your
option) any later version.
OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Global
wallViscosity
Description
Calculate wall viscosity from wall-functions.
\*---------------------------------------------------------------------------*/
{
scalar Cmu25 = pow(Cmu_.value(), 0.25);
const fvPatchList& patches = mesh_.boundary();
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
{
const scalarField& rhow = rho_.boundaryField()[patchi];
const scalarField& muw = mu().boundaryField()[patchi];
scalarField& mutw = mut_.boundaryField()[patchi];
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
scalar yPlus =
Cmu25*RASModel::y_[patchi][facei]
*sqrt(k_[faceCelli])/(muw[facei]/rhow[facei]);
if (yPlus > yPlusLam_)
{
mutw[facei] =
muw[facei]
*(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
}
else
{
mutw[facei] = 0.0;
}
}
}
}
}
// ************************************************************************* //

View File

@ -155,13 +155,13 @@ SpalartAllmaras::SpalartAllmaras
: :
LESModel(modelName, U, phi, transport), LESModel(modelName, U, phi, transport),
alphaNut_ sigmaNut_
( (
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
( (
"alphaNut", "sigmaNut",
coeffDict_, coeffDict_,
1.5 0.66666
) )
), ),
kappa_ kappa_
@ -169,7 +169,7 @@ SpalartAllmaras::SpalartAllmaras
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
( (
"kappa", "kappa",
*this, coeffDict_,
0.41 0.41
) )
), ),
@ -227,7 +227,7 @@ SpalartAllmaras::SpalartAllmaras
0.07 0.07
) )
), ),
Cw1_(Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_)), Cw1_(Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_),
Cw2_ Cw2_
( (
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
@ -301,11 +301,11 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU)
+ fvm::div(phi(), nuTilda_) + fvm::div(phi(), nuTilda_)
- fvm::laplacian - fvm::laplacian
( (
alphaNut_*(nuTilda_ + nu()), (nuTilda_ + nu())/sigmaNut_,
nuTilda_, nuTilda_,
"laplacian(DnuTildaEff,nuTilda)" "laplacian(DnuTildaEff,nuTilda)"
) )
- alphaNut_*Cb2_*magSqr(fvc::grad(nuTilda_)) - Cb2_/sigmaNut_*magSqr(fvc::grad(nuTilda_))
== ==
Cb1_*STilda*nuTilda_ Cb1_*STilda*nuTilda_
- fvm::Sp(Cw1_*fw(STilda, dTilda)*nuTilda_/sqr(dTilda), nuTilda_) - fvm::Sp(Cw1_*fw(STilda, dTilda)*nuTilda_/sqr(dTilda), nuTilda_)
@ -358,7 +358,7 @@ bool SpalartAllmaras::read()
{ {
if (LESModel::read()) if (LESModel::read())
{ {
alphaNut_.readIfPresent(coeffDict()); sigmaNut_.readIfPresent(coeffDict());
kappa_.readIfPresent(*this); kappa_.readIfPresent(*this);
Cb1_.readIfPresent(coeffDict()); Cb1_.readIfPresent(coeffDict());
Cb2_.readIfPresent(coeffDict()); Cb2_.readIfPresent(coeffDict());
@ -366,7 +366,7 @@ bool SpalartAllmaras::read()
Cv2_.readIfPresent(coeffDict()); Cv2_.readIfPresent(coeffDict());
CDES_.readIfPresent(coeffDict()); CDES_.readIfPresent(coeffDict());
ck_.readIfPresent(coeffDict()); ck_.readIfPresent(coeffDict());
Cw1_ = Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_); Cw1_ = Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_;
Cw2_.readIfPresent(coeffDict()); Cw2_.readIfPresent(coeffDict());
Cw3_.readIfPresent(coeffDict()); Cw3_.readIfPresent(coeffDict());

View File

@ -71,7 +71,7 @@ protected:
// Protected data // Protected data
dimensionedScalar alphaNut_; dimensionedScalar sigmaNut_;
dimensionedScalar kappa_; dimensionedScalar kappa_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -60,7 +60,8 @@ void Foam::IDDESDelta::calcDelta()
{ {
label faceI = cFaces[cFaceI]; label faceI = cFaces[cFaceI];
const point& facevector = mesh().faceCentres()[faceI]; const point& facevector = mesh().faceCentres()[faceI];
scalar tmp = mag(facevector-centrevector); scalar tmp = mag(facevector - centrevector);
if (tmp > deltamaxTmp) if (tmp > deltamaxTmp)
{ {
deltamaxTmp = tmp; deltamaxTmp = tmp;
@ -79,7 +80,11 @@ void Foam::IDDESDelta::calcDelta()
{ {
delta_.internalField() = delta_.internalField() =
deltaCoeff_ deltaCoeff_
*min(max(max(cw_*wallDist(mesh()).y(),cw_*deltamax),hwn),deltamax); *min
(
max(max(cw_*wallDist(mesh()).y(), cw_*deltamax), hwn),
deltamax
);
} }
else if (nD == 2) else if (nD == 2)
{ {
@ -89,12 +94,16 @@ void Foam::IDDESDelta::calcDelta()
delta_.internalField() = delta_.internalField() =
deltaCoeff_ deltaCoeff_
*min(max(max(cw_*wallDist(mesh()).y(),cw_*deltamax),hwn),deltamax); *min
(
max(max(cw_*wallDist(mesh()).y(), cw_*deltamax), hwn),
deltamax
);
} }
else else
{ {
FatalErrorIn("IDDESDelta::calcDelta()") FatalErrorIn("IDDESDelta::calcDelta()")
<< "Case is not 3D or 2D, LES is not applicable" << "Case is not 3D or 2D, LES is not strictly applicable"
<< exit(FatalError); << exit(FatalError);
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -46,7 +46,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class IDDESDelta Declaration Class IDDESDelta Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class IDDESDelta class IDDESDelta

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,7 +39,7 @@ namespace incompressible
namespace RASModels namespace RASModels
{ {
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
scalar nutRoughWallFunctionFvPatchScalarField::fnRough scalar nutRoughWallFunctionFvPatchScalarField::fnRough
( (
@ -64,6 +64,68 @@ scalar nutRoughWallFunctionFvPatchScalarField::fnRough
} }
tmp<scalarField> nutRoughWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const tmp<volScalarField> tk = rasModel.k();
const volScalarField& k = tk();
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
const scalar Cmu25 = pow(Cmu_, 0.25);
tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0));
scalarField& nutw = tnutw();
forAll(nutw, faceI)
{
label faceCellI = patch().faceCells()[faceI];
scalar uStar = Cmu25*sqrt(k[faceCellI]);
scalar yPlus = uStar*y[faceI]/nuw[faceI];
scalar KsPlus = uStar*Ks_[faceI]/nuw[faceI];
scalar Edash = E_;
if (KsPlus > 2.25)
{
Edash /= fnRough(KsPlus, Cs_[faceI]);
}
if (yPlus > yPlusLam_)
{
scalar limitingNutw = max(nutw[faceI], nuw[faceI]);
// To avoid oscillations limit the change in the wall viscosity
// which is particularly important if it temporarily becomes zero
nutw[faceI] =
max
(
min
(
nuw[faceI]
*(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1),
2*limitingNutw
), 0.5*limitingNutw
);
}
if (debug)
{
Info<< "yPlus = " << yPlus
<< ", KsPlus = " << KsPlus
<< ", Edash = " << Edash
<< ", nutw = " << nutw[faceI]
<< endl;
}
}
return tnutw;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField
@ -157,69 +219,6 @@ void nutRoughWallFunctionFvPatchScalarField::rmap
} }
tmp<scalarField> nutRoughWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const scalarField& y = rasModel.y()[patchI];
const tmp<volScalarField> tk = rasModel.k();
const volScalarField& k = tk();
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
const scalar Cmu25 = pow(Cmu_, 0.25);
tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0));
scalarField& nutw = tnutw();
forAll(nutw, faceI)
{
label faceCellI = patch().faceCells()[faceI];
scalar uStar = Cmu25*sqrt(k[faceCellI]);
scalar yPlus = uStar*y[faceI]/nuw[faceI];
scalar KsPlus = uStar*Ks_[faceI]/nuw[faceI];
scalar Edash = E_;
if (KsPlus > 2.25)
{
Edash /= fnRough(KsPlus, Cs_[faceI]);
}
if (yPlus > yPlusLam)
{
scalar limitingNutw = max(nutw[faceI], nuw[faceI]);
// To avoid oscillations limit the change in the wall viscosity
// which is particularly important if it temporarily becomes zero
nutw[faceI] =
max
(
min
(
nuw[faceI]
*(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1),
2*limitingNutw
), 0.5*limitingNutw
);
}
if (debug)
{
Info<< "yPlus = " << yPlus
<< ", KsPlus = " << KsPlus
<< ", Edash = " << Edash
<< ", nutw = " << nutw[faceI]
<< endl;
}
}
return tnutw;
}
void nutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const void nutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -39,7 +39,39 @@ namespace incompressible
namespace RASModels namespace RASModels
{ {
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
tmp<scalarField>
nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
// The flow velocity at the adjacent cell centre
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
tmp<scalarField> tyPlus = calcYPlus(magUp);
scalarField& yPlus = tyPlus();
tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0));
scalarField& nutw = tnutw();
forAll(yPlus, facei)
{
if (yPlus[facei] > yPlusLam_)
{
const scalar Re = magUp[facei]*y[facei]/nuw[facei];
nutw[facei] = nuw[facei]*(sqr(yPlus[facei])/Re - 1);
}
}
return tnutw;
}
tmp<scalarField> tmp<scalarField>
nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
@ -50,7 +82,6 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
const label patchI = patch().index(); const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const scalarField& y = rasModel.y()[patchI]; const scalarField& y = rasModel.y()[patchI];
const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
@ -75,7 +106,7 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
const scalar Re = magUpara*y[facei]/nuw[facei]; const scalar Re = magUpara*y[facei]/nuw[facei];
const scalar kappaRe = kappa_*Re; const scalar kappaRe = kappa_*Re;
scalar yp = yPlusLam; scalar yp = yPlusLam_;
const scalar ryPlusLam = 1.0/yp; const scalar ryPlusLam = 1.0/yp;
int iter = 0; int iter = 0;
@ -133,7 +164,7 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
&& yp > VSMALL && yp > VSMALL
); );
yPlus[facei] = yp; yPlus[facei] = max(0.0, yp);
} }
} }
} }
@ -146,7 +177,7 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
const scalar Re = magUpara*y[facei]/nuw[facei]; const scalar Re = magUpara*y[facei]/nuw[facei];
const scalar kappaRe = kappa_*Re; const scalar kappaRe = kappa_*Re;
scalar yp = yPlusLam; scalar yp = yPlusLam_;
const scalar ryPlusLam = 1.0/yp; const scalar ryPlusLam = 1.0/yp;
int iter = 0; int iter = 0;
@ -159,7 +190,7 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
} while(mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 && ++iter < 10); } while(mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 && ++iter < 10);
yPlus[facei] = yp; yPlus[facei] = max(0.0, yp);
} }
} }
@ -243,39 +274,6 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<scalarField>
nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const scalarField& y = rasModel.y()[patchI];
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
// The flow velocity at the adjacent cell centre
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
tmp<scalarField> tyPlus = calcYPlus(magUp);
scalarField& yPlus = tyPlus();
tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0));
scalarField& nutw = tnutw();
forAll(yPlus, facei)
{
if (yPlus[facei] > yPlusLam)
{
const scalar Re = magUp[facei]*y[facei]/nuw[facei];
nutw[facei] = nuw[facei]*(sqr(yPlus[facei])/Re - 1);
}
}
return tnutw;
}
tmp<scalarField> tmp<scalarField>
nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::yPlus() const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::yPlus() const
{ {

View File

@ -41,6 +41,35 @@ namespace RASModels
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
tmp<scalarField>
nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
tmp<scalarField> tyPlus = calcYPlus(magUp);
scalarField& yPlus = tyPlus();
tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0));
scalarField& nutw = tnutw();
forAll(yPlus, facei)
{
if (yPlus[facei] > yPlusLam_)
{
nutw[facei] =
nuw[facei]*(yPlus[facei]*kappa_/log(E_*yPlus[facei]) - 1.0);
}
}
return tnutw;
}
tmp<scalarField> tmp<scalarField>
nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcYPlus nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcYPlus
( (
@ -50,7 +79,6 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcYPlus
const label patchI = patch().index(); const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const scalarField& y = rasModel.y()[patchI]; const scalarField& y = rasModel.y()[patchI];
const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
@ -61,7 +89,7 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcYPlus
{ {
scalar kappaRe = kappa_*magUp[facei]*y[facei]/nuw[facei]; scalar kappaRe = kappa_*magUp[facei]*y[facei]/nuw[facei];
scalar yp = yPlusLam; scalar yp = yPlusLam_;
scalar ryPlusLam = 1.0/yp; scalar ryPlusLam = 1.0/yp;
int iter = 0; int iter = 0;
@ -142,36 +170,6 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<scalarField>
nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
tmp<scalarField> tyPlus = calcYPlus(magUp);
scalarField& yPlus = tyPlus();
tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0));
scalarField& nutw = tnutw();
forAll(yPlus, facei)
{
if (yPlus[facei] > yPlusLam)
{
nutw[facei] =
nuw[facei]*(yPlus[facei]*kappa_/log(E_*yPlus[facei]) - 1.0);
}
}
return tnutw;
}
tmp<scalarField> tmp<scalarField>
nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::yPlus() const nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::yPlus() const
{ {

View File

@ -39,7 +39,21 @@ namespace incompressible
namespace RASModels namespace RASModels
{ {
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
tmp<scalarField>
nutSpalartAllmarasWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField magGradU = mag(Uw.snGrad());
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
return max(0.0, sqr(calcUTau(magGradU))/magGradU - nuw);
}
tmp<scalarField> nutSpalartAllmarasWallFunctionFvPatchScalarField::calcUTau tmp<scalarField> nutSpalartAllmarasWallFunctionFvPatchScalarField::calcUTau
( (
@ -159,20 +173,6 @@ nutSpalartAllmarasWallFunctionFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<scalarField>
nutSpalartAllmarasWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField magGradU = mag(Uw.snGrad());
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
return max(0.0, sqr(calcUTau(magGradU))/magGradU - nuw);
}
tmp<scalarField> tmp<scalarField>
nutSpalartAllmarasWallFunctionFvPatchScalarField::yPlus() const nutSpalartAllmarasWallFunctionFvPatchScalarField::yPlus() const
{ {

Some files were not shown because too many files have changed in this diff Show More