mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'feature-nonorthogonal-correction-schemes' into 'develop'
ENH: New schemes for non-orthogonal meshes See merge request Development/openfoam!502
This commit is contained in:
@ -456,6 +456,7 @@ $(snGradSchemes)/orthogonalSnGrad/orthogonalSnGrads.C
|
||||
$(snGradSchemes)/quadraticFitSnGrad/quadraticFitSnGrads.C
|
||||
$(snGradSchemes)/linearFitSnGrad/linearFitSnGrads.C
|
||||
$(snGradSchemes)/skewCorrectedSnGrad/skewCorrectedSnGrads.C
|
||||
$(snGradSchemes)/relaxedSnGrad/relaxedSnGrads.C
|
||||
|
||||
convectionSchemes = finiteVolume/convectionSchemes
|
||||
$(convectionSchemes)/convectionScheme/convectionSchemes.C
|
||||
@ -466,6 +467,7 @@ $(convectionSchemes)/boundedConvectionScheme/boundedConvectionSchemes.C
|
||||
laplacianSchemes = finiteVolume/laplacianSchemes
|
||||
$(laplacianSchemes)/laplacianScheme/laplacianSchemes.C
|
||||
$(laplacianSchemes)/gaussLaplacianScheme/gaussLaplacianSchemes.C
|
||||
$(laplacianSchemes)/relaxedNonOrthoGaussLaplacianScheme/relaxedNonOrthoGaussLaplacianSchemes.C
|
||||
|
||||
finiteVolume/fvc/fvcFlux.C
|
||||
finiteVolume/fvc/fvcMeshPhi.C
|
||||
|
||||
@ -0,0 +1,276 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "relaxedNonOrthoGaussLaplacianScheme.H"
|
||||
#include "surfaceInterpolate.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "fvcGrad.H"
|
||||
#include "fvMatrices.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace fv
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type, class GType>
|
||||
tmp<fvMatrix<Type>>
|
||||
relaxedNonOrthoGaussLaplacianScheme<Type, GType>::fvmLaplacianUncorrected
|
||||
(
|
||||
const surfaceScalarField& gammaMagSf,
|
||||
const surfaceScalarField& deltaCoeffs,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
tmp<fvMatrix<Type>> tfvm
|
||||
(
|
||||
new fvMatrix<Type>
|
||||
(
|
||||
vf,
|
||||
deltaCoeffs.dimensions()*gammaMagSf.dimensions()*vf.dimensions()
|
||||
)
|
||||
);
|
||||
fvMatrix<Type>& fvm = tfvm.ref();
|
||||
|
||||
fvm.upper() = deltaCoeffs.primitiveField()*gammaMagSf.primitiveField();
|
||||
fvm.negSumDiag();
|
||||
|
||||
forAll(vf.boundaryField(), patchi)
|
||||
{
|
||||
const fvPatchField<Type>& pvf = vf.boundaryField()[patchi];
|
||||
const fvsPatchScalarField& pGamma = gammaMagSf.boundaryField()[patchi];
|
||||
const fvsPatchScalarField& pDeltaCoeffs =
|
||||
deltaCoeffs.boundaryField()[patchi];
|
||||
|
||||
if (pvf.coupled())
|
||||
{
|
||||
fvm.internalCoeffs()[patchi] =
|
||||
pGamma*pvf.gradientInternalCoeffs(pDeltaCoeffs);
|
||||
fvm.boundaryCoeffs()[patchi] =
|
||||
-pGamma*pvf.gradientBoundaryCoeffs(pDeltaCoeffs);
|
||||
}
|
||||
else
|
||||
{
|
||||
fvm.internalCoeffs()[patchi] = pGamma*pvf.gradientInternalCoeffs();
|
||||
fvm.boundaryCoeffs()[patchi] = -pGamma*pvf.gradientBoundaryCoeffs();
|
||||
}
|
||||
}
|
||||
|
||||
return tfvm;
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class GType>
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
relaxedNonOrthoGaussLaplacianScheme<Type, GType>::gammaSnGradCorr
|
||||
(
|
||||
const surfaceVectorField& SfGammaCorr,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = this->mesh();
|
||||
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> tgammaSnGradCorr
|
||||
(
|
||||
new GeometricField<Type, fvsPatchField, surfaceMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"gammaSnGradCorr("+vf.name()+')',
|
||||
vf.instance(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
SfGammaCorr.dimensions()
|
||||
*vf.dimensions()*mesh.deltaCoeffs().dimensions()
|
||||
)
|
||||
);
|
||||
|
||||
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||
{
|
||||
tgammaSnGradCorr.ref().replace
|
||||
(
|
||||
cmpt,
|
||||
fvc::dotInterpolate(SfGammaCorr, fvc::grad(vf.component(cmpt)))
|
||||
);
|
||||
}
|
||||
|
||||
return tgammaSnGradCorr;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type, class GType>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>>
|
||||
relaxedNonOrthoGaussLaplacianScheme<Type, GType>::fvcLaplacian
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = this->mesh();
|
||||
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> tLaplacian
|
||||
(
|
||||
fvc::div(this->tsnGradScheme_().snGrad(vf)*mesh.magSf())
|
||||
);
|
||||
|
||||
tLaplacian.ref().rename("laplacian(" + vf.name() + ')');
|
||||
|
||||
return tLaplacian;
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class GType>
|
||||
tmp<fvMatrix<Type>>
|
||||
relaxedNonOrthoGaussLaplacianScheme<Type, GType>::fvmLaplacian
|
||||
(
|
||||
const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = this->mesh();
|
||||
|
||||
typedef GeometricField<Type, fvsPatchField, surfaceMesh> SType;
|
||||
|
||||
const surfaceVectorField Sn(mesh.Sf()/mesh.magSf());
|
||||
|
||||
const surfaceVectorField SfGamma(mesh.Sf() & gamma);
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn
|
||||
(
|
||||
SfGamma & Sn
|
||||
);
|
||||
const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn);
|
||||
|
||||
tmp<fvMatrix<Type>> tfvm = fvmLaplacianUncorrected
|
||||
(
|
||||
SfGammaSn,
|
||||
this->tsnGradScheme_().deltaCoeffs(vf),
|
||||
vf
|
||||
);
|
||||
fvMatrix<Type>& fvm = tfvm.ref();
|
||||
|
||||
tmp<SType> tfaceFluxCorrection = gammaSnGradCorr(SfGammaCorr, vf);
|
||||
|
||||
if (this->tsnGradScheme_().corrected())
|
||||
{
|
||||
tfaceFluxCorrection.ref() +=
|
||||
SfGammaSn*this->tsnGradScheme_().correction(vf);
|
||||
}
|
||||
|
||||
const word corrName(tfaceFluxCorrection().name());
|
||||
|
||||
tmp<SType> trelaxedCorrection(new SType(tfaceFluxCorrection()));
|
||||
|
||||
const word oldName(corrName + "_0");
|
||||
const scalar relax(vf.mesh().equationRelaxationFactor(oldName));
|
||||
|
||||
const objectRegistry& obr = vf.db();
|
||||
if (obr.foundObject<SType>(oldName))
|
||||
{
|
||||
SType& oldCorrection = obr.lookupObjectRef<SType>(oldName);
|
||||
|
||||
trelaxedCorrection.ref() *= relax;
|
||||
trelaxedCorrection.ref() += (1.0-relax)*oldCorrection;
|
||||
|
||||
oldCorrection = tfaceFluxCorrection;
|
||||
}
|
||||
else
|
||||
{
|
||||
SType* s = new SType(oldName, tfaceFluxCorrection);
|
||||
s->store();
|
||||
}
|
||||
|
||||
fvm.source() -=
|
||||
mesh.V()
|
||||
*fvc::div
|
||||
(
|
||||
trelaxedCorrection()
|
||||
)().primitiveField();
|
||||
|
||||
if (mesh.fluxRequired(vf.name()))
|
||||
{
|
||||
fvm.faceFluxCorrectionPtr() = trelaxedCorrection.ptr();
|
||||
}
|
||||
|
||||
return tfvm;
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class GType>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>>
|
||||
relaxedNonOrthoGaussLaplacianScheme<Type, GType>::fvcLaplacian
|
||||
(
|
||||
const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = this->mesh();
|
||||
|
||||
const surfaceVectorField Sn(mesh.Sf()/mesh.magSf());
|
||||
const surfaceVectorField SfGamma(mesh.Sf() & gamma);
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn
|
||||
(
|
||||
SfGamma & Sn
|
||||
);
|
||||
const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn);
|
||||
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> tLaplacian
|
||||
(
|
||||
fvc::div
|
||||
(
|
||||
SfGammaSn*this->tsnGradScheme_().snGrad(vf)
|
||||
+ gammaSnGradCorr(SfGammaCorr, vf)
|
||||
)
|
||||
);
|
||||
|
||||
tLaplacian.ref().rename
|
||||
(
|
||||
"laplacian(" + gamma.name() + ',' + vf.name() + ')'
|
||||
);
|
||||
|
||||
return tLaplacian;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace fv
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,210 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::fv::relaxedNonOrthoGaussLaplacianScheme
|
||||
|
||||
Description
|
||||
Basic second-order laplacian using face-gradients and Gauss' theorem.
|
||||
|
||||
Usage
|
||||
Minimal example by using \c system/fvSchemes:
|
||||
\verbatim
|
||||
laplacianSchemes
|
||||
{
|
||||
laplacian(<term>) relaxedNonOrthoGauss <other options>;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
and by using \c system/fvSolution:
|
||||
\verbatim
|
||||
relaxationFactors
|
||||
{
|
||||
equations
|
||||
{
|
||||
<term> <relaxation factor>;
|
||||
}
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
relaxedNonOrthoGaussLaplacianScheme.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef relaxedNonOrthoGaussLaplacianScheme_H
|
||||
#define relaxedNonOrthoGaussLaplacianScheme_H
|
||||
|
||||
#include "laplacianScheme.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class relaxedNonOrthoGaussLaplacianScheme Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type, class GType>
|
||||
class relaxedNonOrthoGaussLaplacianScheme
|
||||
:
|
||||
public fv::laplacianScheme<Type, GType>
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> gammaSnGradCorr
|
||||
(
|
||||
const surfaceVectorField& SfGammaCorr,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
//- No copy construct
|
||||
relaxedNonOrthoGaussLaplacianScheme
|
||||
(
|
||||
const relaxedNonOrthoGaussLaplacianScheme&
|
||||
) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const relaxedNonOrthoGaussLaplacianScheme&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("relaxedNonOrthoGauss");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
relaxedNonOrthoGaussLaplacianScheme(const fvMesh& mesh)
|
||||
:
|
||||
laplacianScheme<Type, GType>(mesh)
|
||||
{}
|
||||
|
||||
//- Construct from Istream
|
||||
relaxedNonOrthoGaussLaplacianScheme(const fvMesh& mesh, Istream& is)
|
||||
:
|
||||
laplacianScheme<Type, GType>(mesh, is)
|
||||
{}
|
||||
|
||||
//- Construct from mesh, interpolation and snGradScheme schemes
|
||||
relaxedNonOrthoGaussLaplacianScheme
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const tmp<surfaceInterpolationScheme<GType>>& igs,
|
||||
const tmp<snGradScheme<Type>>& sngs
|
||||
)
|
||||
:
|
||||
laplacianScheme<Type, GType>(mesh, igs, sngs)
|
||||
{}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~relaxedNonOrthoGaussLaplacianScheme() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
static tmp<fvMatrix<Type>> fvmLaplacianUncorrected
|
||||
(
|
||||
const surfaceScalarField& gammaMagSf,
|
||||
const surfaceScalarField& deltaCoeffs,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> fvcLaplacian
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
tmp<fvMatrix<Type>> fvmLaplacian
|
||||
(
|
||||
const GeometricField<GType, fvsPatchField, surfaceMesh>&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> fvcLaplacian
|
||||
(
|
||||
const GeometricField<GType, fvsPatchField, surfaceMesh>&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// Use macros to emulate partial-specialisation of the Laplacian functions
|
||||
// for scalar diffusivity gamma
|
||||
|
||||
#define defineFvmLaplacianScalarGamma(Type) \
|
||||
\
|
||||
template<> \
|
||||
tmp<fvMatrix<Type>> \
|
||||
relaxedNonOrthoGaussLaplacianScheme<Type, scalar>::fvmLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& \
|
||||
); \
|
||||
\
|
||||
template<> \
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> \
|
||||
relaxedNonOrthoGaussLaplacianScheme<Type, scalar>::fvcLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& \
|
||||
);
|
||||
|
||||
|
||||
defineFvmLaplacianScalarGamma(scalar);
|
||||
defineFvmLaplacianScalarGamma(vector);
|
||||
defineFvmLaplacianScalarGamma(sphericalTensor);
|
||||
defineFvmLaplacianScalarGamma(symmTensor);
|
||||
defineFvmLaplacianScalarGamma(tensor);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace fv
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "relaxedNonOrthoGaussLaplacianScheme.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,140 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "relaxedNonOrthoGaussLaplacianScheme.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeFvLaplacianScheme(relaxedNonOrthoGaussLaplacianScheme)
|
||||
|
||||
#define declareFvmLaplacianScalarGamma(Type) \
|
||||
\
|
||||
template<> \
|
||||
Foam::tmp<Foam::fvMatrix<Foam::Type>> \
|
||||
Foam::fv::relaxedNonOrthoGaussLaplacianScheme<Foam::Type, Foam::scalar>:: \
|
||||
fvmLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>& gamma, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf \
|
||||
) \
|
||||
{ \
|
||||
const fvMesh& mesh = this->mesh(); \
|
||||
\
|
||||
typedef GeometricField<Type, fvsPatchField, surfaceMesh> SType; \
|
||||
\
|
||||
GeometricField<scalar, fvsPatchField, surfaceMesh> gammaMagSf \
|
||||
( \
|
||||
gamma*mesh.magSf() \
|
||||
); \
|
||||
\
|
||||
tmp<fvMatrix<Type>> tfvm = fvmLaplacianUncorrected \
|
||||
( \
|
||||
gammaMagSf, \
|
||||
this->tsnGradScheme_().deltaCoeffs(vf), \
|
||||
vf \
|
||||
); \
|
||||
fvMatrix<Type>& fvm = tfvm.ref(); \
|
||||
\
|
||||
if (this->tsnGradScheme_().corrected()) \
|
||||
{ \
|
||||
tmp<SType> tCorr(this->tsnGradScheme_().correction(vf)); \
|
||||
const word corrName(tCorr().name()); \
|
||||
tmp<SType> tfaceFluxCorrection(gammaMagSf*tCorr); \
|
||||
\
|
||||
tmp<SType> trelaxedCorrection(new SType(tfaceFluxCorrection())); \
|
||||
\
|
||||
const word oldName(corrName + "_0"); \
|
||||
const scalar relax(vf.mesh().equationRelaxationFactor(corrName)); \
|
||||
const objectRegistry& obr = vf.db(); \
|
||||
if (obr.foundObject<SType>(oldName)) \
|
||||
{ \
|
||||
SType& oldCorrection = obr.lookupObjectRef<SType>(oldName); \
|
||||
trelaxedCorrection.ref() *= relax; \
|
||||
trelaxedCorrection.ref() += (1.0-relax)*oldCorrection; \
|
||||
\
|
||||
oldCorrection = trelaxedCorrection(); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
SType* s = new SType(oldName, tfaceFluxCorrection); \
|
||||
s->store(); \
|
||||
} \
|
||||
\
|
||||
tmp<Field<Type>> tcorr \
|
||||
( \
|
||||
mesh.V() \
|
||||
*fvc::div \
|
||||
( \
|
||||
trelaxedCorrection() \
|
||||
)().primitiveField() \
|
||||
); \
|
||||
\
|
||||
fvm.source() -= tcorr(); \
|
||||
\
|
||||
if (mesh.fluxRequired(vf.name())) \
|
||||
{ \
|
||||
fvm.faceFluxCorrectionPtr() = trelaxedCorrection.ptr(); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
return tfvm; \
|
||||
} \
|
||||
\
|
||||
\
|
||||
template<> \
|
||||
Foam::tmp<Foam::GeometricField<Foam::Type, Foam::fvPatchField, Foam::volMesh>> \
|
||||
Foam::fv::relaxedNonOrthoGaussLaplacianScheme<Foam::Type, Foam::scalar>::fvcLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>& gamma, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf \
|
||||
) \
|
||||
{ \
|
||||
const fvMesh& mesh = this->mesh(); \
|
||||
\
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> tLaplacian \
|
||||
( \
|
||||
fvc::div(gamma*this->tsnGradScheme_().snGrad(vf)*mesh.magSf()) \
|
||||
); \
|
||||
\
|
||||
tLaplacian.ref().rename \
|
||||
( \
|
||||
"laplacian(" + gamma.name() + ',' + vf.name() + ')' \
|
||||
); \
|
||||
\
|
||||
return tLaplacian; \
|
||||
}
|
||||
|
||||
|
||||
declareFvmLaplacianScalarGamma(scalar);
|
||||
declareFvmLaplacianScalarGamma(vector);
|
||||
declareFvmLaplacianScalarGamma(sphericalTensor);
|
||||
declareFvmLaplacianScalarGamma(symmTensor);
|
||||
declareFvmLaplacianScalarGamma(tensor);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -109,7 +110,7 @@ public:
|
||||
}
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
virtual bool corrected() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -32,13 +33,6 @@ License
|
||||
#include "fvcGrad.H"
|
||||
#include "gaussGrad.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::fv::correctedSnGrad<Type>::~correctedSnGrad()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
@ -96,7 +90,7 @@ Foam::fv::correctedSnGrad<Type>::correction
|
||||
GeometricField<Type, fvsPatchField, surfaceMesh>& ssf = tssf.ref();
|
||||
ssf.setOriented();
|
||||
|
||||
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; ++cmpt)
|
||||
{
|
||||
ssf.replace
|
||||
(
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,7 +31,16 @@ Group
|
||||
grpFvSnGradSchemes
|
||||
|
||||
Description
|
||||
Simple central-difference snGrad scheme with non-orthogonal correction.
|
||||
Surface gradient scheme with full explicit non-orthogonal correction.
|
||||
|
||||
Usage
|
||||
Minimal example by using \c system/fvSchemes:
|
||||
\verbatim
|
||||
snGradSchemes
|
||||
{
|
||||
snGrad(<term>) corrected;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
correctedSnGrad.C
|
||||
@ -53,7 +63,7 @@ namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class correctedSnGrad Declaration
|
||||
Class correctedSnGrad Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
@ -81,7 +91,6 @@ public:
|
||||
snGradScheme<Type>(mesh)
|
||||
{}
|
||||
|
||||
|
||||
//- Construct from mesh and data stream
|
||||
correctedSnGrad(const fvMesh& mesh, Istream&)
|
||||
:
|
||||
@ -90,7 +99,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~correctedSnGrad();
|
||||
virtual ~correctedSnGrad() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -105,13 +114,13 @@ public:
|
||||
}
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
virtual bool corrected() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Return the explicit correction to the correctedSnGrad
|
||||
// for the given field using the gradient of the field
|
||||
//- for the given field using the gradient of the field
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
fullGradCorrection
|
||||
(
|
||||
@ -119,7 +128,7 @@ public:
|
||||
) const;
|
||||
|
||||
//- Return the explicit correction to the correctedSnGrad
|
||||
// for the given field using the gradients of the field components
|
||||
//- for the given field using the gradients of the field components
|
||||
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
correction(const GeometricField<Type, fvPatchField, volMesh>&) const;
|
||||
};
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -29,13 +30,6 @@ License
|
||||
#include "volPointInterpolation.H"
|
||||
#include "triangle.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::fv::faceCorrectedSnGrad<Type>::~faceCorrectedSnGrad()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
@ -89,18 +83,18 @@ Foam::fv::faceCorrectedSnGrad<Type>::fullGradCorrection
|
||||
|
||||
const face& fi = faces[facei];
|
||||
|
||||
vector nf(Sf[facei]/magSf[facei]);
|
||||
const vector nf(Sf[facei]/magSf[facei]);
|
||||
|
||||
for (label pi=0; pi<fi.size(); pi++)
|
||||
for (label pi = 0; pi < fi.size(); ++pi)
|
||||
{
|
||||
// Next point index
|
||||
label pj = (pi+1)%fi.size();
|
||||
const label pj = fi.fcIndex(pi);
|
||||
|
||||
// Edge normal in plane of face
|
||||
vector edgen(nf^(points[fi[pj]] - points[fi[pi]]));
|
||||
const vector edgen(nf^(points[fi[pj]] - points[fi[pi]]));
|
||||
|
||||
// Edge centre field value
|
||||
Type pvfe(0.5*(pvf[fi[pj]] + pvf[fi[pi]]));
|
||||
const Type pvfe(0.5*(pvf[fi[pj]] + pvf[fi[pi]]));
|
||||
|
||||
// Integrate face gradient
|
||||
fgrad += edgen*pvfe;
|
||||
@ -113,8 +107,6 @@ Foam::fv::faceCorrectedSnGrad<Type>::fullGradCorrection
|
||||
vector dCorr(C[neighbour[facei]] - C[owner[facei]]);
|
||||
dCorr /= (nf & dCorr);
|
||||
|
||||
// if (mag(dCorr) > 2) dCorr *= 2/mag(dCorr);
|
||||
|
||||
sfCorr[facei] = dCorr&fgrad;
|
||||
}
|
||||
|
||||
@ -152,7 +144,7 @@ Foam::fv::faceCorrectedSnGrad<Type>::correction
|
||||
);
|
||||
GeometricField<Type, fvsPatchField, surfaceMesh>& ssf = tssf.ref();
|
||||
|
||||
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; ++cmpt)
|
||||
{
|
||||
ssf.replace
|
||||
(
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,7 +31,16 @@ Group
|
||||
grpFvSnGradSchemes
|
||||
|
||||
Description
|
||||
Simple central-difference snGrad scheme with non-orthogonal correction.
|
||||
Surface gradient scheme with full explicit non-orthogonal correction.
|
||||
|
||||
Usage
|
||||
Minimal example by using \c system/fvSchemes:
|
||||
\verbatim
|
||||
snGradSchemes
|
||||
{
|
||||
snGrad(<term>) faceCorrected;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
faceCorrectedSnGrad.C
|
||||
@ -53,7 +63,7 @@ namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class faceCorrectedSnGrad Declaration
|
||||
Class faceCorrectedSnGrad Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
@ -81,7 +91,6 @@ public:
|
||||
snGradScheme<Type>(mesh)
|
||||
{}
|
||||
|
||||
|
||||
//- Construct from mesh and data stream
|
||||
faceCorrectedSnGrad(const fvMesh& mesh, Istream&)
|
||||
:
|
||||
@ -90,7 +99,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~faceCorrectedSnGrad();
|
||||
virtual ~faceCorrectedSnGrad() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -105,13 +114,13 @@ public:
|
||||
}
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
virtual bool corrected() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Return the explicit correction to the faceCorrectedSnGrad
|
||||
// for the given field using the gradient of the field
|
||||
//- for the given field using the gradient of the field
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
fullGradCorrection
|
||||
(
|
||||
@ -119,7 +128,7 @@ public:
|
||||
) const;
|
||||
|
||||
//- Return the explicit correction to the faceCorrectedSnGrad
|
||||
// for the given field using the gradients of the field components
|
||||
//- for the given field using the gradients of the field components
|
||||
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
correction(const GeometricField<Type, fvPatchField, volMesh>&) const;
|
||||
};
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -42,13 +43,6 @@ namespace Foam
|
||||
namespace fv
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
limitedSnGrad<Type>::~limitedSnGrad()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,20 +31,26 @@ Group
|
||||
grpFvSnGradSchemes
|
||||
|
||||
Description
|
||||
Run-time selected snGrad scheme with limited non-orthogonal correction.
|
||||
Surface gradient scheme with limited explicit non-orthogonal correction.
|
||||
|
||||
The limiter is controlled by a coefficient with a value between 0 and 1
|
||||
which when 0 switches the correction off and the scheme behaves as
|
||||
uncorrectedSnGrad, when set to 1 the full correction of the selected scheme
|
||||
is used and when set to 0.5 the limiter is calculated such that the
|
||||
non-orthogonal contribution does not exceed the orthogonal part.
|
||||
\c uncorrected \c snGrad, when set to 1 the full correction of the
|
||||
selected scheme is used and the scheme behaves as \c corrected \c snGrad,
|
||||
and when set to 0.5 the limiter is calculated such that the non-orthogonal
|
||||
component does not exceed the orthogonal component.
|
||||
|
||||
Format:
|
||||
limited \<corrected scheme\> \<coefficient\>;
|
||||
Usage
|
||||
Minimal example by using \c system/fvSchemes:
|
||||
\verbatim
|
||||
snGradSchemes
|
||||
{
|
||||
snGrad(<term>) limited <corrected scheme> <coefficient>;
|
||||
|
||||
or
|
||||
|
||||
limited \<coefficient\>; // Backward compatibility
|
||||
// Backward compatibility
|
||||
snGrad(<term>) limited <coefficient>;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
limitedSnGrad.C
|
||||
@ -66,7 +73,7 @@ namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class limitedSnGrad Declaration
|
||||
Class limitedSnGrad Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
@ -74,10 +81,12 @@ class limitedSnGrad
|
||||
:
|
||||
public snGradScheme<Type>
|
||||
{
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Type of correction scheme
|
||||
tmp<snGradScheme<Type>> correctedScheme_;
|
||||
|
||||
//- Limiter coefficient
|
||||
scalar limitCoeff_;
|
||||
|
||||
|
||||
@ -87,7 +96,7 @@ class limitedSnGrad
|
||||
void operator=(const limitedSnGrad&) = delete;
|
||||
|
||||
//- Lookup function for the corrected to support backward compatibility
|
||||
// of dictionary specification
|
||||
//- of dictionary specification
|
||||
tmp<snGradScheme<Type>> lookupCorrectedScheme(Istream& schemeData)
|
||||
{
|
||||
token nextToken(schemeData);
|
||||
@ -131,7 +140,6 @@ public:
|
||||
limitCoeff_(1)
|
||||
{}
|
||||
|
||||
|
||||
//- Construct from mesh and data stream
|
||||
limitedSnGrad(const fvMesh& mesh, Istream& schemeData)
|
||||
:
|
||||
@ -149,7 +157,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~limitedSnGrad();
|
||||
virtual ~limitedSnGrad() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -164,13 +172,13 @@ public:
|
||||
}
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
virtual bool corrected() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Return the explicit correction to the limitedSnGrad
|
||||
// for the given field
|
||||
//- for the given field
|
||||
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
correction(const GeometricField<Type, fvPatchField, volMesh>&) const;
|
||||
};
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -23,13 +24,6 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Central-difference snGrad scheme with limited non-orthogonal correction.
|
||||
The limiter is controlled by a coefficient with a value between 0 and 1
|
||||
which when zero switches the limiter off and the scheme behaves as
|
||||
correctedSnGrad, and when set to 1 the limiter is calculated such that the
|
||||
non-orthogonal contribution does not exceed the orthogonal part.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "limitedSnGrad.H"
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -23,9 +24,6 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Simple central-difference snGrad scheme without non-orthogonal correction.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "orthogonalSnGrad.H"
|
||||
@ -42,13 +40,6 @@ namespace Foam
|
||||
namespace fv
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
orthogonalSnGrad<Type>::~orthogonalSnGrad()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,8 +31,21 @@ Group
|
||||
grpFvSnGradSchemes
|
||||
|
||||
Description
|
||||
Simple central-difference snGrad scheme using the cell-centre to cell-centre
|
||||
delta-coefficients.
|
||||
Surface gradient scheme with no non-orthogonal correction.
|
||||
|
||||
Usage
|
||||
Minimal example by using \c system/fvSchemes:
|
||||
\verbatim
|
||||
snGradSchemes
|
||||
{
|
||||
snGrad(<term>) orthogonal;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
Note
|
||||
- Interpolation weighting factors (i.e. delta coefficients) are based
|
||||
on the \c deltaCoeffs function rather than the \c nonOrthDeltaCoeffs
|
||||
function, which is used by the \c uncorrected scheme.
|
||||
|
||||
SourceFiles
|
||||
orthogonalSnGrad.C
|
||||
@ -54,7 +68,7 @@ namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class orthogonalSnGrad Declaration
|
||||
Class orthogonalSnGrad Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
@ -82,7 +96,6 @@ public:
|
||||
snGradScheme<Type>(mesh)
|
||||
{}
|
||||
|
||||
|
||||
//- Construct from mesh and data stream
|
||||
orthogonalSnGrad(const fvMesh& mesh, Istream&)
|
||||
:
|
||||
@ -91,7 +104,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~orthogonalSnGrad();
|
||||
virtual ~orthogonalSnGrad() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -106,13 +119,13 @@ public:
|
||||
}
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
virtual bool corrected() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//- Return the explicit correction to the orthogonalSnGrad
|
||||
// for the given field
|
||||
//- for the given field
|
||||
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
correction(const GeometricField<Type, fvPatchField, volMesh>&) const;
|
||||
};
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -23,9 +24,6 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Simple central-difference snGrad scheme without non-orthogonal correction.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "orthogonalSnGrad.H"
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fv.H"
|
||||
#include "relaxedSnGrad.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>>
|
||||
Foam::fv::relaxedSnGrad<Type>::correction
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
) const
|
||||
{
|
||||
typedef GeometricField<Type, fvsPatchField, surfaceMesh> SurfFieldType;
|
||||
|
||||
// Calculate explicit correction field
|
||||
tmp<SurfFieldType> tcorrection = correctedScheme_().correction(vf);
|
||||
|
||||
// Retrieve relaxation factor value
|
||||
const word fieldName(vf.name());
|
||||
const word oldFieldName(fieldName + "_0");
|
||||
const scalar relax =
|
||||
vf.mesh().fieldRelaxationFactor("snGrad("+fieldName+")");
|
||||
|
||||
// Return explicit correction field if
|
||||
// previous-time step correction is unavailable
|
||||
const objectRegistry& obr = vf.db();
|
||||
if (!obr.foundObject<SurfFieldType>(oldFieldName))
|
||||
{
|
||||
SurfFieldType* oldCorrection =
|
||||
new SurfFieldType(oldFieldName, tcorrection());
|
||||
oldCorrection->store();
|
||||
}
|
||||
|
||||
// Return under/over-relaxed explicit correction field
|
||||
tmp<SurfFieldType> trelaxedCorrection(new SurfFieldType(tcorrection()));
|
||||
|
||||
SurfFieldType& oldCorrection =
|
||||
obr.lookupObjectRef<SurfFieldType>(oldFieldName);
|
||||
|
||||
trelaxedCorrection.ref() *= relax;
|
||||
trelaxedCorrection.ref() += (scalar(1) - relax)*oldCorrection;
|
||||
|
||||
oldCorrection = tcorrection;
|
||||
|
||||
return trelaxedCorrection;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,166 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::fv::relaxedSnGrad
|
||||
|
||||
Group
|
||||
grpFvSnGradSchemes
|
||||
|
||||
Description
|
||||
Surface gradient scheme with under-/over-relaxed
|
||||
full or limited explicit non-orthogonal correction.
|
||||
|
||||
Usage
|
||||
Minimal example by using \c system/fvSchemes:
|
||||
\verbatim
|
||||
snGradSchemes
|
||||
{
|
||||
snGrad(<term>) relaxed;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
and by using \c system/fvSolution:
|
||||
\verbatim
|
||||
relaxationFactors
|
||||
{
|
||||
fields
|
||||
{
|
||||
snGrad(<term>) <relaxation factor>;
|
||||
}
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
|
||||
SourceFiles
|
||||
relaxedSnGrad.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef relaxedSnGrad_H
|
||||
#define relaxedSnGrad_H
|
||||
|
||||
#include "correctedSnGrad.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class relaxedSnGrad Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class relaxedSnGrad
|
||||
:
|
||||
public snGradScheme<Type>
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Type of correction scheme
|
||||
tmp<snGradScheme<Type>> correctedScheme_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const relaxedSnGrad&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("relaxed");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
relaxedSnGrad(const fvMesh& mesh)
|
||||
:
|
||||
snGradScheme<Type>(mesh),
|
||||
correctedScheme_(new correctedSnGrad<Type>(this->mesh()))
|
||||
{}
|
||||
|
||||
//- Construct from mesh and data stream
|
||||
relaxedSnGrad(const fvMesh& mesh, Istream& schemeData)
|
||||
:
|
||||
snGradScheme<Type>(mesh),
|
||||
correctedScheme_(new correctedSnGrad<Type>(this->mesh()))
|
||||
{}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~relaxedSnGrad() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the interpolation weighting factors for the given field
|
||||
virtual tmp<surfaceScalarField> deltaCoeffs
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
) const
|
||||
{
|
||||
return this->mesh().nonOrthDeltaCoeffs();
|
||||
}
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Return the explicit correction to the relaxedSnGrad
|
||||
//- for the given field using the gradients of the field components
|
||||
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
correction(const GeometricField<Type, fvPatchField, volMesh>&) const;
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace fv
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "relaxedSnGrad.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,35 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "relaxedSnGrad.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeSnGradScheme(relaxedSnGrad)
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019 Zeljko Tukovic, FSB Zagreb.
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -72,8 +73,6 @@ Foam::fv::skewCorrectedSnGrad<Type>::fullGradCorrection
|
||||
const vectorField& Sf = mesh.Sf().internalField();
|
||||
const scalarField& magSf = mesh.magSf().internalField();
|
||||
|
||||
vectorField nf(Sf/magSf);
|
||||
|
||||
const vectorField& Cf = mesh.Cf().internalField();
|
||||
const vectorField& C = mesh.C().internalField();
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019 Zeljko Tukovic, FSB Zagreb.
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,7 +31,17 @@ Group
|
||||
grpFvSnGradSchemes
|
||||
|
||||
Description
|
||||
Simple central-difference snGrad scheme with non-orthogonal correction.
|
||||
Surface gradient scheme with skewness and full
|
||||
explicit non-orthogonal corrections.
|
||||
|
||||
Usage
|
||||
Minimal example by using \c system/fvSchemes:
|
||||
\verbatim
|
||||
snGradSchemes
|
||||
{
|
||||
snGrad(<term>) skewCorrected;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
skewCorrectedSnGrad.C
|
||||
@ -81,7 +92,6 @@ public:
|
||||
snGradScheme<Type>(mesh)
|
||||
{}
|
||||
|
||||
|
||||
//- Construct from mesh and data stream
|
||||
skewCorrectedSnGrad(const fvMesh& mesh, Istream&)
|
||||
:
|
||||
@ -105,7 +115,7 @@ public:
|
||||
}
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
virtual bool corrected() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -60,8 +60,8 @@ tmp<snGradScheme<Type>> snGradScheme<Type>::New
|
||||
{
|
||||
FatalIOErrorInFunction(schemeData)
|
||||
<< "Discretisation scheme not specified"
|
||||
<< endl << endl
|
||||
<< "Valid schemes are :" << endl
|
||||
<< nl << nl
|
||||
<< "Valid schemes are :" << nl
|
||||
<< MeshConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,7 +31,17 @@ Group
|
||||
grpFvSnGradSchemes
|
||||
|
||||
Description
|
||||
Abstract base class for snGrad schemes.
|
||||
Abstract base class for runtime selected \c snGrad surface
|
||||
normal gradient schemes.
|
||||
|
||||
A surface normal gradient is evaluated at a cell face. It
|
||||
is the normal-to-face component of the gradient of
|
||||
values at the centres of two cells that the face connects.
|
||||
|
||||
Unit-surface-normal vector decomposition is based on the
|
||||
so-called over-relaxed approach. Orthogonal components are
|
||||
treated implicitly and non-orthogonal components are treated
|
||||
explicitly with (or without) various limiters.
|
||||
|
||||
SourceFiles
|
||||
snGradScheme.C
|
||||
@ -59,7 +70,7 @@ namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class snGradScheme Declaration
|
||||
Class snGradScheme Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
@ -67,9 +78,9 @@ class snGradScheme
|
||||
:
|
||||
public refCount
|
||||
{
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Hold reference to mesh
|
||||
//- Hold const reference to mesh
|
||||
const fvMesh& mesh_;
|
||||
|
||||
|
||||
@ -125,14 +136,14 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return mesh reference
|
||||
//- Return const reference to mesh
|
||||
const fvMesh& mesh() const
|
||||
{
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
|
||||
//- Return the snGrad of the given cell field with the given deltaCoeffs
|
||||
//- Return the snGrad of the given cell field
|
||||
//- by using the given deltaCoeffs
|
||||
static tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
snGrad
|
||||
(
|
||||
@ -156,13 +167,13 @@ public:
|
||||
) const = 0;
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
virtual bool corrected() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//- Return the explicit correction to the snGrad
|
||||
// for the given field
|
||||
//- for the given field
|
||||
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
correction(const GeometricField<Type, fvPatchField, volMesh>&) const
|
||||
{
|
||||
@ -173,12 +184,12 @@ public:
|
||||
}
|
||||
|
||||
//- Return the snGrad of the given cell field
|
||||
// with explicit correction
|
||||
//- with explicit correction
|
||||
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
snGrad(const GeometricField<Type, fvPatchField, volMesh>&) const;
|
||||
|
||||
//- Return the snGrad of the given tmp cell field
|
||||
// with explicit correction
|
||||
//- with explicit correction
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
snGrad
|
||||
(
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -23,9 +24,6 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Abstract base class for snGrad schemes.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "snGradScheme.H"
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -23,9 +24,6 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Simple central-difference snGrad scheme without non-orthogonal correction.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "uncorrectedSnGrad.H"
|
||||
@ -42,13 +40,6 @@ namespace Foam
|
||||
namespace fv
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
uncorrectedSnGrad<Type>::~uncorrectedSnGrad()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,8 +31,21 @@ Group
|
||||
grpFvSnGradSchemes
|
||||
|
||||
Description
|
||||
Simple central-difference snGrad scheme using the non-orthogonal mesh
|
||||
delta-coefficients but without non-orthogonal correction.
|
||||
Surface gradient scheme with no non-orthogonal correction.
|
||||
|
||||
Usage
|
||||
Minimal example by using \c system/fvSchemes:
|
||||
\verbatim
|
||||
snGradSchemes
|
||||
{
|
||||
snGrad(<term>) uncorrected;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
Note
|
||||
- Interpolation weighting factors (i.e. delta coefficients) are based
|
||||
on the \c nonOrthDeltaCoeffs function rather than the \c deltaCoeffs
|
||||
function, which is used by the \c orthogonal scheme.
|
||||
|
||||
SourceFiles
|
||||
uncorrectedSnGrad.C
|
||||
@ -54,7 +68,7 @@ namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class uncorrectedSnGrad Declaration
|
||||
Class uncorrectedSnGrad Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
@ -82,7 +96,6 @@ public:
|
||||
snGradScheme<Type>(mesh)
|
||||
{}
|
||||
|
||||
|
||||
//- Construct from mesh and data stream
|
||||
uncorrectedSnGrad(const fvMesh& mesh, Istream&)
|
||||
:
|
||||
@ -91,7 +104,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~uncorrectedSnGrad();
|
||||
virtual ~uncorrectedSnGrad() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -106,13 +119,13 @@ public:
|
||||
}
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
virtual bool corrected() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//- Return the explicit correction to the uncorrectedSnGrad
|
||||
// for the given field
|
||||
//- for the given field
|
||||
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||
correction(const GeometricField<Type, fvPatchField, volMesh>&) const;
|
||||
};
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -23,9 +24,6 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Simple central-difference snGrad scheme without non-orthogonal correction.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "uncorrectedSnGrad.H"
|
||||
|
||||
14
tutorials/incompressible/simpleFoam/nonOrthogonalChannel/Allclean
Executable file
14
tutorials/incompressible/simpleFoam/nonOrthogonalChannel/Allclean
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
cleanCase0
|
||||
|
||||
rm -rf 0.orig
|
||||
rm -rf system
|
||||
rm -rf constant
|
||||
rm -rf results
|
||||
rm -rf plots
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
143
tutorials/incompressible/simpleFoam/nonOrthogonalChannel/Allrun
Executable file
143
tutorials/incompressible/simpleFoam/nonOrthogonalChannel/Allrun
Executable file
@ -0,0 +1,143 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# settings
|
||||
|
||||
# operand setups
|
||||
setups="
|
||||
0
|
||||
10
|
||||
20
|
||||
30
|
||||
40
|
||||
50
|
||||
60
|
||||
70
|
||||
80
|
||||
85
|
||||
"
|
||||
|
||||
# flag to enable computations in parallel mode
|
||||
parallel=true
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#######################################
|
||||
# Collect results into a given path
|
||||
# and clean the case for the next run
|
||||
# Arguments:
|
||||
# $1 = Path to move results
|
||||
# Outputs:
|
||||
# Writes info to stdout
|
||||
#######################################
|
||||
collect() {
|
||||
|
||||
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
|
||||
|
||||
collection="$1"
|
||||
|
||||
dirResult=results/"$collection"
|
||||
dirSettings="$dirResult"/system
|
||||
|
||||
if [ ! -d "$dirResult" ]
|
||||
then
|
||||
|
||||
echo " # Collecting results and settings into $dirResult"
|
||||
|
||||
mkdir -p "$dirSettings"
|
||||
|
||||
mv -f $(foamListTimes) "$dirResult"
|
||||
[ -d postProcessing ] && mv -f postProcessing "$dirResult"
|
||||
[ -d processor0 ] && mv -f processor* "$dirResult"
|
||||
mv -f log.* "$dirResult"
|
||||
mv -f logs "$dirResult"
|
||||
mv -f constant "$dirResult"/
|
||||
cp -f system/fv* system/controlDict "$dirSettings"
|
||||
mv -f 0/ "$dirSettings"
|
||||
|
||||
echo " # Cleaning up the case"
|
||||
|
||||
cleanTimeDirectories
|
||||
cleanPostProcessing
|
||||
|
||||
else
|
||||
|
||||
echo " # Directory $dirResult already exists"
|
||||
echo " # Skipping the computation"
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
for setup in $setups
|
||||
do
|
||||
|
||||
echo ""
|
||||
echo "# Computations for the setup: $setup"
|
||||
echo ""
|
||||
|
||||
dirSetup="setups.orig/$setup"
|
||||
|
||||
if [ ! -d "$dirSetup" ]
|
||||
then
|
||||
echo "Setup directory: $dirSetup" \
|
||||
"could not be found - skipping execution" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp -rfL "$dirSetup/0.orig" .
|
||||
cp -rfL "$dirSetup/constant" .
|
||||
cp -rfL "$dirSetup/system" .
|
||||
cp -rf 0.orig/ 0/
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication renumberMesh -overwrite -constant
|
||||
|
||||
runApplication checkMesh \
|
||||
-allTopology -allGeometry -constant \
|
||||
-writeAllFields -writeAllSurfaceFields
|
||||
|
||||
|
||||
if [ "$parallel" = true ]
|
||||
then
|
||||
|
||||
runApplication decomposePar
|
||||
|
||||
runParallel -s parallel renumberMesh -overwrite
|
||||
|
||||
runParallel $(getApplication)
|
||||
|
||||
runApplication reconstructPar
|
||||
|
||||
else
|
||||
|
||||
runApplication $(getApplication)
|
||||
|
||||
fi
|
||||
|
||||
# runtime sampling has problems in parallel mode (Apr 2021)
|
||||
runApplication \
|
||||
postProcess -func sample -latestTime
|
||||
|
||||
runApplication -s "epsilon" \
|
||||
postProcess -func sampleEpsilon -latestTime
|
||||
|
||||
runApplication -s "G"\
|
||||
postProcess -func sampleG -latestTime
|
||||
|
||||
runApplication foamLog log.$(getApplication)
|
||||
|
||||
collect "$setup"
|
||||
|
||||
done
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
663
tutorials/incompressible/simpleFoam/nonOrthogonalChannel/plot
Executable file
663
tutorials/incompressible/simpleFoam/nonOrthogonalChannel/plot
Executable file
@ -0,0 +1,663 @@
|
||||
#!/bin/bash
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# settings
|
||||
|
||||
# operand setups
|
||||
setups="
|
||||
0
|
||||
10
|
||||
20
|
||||
30
|
||||
40
|
||||
50
|
||||
60
|
||||
70
|
||||
80
|
||||
85
|
||||
"
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
plot_initial_iteration_residuals() {
|
||||
|
||||
setup="$1"
|
||||
|
||||
echo " Plotting the initial-iteration residuals for $setup"
|
||||
|
||||
# benchmarkFile="..."
|
||||
samples="results/$setup/logs"
|
||||
image="plots/$setup/initial-iteration-residuals.png"
|
||||
|
||||
gnuplot<<PLT_RES
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
set logscale y
|
||||
set key right top
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "Iters"
|
||||
set ylabel "Initial-iteration residuals"
|
||||
set offset .2, .05
|
||||
set output "$image"
|
||||
set title "Max non-orthogonality degree: $setup"
|
||||
|
||||
file_exists(file) = system("[ -f '".file."' ] && echo '1' || echo '0'") + 0
|
||||
|
||||
Ux="$samples/Ux_0"
|
||||
p="$samples/p_0"
|
||||
k="$samples/k_0"
|
||||
omega="$samples/omega_0"
|
||||
nuTilda="$samples/nuTilda_0"
|
||||
gammaInt="$samples/gammaInt_0"
|
||||
ReThetat="$samples/ReThetat_0"
|
||||
|
||||
if ( file_exists(k) ) {
|
||||
if ( ! file_exists(gammaInt) ) {
|
||||
plot \
|
||||
Ux u 1:2 t "Ux" w l lw 2 lc rgb "#009E73", \
|
||||
p u 1:2 t "p" w l lw 2 lc rgb "#F0E440", \
|
||||
k u 1:2 t "k" w l lw 2 lc rgb "#0072B2", \
|
||||
omega u 1:2 t "omega" w l lw 2 lc rgb "#D55E00"
|
||||
} else {
|
||||
plot \
|
||||
Ux u 1:2 t "Ux" w l lw 2 lc rgb "#009E73", \
|
||||
p u 1:2 t "p" w l lw 2 lc rgb "#F0E440", \
|
||||
k u 1:2 t "k" w l lw 2 lc rgb "#0072B2", \
|
||||
omega u 1:2 t "omega" w l lw 2 lc rgb "#D55E00", \
|
||||
gammaInt u 1:2 t "gammaInt" w l lw 2 lc rgb "#CC79A7", \
|
||||
ReThetat u 1:2 t "ReThetat" w l lw 2 lc rgb "#440154"
|
||||
}
|
||||
} else {
|
||||
plot \
|
||||
Ux u 1:2 t "Ux" w l lw 2 lc rgb "#009E73", \
|
||||
p u 1:2 t "p" w l lw 2 lc rgb "#F0E440", \
|
||||
nuTilda u 1:2 t "nuTilda" w l lw 2 lc rgb "#0072B2"
|
||||
}
|
||||
PLT_RES
|
||||
}
|
||||
|
||||
|
||||
plot_final_iteration_residuals() {
|
||||
|
||||
setup="$1"
|
||||
|
||||
echo " Plotting the final-iteration residuals for $setup"
|
||||
|
||||
# benchmarkFile="..."
|
||||
samples="results/$setup/logs"
|
||||
image="plots/$setup/final-iteration-residuals.png"
|
||||
|
||||
gnuplot<<PLT_RES
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
set logscale y
|
||||
set key right top
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "Iters"
|
||||
set ylabel "Final-iteration residuals"
|
||||
set offset .2, .05
|
||||
set output "$image"
|
||||
set title "Max non-orthogonality degree: $setup"
|
||||
|
||||
file_exists(file) = system("[ -f '".file."' ] && echo '1' || echo '0'") + 0
|
||||
|
||||
Ux="$samples/UxFinalRes_0"
|
||||
p="$samples/pFinalRes_0"
|
||||
k="$samples/kFinalRes_0"
|
||||
omega="$samples/omegaFinalRes_0"
|
||||
nuTilda="$samples/nuTildaFinalRes_0"
|
||||
gammaInt="$samples/gammaIntFinalRes_0"
|
||||
ReThetat="$samples/ReThetatFinalRes_0"
|
||||
|
||||
if ( file_exists(k) ) {
|
||||
if ( ! file_exists(gammaInt) ) {
|
||||
plot \
|
||||
Ux u 1:2 t "Ux" w l lw 2 lc rgb "#009E73", \
|
||||
p u 1:2 t "p" w l lw 2 lc rgb "#F0E440", \
|
||||
k u 1:2 t "k" w l lw 2 lc rgb "#0072B2", \
|
||||
omega u 1:2 t "omega" w l lw 2 lc rgb "#D55E00"
|
||||
} else {
|
||||
plot \
|
||||
Ux u 1:2 t "Ux" w l lw 2 lc rgb "#009E73", \
|
||||
p u 1:2 t "p" w l lw 2 lc rgb "#F0E440", \
|
||||
k u 1:2 t "k" w l lw 2 lc rgb "#0072B2", \
|
||||
omega u 1:2 t "omega" w l lw 2 lc rgb "#D55E00", \
|
||||
gammaInt u 1:2 t "gammaInt" w l lw 2 lc rgb "#CC79A7", \
|
||||
ReThetat u 1:2 t "ReThetat" w l lw 2 lc rgb "#440154"
|
||||
}
|
||||
} else {
|
||||
plot \
|
||||
Ux u 1:2 t "Ux" w l lw 2 lc rgb "#009E73", \
|
||||
p u 1:2 t "p" w l lw 2 lc rgb "#F0E440", \
|
||||
nuTilda u 1:2 t "nuTilda" w l lw 2 lc rgb "#0072B2"
|
||||
}
|
||||
PLT_RES
|
||||
}
|
||||
|
||||
|
||||
plot_yPlus_vs_uPlus() {
|
||||
|
||||
setup="$1"
|
||||
endTime="$2"
|
||||
nu="$3"
|
||||
uTau="$4"
|
||||
|
||||
# benchmarkFile="$FOAM_TUTORIALS/resources/dataset/planeChannelFlow/ReTau-395/chan395.means"
|
||||
sampleFile="results/$setup/postProcessing/sample/$endTime/y_U.xy"
|
||||
image="plots/$setup/yPlus_vs_uPlus.png"
|
||||
|
||||
gnuplot<<PLT_Y_VS_U
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
set xrange [0:200]
|
||||
set yrange [0:20]
|
||||
set logscale x
|
||||
set key left top reverse
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "y^+"
|
||||
set ylabel "u^+"
|
||||
set output "$image"
|
||||
set title "Setup: $setup" noenhanced
|
||||
|
||||
# Benchmark - Experimental
|
||||
# benchmark="$benchmarkFile"
|
||||
|
||||
# OpenFOAM - Numerical
|
||||
samples="$sampleFile"
|
||||
|
||||
|
||||
plot \
|
||||
samples u (\$1*$uTau/$nu):(\$2/$uTau) t "OpenFOAM" w l lw 2 lc rgb "#4169e1"
|
||||
# benchmark u 2:3 t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
PLT_Y_VS_U
|
||||
}
|
||||
|
||||
|
||||
plot_yPlus_vs_R() {
|
||||
|
||||
setup="$1"
|
||||
endTime="$2"
|
||||
nu="$3"
|
||||
uTau="$4"
|
||||
|
||||
# benchmarkFile="$FOAM_TUTORIALS/resources/dataset/planeChannelFlow/ReTau-395/chan395.reystress"
|
||||
sampleFile="results/$setup/postProcessing/sample/$endTime/y_turbulenceProperties:R.xy"
|
||||
sampleFileK="results/$setup/postProcessing/sample/$endTime/y_turbulenceProperties:k.xy"
|
||||
imageUU="plots/$setup/yPlus_vs_Ruu.png"
|
||||
imageVV="plots/$setup/yPlus_vs_Rvv.png"
|
||||
imageWW="plots/$setup/yPlus_vs_Rww.png"
|
||||
imageUV="plots/$setup/yPlus_vs_Ruv.png"
|
||||
imageK0="plots/$setup/yPlus_vs_kPlus0.png"
|
||||
imageK1="plots/$setup/yPlus_vs_kPlus1.png"
|
||||
|
||||
gnuplot<<PLT_Y_VS_R
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
#set xrange [0:200]
|
||||
#set yrange [0:1]
|
||||
set logscale x
|
||||
set key left top reverse
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "y^+"
|
||||
set ylabel "(uu)^+"
|
||||
set output "$imageUU"
|
||||
set title "Setup: $setup" noenhanced
|
||||
|
||||
# Benchmark - Experimental
|
||||
# benchmark="$benchmarkFile"
|
||||
|
||||
# OpenFOAM - Numerical
|
||||
samples="$sampleFile"
|
||||
samplesK="$sampleFileK"
|
||||
|
||||
|
||||
plot \
|
||||
samples u (\$1*$uTau/$nu):(\$2/$uTau**2) t "OpenFOAM" w l lw 2 lc rgb "#4169e1"
|
||||
# benchmark u 2:3 t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
|
||||
set output "$imageVV"
|
||||
set ylabel "(vv)^+"
|
||||
plot \
|
||||
samples u (\$1*$uTau/$nu):(\$5/$uTau**2) t "OpenFOAM" w l lw 2 lc rgb "#4169e1"
|
||||
# benchmark u 2:4 t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
|
||||
set output "$imageWW"
|
||||
set ylabel "(ww)^+"
|
||||
plot \
|
||||
samples u (\$1*$uTau/$nu):(\$7/$uTau**2) t "OpenFOAM" w l lw 2 lc rgb "#4169e1"
|
||||
# benchmark u 2:5 t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
|
||||
set output "$imageUV"
|
||||
set ylabel "(uv)^+"
|
||||
plot \
|
||||
samples u (\$1*$uTau/$nu):(-\$3/$uTau**2) t "OpenFOAM" w l lw 2 lc rgb "#4169e1"
|
||||
# benchmark u 2:(\$6*-1) t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
|
||||
set output "$imageK0"
|
||||
set ylabel "k^+"
|
||||
plot \
|
||||
samples u (\$1*$uTau/$nu):(0.5*(\$2 + \$5 + \$7)/$uTau**2) t "OpenFOAM" w l lw 2 lc rgb "#4169e1"
|
||||
# benchmark u 2:(0.5*(\$3 + \$4 + \$5)) t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
|
||||
set output "$imageK1"
|
||||
set ylabel "k^+"
|
||||
plot \
|
||||
samplesK u (\$1*$uTau/$nu):(\$2/$uTau**2) t "OpenFOAM" w l lw 2 lc rgb "#4169e1"
|
||||
# benchmark u 2:(0.5*(\$3 + \$4 + \$5)) t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
PLT_Y_VS_R
|
||||
}
|
||||
|
||||
|
||||
plot_yPlus_vs_epsilonPlus() {
|
||||
|
||||
setup="$1"
|
||||
endTime="$2"
|
||||
nu="$3"
|
||||
uTau="$4"
|
||||
|
||||
# benchmarkFile="$FOAM_TUTORIALS/resources/dataset/planeChannelFlow/ReTau-395/chan395.kbal"
|
||||
sampleFile="results/$setup/postProcessing/sampleEpsilon/$endTime/y_turbulenceProperties:epsilon.xy"
|
||||
image="plots/$setup/yPlus_vs_epsilonPlus.png"
|
||||
|
||||
gnuplot<<PLT_Y_VS_EPSILON
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
#set xrange [0:200]
|
||||
#set yrange [0:20]
|
||||
set logscale x
|
||||
set key left top reverse
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "y^+"
|
||||
set ylabel "{/Symbol e}^+"
|
||||
set output "$image"
|
||||
set title "Setup: $setup" noenhanced
|
||||
|
||||
# Benchmark - Experimental
|
||||
# benchmark="$benchmarkFile"
|
||||
|
||||
# OpenFOAM - Numerical
|
||||
samples="$sampleFile"
|
||||
|
||||
plot \
|
||||
samples u (\$1*$uTau/$nu):(\$2*$nu/$uTau**4) t "OpenFOAM" w l lw 2 lc rgb "#4169e1"
|
||||
# benchmark u 2:(-\$3) t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
PLT_Y_VS_EPSILON
|
||||
}
|
||||
|
||||
|
||||
plot_yPlus_vs_productionRatePlus() {
|
||||
|
||||
setup="$1"
|
||||
endTime="$2"
|
||||
nu="$3"
|
||||
uTau="$4"
|
||||
|
||||
# benchmarkFile="$FOAM_TUTORIALS/resources/dataset/planeChannelFlow/ReTau-395/chan395.kbal"
|
||||
sampleFile="results/$setup/postProcessing/sampleG/$endTime/y_productionRate.xy"
|
||||
image="plots/$setup/yPlus_vs_productionRatePlus.png"
|
||||
|
||||
gnuplot<<PLT_Y_VS_PRODUCTION_RATE
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
#set xrange [0:200]
|
||||
#set yrange [0:20]
|
||||
set logscale x
|
||||
set key left top reverse
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "y^+"
|
||||
set ylabel "P^+"
|
||||
set output "$image"
|
||||
set title "Setup: $setup" noenhanced
|
||||
|
||||
# Benchmark - Experimental
|
||||
# benchmark="$benchmarkFile"
|
||||
|
||||
# OpenFOAM - Numerical
|
||||
samples="$sampleFile"
|
||||
|
||||
plot \
|
||||
samples u (\$1*$uTau/$nu):(\$2*$nu/$uTau**4) t "OpenFOAM" w l lw 2 lc rgb "#4169e1"
|
||||
# benchmark u 2:4 t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
PLT_Y_VS_PRODUCTION_RATE
|
||||
}
|
||||
|
||||
|
||||
plot_yPlus_vs_uPlus_all_setups() {
|
||||
|
||||
setups=$@
|
||||
|
||||
# benchmarkFile="$FOAM_TUTORIALS/resources/dataset/planeChannelFlow/ReTau-395/chan395.means"
|
||||
|
||||
n=0
|
||||
for setup in $setups
|
||||
do
|
||||
# few manipulations
|
||||
endTime=$(foamDictionary results/$setup/system/controlDict -entry endTime -value)
|
||||
nu=$(foamDictionary results/$setup/constant/transportProperties -entry nu | sed 's|^.*\s\(.*\);|\1|g')
|
||||
tau=$(foamDictionary results/$setup/$endTime/wallShearStress1:wallShearStress -entry boundaryField.bottom.value -value | sed -n '/(/,/)/p' | sed -e 's/[()]//g;/^\s*$/d' | cut -d' ' -f6)
|
||||
uTau=$(awk -v tau="$tau" 'BEGIN { printf "%.16f", sqrt(-1*tau) }')
|
||||
|
||||
sampleFiles[$n]="results/$setup/postProcessing/sample/$endTime/y_U.xy"
|
||||
nus[$n]="$nu"
|
||||
uTaus[$n]="$uTau"
|
||||
n=$(($n+1))
|
||||
done
|
||||
|
||||
image="plots/all_setups_yPlus_vs_uPlus.png"
|
||||
|
||||
gnuplot<<PLT_Y_VS_U_ALL_SETUPS
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
set xrange [0:200]
|
||||
set yrange [0:20]
|
||||
set logscale x
|
||||
set key left top reverse
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "y^+"
|
||||
set ylabel "u^+"
|
||||
set output "$image"
|
||||
set title "Ground-normal profile" noenhanced
|
||||
|
||||
# Benchmark - Experimental
|
||||
# benchmark="$benchmarkFile"
|
||||
|
||||
# OpenFOAM - Numerical
|
||||
models="${setups[*]}"
|
||||
samples="${sampleFiles[*]}"
|
||||
nus="${nus[*]}"
|
||||
uTaus="${uTaus[*]}"
|
||||
|
||||
plot \
|
||||
for [i=1:words(samples)] word(samples, i) \
|
||||
u (\$1*word(uTaus, i)/word(nus, i)):(\$2/word(uTaus, i)) \
|
||||
t word(models, i) w l lw 2
|
||||
# benchmark u 2:3 t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
PLT_Y_VS_U_ALL_SETUPS
|
||||
}
|
||||
|
||||
|
||||
plot_yPlus_vs_R_all_setups() {
|
||||
|
||||
setups=$@
|
||||
|
||||
# benchmarkFile="$FOAM_TUTORIALS/resources/dataset/planeChannelFlow/ReTau-395/chan395.reystress"
|
||||
|
||||
n=0
|
||||
for setup in $setups
|
||||
do
|
||||
# few manipulations
|
||||
endTime=$(foamDictionary results/$setup/system/controlDict -entry endTime -value)
|
||||
nu=$(foamDictionary results/$setup/constant/transportProperties -entry nu | sed 's|^.*\s\(.*\);|\1|g')
|
||||
tau=$(foamDictionary results/$setup/$endTime/wallShearStress1:wallShearStress -entry boundaryField.bottom.value -value | sed -n '/(/,/)/p' | sed -e 's/[()]//g;/^\s*$/d' | cut -d' ' -f6)
|
||||
uTau=$(awk -v tau="$tau" 'BEGIN { printf "%.16f", sqrt(-1*tau) }')
|
||||
|
||||
sampleFiles[$n]="results/$setup/postProcessing/sample/$endTime/y_turbulenceProperties:R.xy"
|
||||
sampleFilesK[$n]="results/$setup/postProcessing/sample/$endTime/y_turbulenceProperties:k.xy"
|
||||
nus[$n]="$nu"
|
||||
uTaus[$n]="$uTau"
|
||||
n=$(($n+1))
|
||||
done
|
||||
|
||||
imageUU="plots/all_setups_yPlus_vs_Ruu.png"
|
||||
imageVV="plots/all_setups_yPlus_vs_Rvv.png"
|
||||
imageWW="plots/all_setups_yPlus_vs_Rww.png"
|
||||
imageUV="plots/all_setups_yPlus_vs_Ruv.png"
|
||||
imageK0="plots/all_setups_yPlus_vs_kPlus0.png"
|
||||
imageK1="plots/all_setups_yPlus_vs_kPlus1.png"
|
||||
|
||||
gnuplot<<PLT_Y_VS_R
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
#set xrange [0:200]
|
||||
#set yrange [0:1]
|
||||
set logscale x
|
||||
set key left top reverse
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "y^+"
|
||||
set ylabel "(uu)^+"
|
||||
set output "$imageUU"
|
||||
set title "Ground-normal profile" noenhanced
|
||||
|
||||
# Benchmark - Experimental
|
||||
# benchmark="$benchmarkFile"
|
||||
|
||||
# OpenFOAM - Numerical
|
||||
models="${setups[*]}"
|
||||
samples="${sampleFiles[*]}"
|
||||
samplesK="${sampleFilesK[*]}"
|
||||
nus="${nus[*]}"
|
||||
uTaus="${uTaus[*]}"
|
||||
|
||||
plot \
|
||||
for [i=1:words(samples)] word(samples, i) \
|
||||
u (\$1*word(uTaus, i)/word(nus, i)):(\$2/word(uTaus, i)**2) \
|
||||
t word(models, i) w l lw 2
|
||||
# benchmark u 2:3 t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
|
||||
set output "$imageVV"
|
||||
set ylabel "(vv)^+"
|
||||
plot \
|
||||
for [i=1:words(samples)] word(samples, i) \
|
||||
u (\$1*word(uTaus, i)/word(nus, i)):(\$5/word(uTaus, i)**2) \
|
||||
t word(models, i) w l lw 2
|
||||
# benchmark u 2:4 t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
|
||||
set output "$imageWW"
|
||||
set ylabel "(ww)^+"
|
||||
plot \
|
||||
for [i=1:words(samples)] word(samples, i) \
|
||||
u (\$1*word(uTaus, i)/word(nus, i)):(\$7/word(uTaus, i)**2) \
|
||||
t word(models, i) w l lw 2
|
||||
# benchmark u 2:5 t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
|
||||
set output "$imageUV"
|
||||
set ylabel "(uv)^+"
|
||||
plot \
|
||||
for [i=1:words(samples)] word(samples, i) \
|
||||
u (\$1*word(uTaus, i)/word(nus, i)):(-\$3/word(uTaus, i)**2) \
|
||||
t word(models, i) w l lw 2
|
||||
# benchmark u 2:(\$6*-1) t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
|
||||
set output "$imageK0"
|
||||
set ylabel "k^+"
|
||||
plot \
|
||||
for [i=1:words(samples)] word(samples, i) \
|
||||
u (\$1*word(uTaus, i)/word(nus, i)):(0.5*(\$2 + \$5 + \$7)/word(uTaus, i)**2) \
|
||||
t word(models, i) w l lw 2
|
||||
# benchmark u 2:(0.5*(\$3 + \$4 + \$5)) t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
|
||||
set output "$imageK1"
|
||||
set ylabel "k^+"
|
||||
plot \
|
||||
for [i=1:words(samplesK)] word(samplesK, i) \
|
||||
u (\$1*word(uTaus, i)/word(nus, i)):(\$2/word(uTaus, i)**2) \
|
||||
t word(models, i) w l lw 2
|
||||
# benchmark u 2:(0.5*(\$3 + \$4 + \$5)) t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
PLT_Y_VS_R
|
||||
}
|
||||
|
||||
|
||||
plot_yPlus_vs_epsilonPlus_all_setups() {
|
||||
|
||||
setups=$@
|
||||
|
||||
# benchmarkFile="$FOAM_TUTORIALS/resources/dataset/planeChannelFlow/ReTau-395/chan395.kbal"
|
||||
|
||||
n=0
|
||||
for setup in $setups
|
||||
do
|
||||
# few manipulations
|
||||
endTime=$(foamDictionary results/$setup/system/controlDict -entry endTime -value)
|
||||
nu=$(foamDictionary results/$setup/constant/transportProperties -entry nu | sed 's|^.*\s\(.*\);|\1|g')
|
||||
tau=$(foamDictionary results/$setup/$endTime/wallShearStress1:wallShearStress -entry boundaryField.bottom.value -value | sed -n '/(/,/)/p' | sed -e 's/[()]//g;/^\s*$/d' | cut -d' ' -f6)
|
||||
uTau=$(awk -v tau="$tau" 'BEGIN { printf "%.16f", sqrt(-1*tau) }')
|
||||
|
||||
sampleFiles[$n]="results/$setup/postProcessing/sampleEpsilon/$endTime/y_turbulenceProperties:epsilon.xy"
|
||||
nus[$n]="$nu"
|
||||
uTaus[$n]="$uTau"
|
||||
n=$(($n+1))
|
||||
done
|
||||
|
||||
image="plots/all_setups_yPlus_vs_epsilonPlus.png"
|
||||
|
||||
gnuplot<<PLT_Y_VS_EPSILON_ALL_SETUPS
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
#set xrange [0:200]
|
||||
#set yrange [0:20]
|
||||
set logscale x
|
||||
set key left top reverse
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "y^+"
|
||||
set ylabel "{/Symbol e}^+"
|
||||
set output "$image"
|
||||
set title "Setup: $setup" noenhanced
|
||||
|
||||
# Benchmark - Experimental
|
||||
# benchmark="$benchmarkFile"
|
||||
|
||||
# OpenFOAM - Numerical
|
||||
models="${setups[*]}"
|
||||
samples="${sampleFiles[*]}"
|
||||
nus="${nus[*]}"
|
||||
uTaus="${uTaus[*]}"
|
||||
|
||||
plot \
|
||||
for [i=1:words(samples)] word(samples, i) \
|
||||
u (\$1*word(uTaus, i)/word(nus, i)):(\$2*word(nus, i)/word(uTaus, i)**4) \
|
||||
t word(models, i) w l lw 2
|
||||
# benchmark u 2:(-\$3) t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
PLT_Y_VS_EPSILON_ALL_SETUPS
|
||||
}
|
||||
|
||||
|
||||
plot_yPlus_vs_productionRatePlus_all_setups() {
|
||||
|
||||
setups=$@
|
||||
|
||||
# benchmarkFile="$FOAM_TUTORIALS/resources/dataset/planeChannelFlow/ReTau-395/chan395.kbal"
|
||||
|
||||
n=0
|
||||
for setup in $setups
|
||||
do
|
||||
# few manipulations
|
||||
endTime=$(foamDictionary results/$setup/system/controlDict -entry endTime -value)
|
||||
nu=$(foamDictionary results/$setup/constant/transportProperties -entry nu | sed 's|^.*\s\(.*\);|\1|g')
|
||||
tau=$(foamDictionary results/$setup/$endTime/wallShearStress1:wallShearStress -entry boundaryField.bottom.value -value | sed -n '/(/,/)/p' | sed -e 's/[()]//g;/^\s*$/d' | cut -d' ' -f6)
|
||||
uTau=$(awk -v tau="$tau" 'BEGIN { printf "%.16f", sqrt(-1*tau) }')
|
||||
|
||||
sampleFiles[$n]="results/$setup/postProcessing/sampleG/$endTime/y_productionRate.xy"
|
||||
nus[$n]="$nu"
|
||||
uTaus[$n]="$uTau"
|
||||
n=$(($n+1))
|
||||
done
|
||||
|
||||
image="plots/all_setups_yPlus_vs_productionRatePlus.png"
|
||||
|
||||
gnuplot<<PLT_Y_VS_PRODUCTION_RATE_ALL_SETUPS
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
#set xrange [0:200]
|
||||
#set yrange [0:20]
|
||||
set logscale x
|
||||
set key left top reverse
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "y^+"
|
||||
set ylabel "P^+"
|
||||
set output "$image"
|
||||
set title "Ground-normal profile" noenhanced
|
||||
|
||||
# Benchmark - Experimental
|
||||
# benchmark="$benchmarkFile"
|
||||
|
||||
# OpenFOAM - Numerical
|
||||
models="${setups[*]}"
|
||||
samples="${sampleFiles[*]}"
|
||||
nus="${nus[*]}"
|
||||
uTaus="${uTaus[*]}"
|
||||
|
||||
plot \
|
||||
for [i=1:words(samples)] word(samples, i) \
|
||||
u (\$1*word(uTaus, i)/word(nus, i)):(\$2*word(nus, i)/word(uTaus, i)**4) \
|
||||
t word(models, i) w l lw 2
|
||||
# benchmark u 2:4 t "DNS" w p ps 2 pt 7 lc rgb "#ffc020"
|
||||
PLT_Y_VS_PRODUCTION_RATE_ALL_SETUPS
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Requires gnuplot
|
||||
command -v gnuplot >/dev/null || {
|
||||
echo "gnuplot not found - skipping graph creation" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Requires awk
|
||||
command -v awk >/dev/null || {
|
||||
echo "awk not found - skipping graph creation" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check "results" directory
|
||||
[ -d "results" ] || {
|
||||
echo "No results directory found - skipping graph creation" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
for setup in $setups
|
||||
do
|
||||
|
||||
echo ""
|
||||
echo "# Plots for the setup: $setup"
|
||||
echo ""
|
||||
|
||||
dirPlots="plots/$setup"
|
||||
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
|
||||
|
||||
# few manipulations
|
||||
endTime=$(foamDictionary results/$setup/system/controlDict -entry endTime -value)
|
||||
nu=$(foamDictionary results/$setup/constant/transportProperties -entry nu | sed 's|^.*\s\(.*\);|\1|g')
|
||||
tau=$(foamDictionary results/$setup/$endTime/wallShearStress1:wallShearStress -entry boundaryField.bottom.value -value | sed -n '/(/,/)/p' | sed -e 's/[()]//g;/^\s*$/d' | cut -d' ' -f6)
|
||||
uTau=$(awk -v tau="$tau" 'BEGIN { printf "%.16f", sqrt(-1*tau) }')
|
||||
|
||||
plot_yPlus_vs_uPlus "$setup" "$endTime" "$nu" "$uTau"
|
||||
|
||||
plot_yPlus_vs_R "$setup" "$endTime" "$nu" "$uTau"
|
||||
|
||||
plot_yPlus_vs_epsilonPlus "$setup" "$endTime" "$nu" "$uTau"
|
||||
|
||||
plot_yPlus_vs_productionRatePlus "$setup" "$endTime" "$nu" "$uTau"
|
||||
|
||||
plot_initial_iteration_residuals "$setup"
|
||||
|
||||
plot_final_iteration_residuals "$setup"
|
||||
|
||||
done
|
||||
|
||||
plot_yPlus_vs_uPlus_all_setups $setups
|
||||
|
||||
plot_yPlus_vs_R_all_setups $setups
|
||||
|
||||
plot_yPlus_vs_epsilonPlus_all_setups $setups
|
||||
|
||||
plot_yPlus_vs_productionRatePlus_all_setups $setups
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -0,0 +1 @@
|
||||
../common/0.orig
|
||||
@ -0,0 +1 @@
|
||||
../common/constant
|
||||
@ -0,0 +1,100 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
scale 1;
|
||||
|
||||
alpha 0;
|
||||
nx 5;
|
||||
ny 100;
|
||||
nz 1;
|
||||
xMin 0;
|
||||
xMax 1;
|
||||
yMin 0;
|
||||
yMax 1;
|
||||
zMin 0;
|
||||
zMax 1;
|
||||
yExpansion 9.987905978;
|
||||
|
||||
sin0 #eval{sin(degToRad($alpha))};
|
||||
cos0 #eval{cos(degToRad($alpha))};
|
||||
xMindx #eval{$xMin + $sin0};
|
||||
xMaxdx #eval{$xMax + $sin0};
|
||||
yMaxdy #eval{$yMax*$cos0};
|
||||
|
||||
vertices
|
||||
(
|
||||
($xMin $yMin $zMin)
|
||||
($xMax $yMin $zMin)
|
||||
($xMaxdx $yMaxdy $zMin)
|
||||
($xMindx $yMaxdy $zMin)
|
||||
($xMin $yMin $zMax)
|
||||
($xMax $yMin $zMax)
|
||||
($xMaxdx $yMaxdy $zMax)
|
||||
($xMindx $yMaxdy $zMax)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) ($nx $ny $nz) simpleGrading (1 $yExpansion 1)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(2 6 5 1)
|
||||
);
|
||||
}
|
||||
top
|
||||
{
|
||||
type symmetry;
|
||||
faces
|
||||
(
|
||||
(3 7 6 2)
|
||||
);
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(1 5 4 0)
|
||||
);
|
||||
}
|
||||
leftAndRight
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 3 2 1)
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/controlDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/decomposeParDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSchemes
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSolution
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sample
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleEpsilon
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleG
|
||||
@ -0,0 +1 @@
|
||||
../common/0.orig
|
||||
@ -0,0 +1 @@
|
||||
../common/constant
|
||||
@ -0,0 +1,100 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
scale 1;
|
||||
|
||||
alpha 10;
|
||||
nx 5;
|
||||
ny 100;
|
||||
nz 1;
|
||||
xMin 0;
|
||||
xMax 1;
|
||||
yMin 0;
|
||||
yMax 1;
|
||||
zMin 0;
|
||||
zMax 1;
|
||||
yExpansion 9.987905978;
|
||||
|
||||
sin0 #eval{sin(degToRad($alpha))};
|
||||
cos0 #eval{cos(degToRad($alpha))};
|
||||
xMindx #eval{$xMin + $sin0};
|
||||
xMaxdx #eval{$xMax + $sin0};
|
||||
yMaxdy #eval{$yMax*$cos0};
|
||||
|
||||
vertices
|
||||
(
|
||||
($xMin $yMin $zMin)
|
||||
($xMax $yMin $zMin)
|
||||
($xMaxdx $yMaxdy $zMin)
|
||||
($xMindx $yMaxdy $zMin)
|
||||
($xMin $yMin $zMax)
|
||||
($xMax $yMin $zMax)
|
||||
($xMaxdx $yMaxdy $zMax)
|
||||
($xMindx $yMaxdy $zMax)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) ($nx $ny $nz) simpleGrading (1 $yExpansion 1)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(2 6 5 1)
|
||||
);
|
||||
}
|
||||
top
|
||||
{
|
||||
type symmetry;
|
||||
faces
|
||||
(
|
||||
(3 7 6 2)
|
||||
);
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(1 5 4 0)
|
||||
);
|
||||
}
|
||||
leftAndRight
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 3 2 1)
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/controlDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/decomposeParDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSchemes
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSolution
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sample
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleEpsilon
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleG
|
||||
@ -0,0 +1 @@
|
||||
../common/0.orig
|
||||
@ -0,0 +1 @@
|
||||
../common/constant
|
||||
@ -0,0 +1,100 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
scale 1;
|
||||
|
||||
alpha 20;
|
||||
nx 5;
|
||||
ny 100;
|
||||
nz 1;
|
||||
xMin 0;
|
||||
xMax 1;
|
||||
yMin 0;
|
||||
yMax 1;
|
||||
zMin 0;
|
||||
zMax 1;
|
||||
yExpansion 9.987905978;
|
||||
|
||||
sin0 #eval{sin(degToRad($alpha))};
|
||||
cos0 #eval{cos(degToRad($alpha))};
|
||||
xMindx #eval{$xMin + $sin0};
|
||||
xMaxdx #eval{$xMax + $sin0};
|
||||
yMaxdy #eval{$yMax*$cos0};
|
||||
|
||||
vertices
|
||||
(
|
||||
($xMin $yMin $zMin)
|
||||
($xMax $yMin $zMin)
|
||||
($xMaxdx $yMaxdy $zMin)
|
||||
($xMindx $yMaxdy $zMin)
|
||||
($xMin $yMin $zMax)
|
||||
($xMax $yMin $zMax)
|
||||
($xMaxdx $yMaxdy $zMax)
|
||||
($xMindx $yMaxdy $zMax)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) ($nx $ny $nz) simpleGrading (1 $yExpansion 1)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(2 6 5 1)
|
||||
);
|
||||
}
|
||||
top
|
||||
{
|
||||
type symmetry;
|
||||
faces
|
||||
(
|
||||
(3 7 6 2)
|
||||
);
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(1 5 4 0)
|
||||
);
|
||||
}
|
||||
leftAndRight
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 3 2 1)
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/controlDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/decomposeParDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSchemes
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSolution
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sample
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleEpsilon
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleG
|
||||
@ -0,0 +1 @@
|
||||
../common/0.orig
|
||||
@ -0,0 +1 @@
|
||||
../common/constant
|
||||
@ -0,0 +1,100 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
scale 1;
|
||||
|
||||
alpha 30;
|
||||
nx 5;
|
||||
ny 100;
|
||||
nz 1;
|
||||
xMin 0;
|
||||
xMax 1;
|
||||
yMin 0;
|
||||
yMax 1;
|
||||
zMin 0;
|
||||
zMax 1;
|
||||
yExpansion 9.987905978;
|
||||
|
||||
sin0 #eval{sin(degToRad($alpha))};
|
||||
cos0 #eval{cos(degToRad($alpha))};
|
||||
xMindx #eval{$xMin + $sin0};
|
||||
xMaxdx #eval{$xMax + $sin0};
|
||||
yMaxdy #eval{$yMax*$cos0};
|
||||
|
||||
vertices
|
||||
(
|
||||
($xMin $yMin $zMin)
|
||||
($xMax $yMin $zMin)
|
||||
($xMaxdx $yMaxdy $zMin)
|
||||
($xMindx $yMaxdy $zMin)
|
||||
($xMin $yMin $zMax)
|
||||
($xMax $yMin $zMax)
|
||||
($xMaxdx $yMaxdy $zMax)
|
||||
($xMindx $yMaxdy $zMax)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) ($nx $ny $nz) simpleGrading (1 $yExpansion 1)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(2 6 5 1)
|
||||
);
|
||||
}
|
||||
top
|
||||
{
|
||||
type symmetry;
|
||||
faces
|
||||
(
|
||||
(3 7 6 2)
|
||||
);
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(1 5 4 0)
|
||||
);
|
||||
}
|
||||
leftAndRight
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 3 2 1)
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/controlDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/decomposeParDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSchemes
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSolution
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sample
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleEpsilon
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleG
|
||||
@ -0,0 +1 @@
|
||||
../common/0.orig
|
||||
@ -0,0 +1 @@
|
||||
../common/constant
|
||||
@ -0,0 +1,100 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
scale 1;
|
||||
|
||||
alpha 40;
|
||||
nx 5;
|
||||
ny 100;
|
||||
nz 1;
|
||||
xMin 0;
|
||||
xMax 1;
|
||||
yMin 0;
|
||||
yMax 1;
|
||||
zMin 0;
|
||||
zMax 1;
|
||||
yExpansion 9.987905978;
|
||||
|
||||
sin0 #eval{sin(degToRad($alpha))};
|
||||
cos0 #eval{cos(degToRad($alpha))};
|
||||
xMindx #eval{$xMin + $sin0};
|
||||
xMaxdx #eval{$xMax + $sin0};
|
||||
yMaxdy #eval{$yMax*$cos0};
|
||||
|
||||
vertices
|
||||
(
|
||||
($xMin $yMin $zMin)
|
||||
($xMax $yMin $zMin)
|
||||
($xMaxdx $yMaxdy $zMin)
|
||||
($xMindx $yMaxdy $zMin)
|
||||
($xMin $yMin $zMax)
|
||||
($xMax $yMin $zMax)
|
||||
($xMaxdx $yMaxdy $zMax)
|
||||
($xMindx $yMaxdy $zMax)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) ($nx $ny $nz) simpleGrading (1 $yExpansion 1)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(2 6 5 1)
|
||||
);
|
||||
}
|
||||
top
|
||||
{
|
||||
type symmetry;
|
||||
faces
|
||||
(
|
||||
(3 7 6 2)
|
||||
);
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(1 5 4 0)
|
||||
);
|
||||
}
|
||||
leftAndRight
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 3 2 1)
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/controlDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/decomposeParDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSchemes
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSolution
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sample
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleEpsilon
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleG
|
||||
@ -0,0 +1 @@
|
||||
../common/0.orig
|
||||
@ -0,0 +1 @@
|
||||
../common/constant
|
||||
@ -0,0 +1,100 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
scale 1;
|
||||
|
||||
alpha 50;
|
||||
nx 5;
|
||||
ny 100;
|
||||
nz 1;
|
||||
xMin 0;
|
||||
xMax 1;
|
||||
yMin 0;
|
||||
yMax 1;
|
||||
zMin 0;
|
||||
zMax 1;
|
||||
yExpansion 9.987905978;
|
||||
|
||||
sin0 #eval{sin(degToRad($alpha))};
|
||||
cos0 #eval{cos(degToRad($alpha))};
|
||||
xMindx #eval{$xMin + $sin0};
|
||||
xMaxdx #eval{$xMax + $sin0};
|
||||
yMaxdy #eval{$yMax*$cos0};
|
||||
|
||||
vertices
|
||||
(
|
||||
($xMin $yMin $zMin)
|
||||
($xMax $yMin $zMin)
|
||||
($xMaxdx $yMaxdy $zMin)
|
||||
($xMindx $yMaxdy $zMin)
|
||||
($xMin $yMin $zMax)
|
||||
($xMax $yMin $zMax)
|
||||
($xMaxdx $yMaxdy $zMax)
|
||||
($xMindx $yMaxdy $zMax)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) ($nx $ny $nz) simpleGrading (1 $yExpansion 1)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(2 6 5 1)
|
||||
);
|
||||
}
|
||||
top
|
||||
{
|
||||
type symmetry;
|
||||
faces
|
||||
(
|
||||
(3 7 6 2)
|
||||
);
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(1 5 4 0)
|
||||
);
|
||||
}
|
||||
leftAndRight
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 3 2 1)
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/controlDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/decomposeParDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSchemes
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSolution
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sample
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleEpsilon
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleG
|
||||
@ -0,0 +1 @@
|
||||
../common/0.orig
|
||||
@ -0,0 +1 @@
|
||||
../common/constant
|
||||
@ -0,0 +1,100 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
scale 1;
|
||||
|
||||
alpha 60;
|
||||
nx 5;
|
||||
ny 100;
|
||||
nz 1;
|
||||
xMin 0;
|
||||
xMax 1;
|
||||
yMin 0;
|
||||
yMax 1;
|
||||
zMin 0;
|
||||
zMax 1;
|
||||
yExpansion 9.987905978;
|
||||
|
||||
sin0 #eval{sin(degToRad($alpha))};
|
||||
cos0 #eval{cos(degToRad($alpha))};
|
||||
xMindx #eval{$xMin + $sin0};
|
||||
xMaxdx #eval{$xMax + $sin0};
|
||||
yMaxdy #eval{$yMax*$cos0};
|
||||
|
||||
vertices
|
||||
(
|
||||
($xMin $yMin $zMin)
|
||||
($xMax $yMin $zMin)
|
||||
($xMaxdx $yMaxdy $zMin)
|
||||
($xMindx $yMaxdy $zMin)
|
||||
($xMin $yMin $zMax)
|
||||
($xMax $yMin $zMax)
|
||||
($xMaxdx $yMaxdy $zMax)
|
||||
($xMindx $yMaxdy $zMax)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) ($nx $ny $nz) simpleGrading (1 $yExpansion 1)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(2 6 5 1)
|
||||
);
|
||||
}
|
||||
top
|
||||
{
|
||||
type symmetry;
|
||||
faces
|
||||
(
|
||||
(3 7 6 2)
|
||||
);
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(1 5 4 0)
|
||||
);
|
||||
}
|
||||
leftAndRight
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 3 2 1)
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/controlDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/decomposeParDict
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSchemes
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/fvSolution
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sample
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleEpsilon
|
||||
@ -0,0 +1 @@
|
||||
../../common/system/sampleG
|
||||
@ -0,0 +1 @@
|
||||
../common/0.orig
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user