mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -7,6 +7,11 @@ if (pimple.nCorr() <= 1)
|
|||||||
|
|
||||||
phi = (fvc::interpolate(U) & mesh.Sf());
|
phi = (fvc::interpolate(U) & mesh.Sf());
|
||||||
|
|
||||||
|
if (ddtPhiCorr)
|
||||||
|
{
|
||||||
|
phi += fvc::ddtPhiCorr(rAU, U, phi);
|
||||||
|
}
|
||||||
|
|
||||||
if (p.needReference())
|
if (p.needReference())
|
||||||
{
|
{
|
||||||
fvc::makeRelative(phi, U);
|
fvc::makeRelative(phi, U);
|
||||||
|
|||||||
@ -8,3 +8,5 @@
|
|||||||
const bool checkMeshCourantNo =
|
const bool checkMeshCourantNo =
|
||||||
pimpleDict.lookupOrDefault("checkMeshCourantNo", false);
|
pimpleDict.lookupOrDefault("checkMeshCourantNo", false);
|
||||||
|
|
||||||
|
const bool ddtPhiCorr =
|
||||||
|
pimpleDict.lookupOrDefault("ddtPhiCorr", true);
|
||||||
|
|||||||
@ -58,6 +58,9 @@ int main(int argc, char *argv[])
|
|||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setInitialDeltaT.H"
|
#include "setInitialDeltaT.H"
|
||||||
|
|
||||||
|
surfaceScalarField phiAbs("phiAbs", phi);
|
||||||
|
fvc::makeAbsolute(phiAbs, U);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
@ -67,9 +70,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "alphaCourantNo.H"
|
#include "alphaCourantNo.H"
|
||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
|
|
||||||
// Make the fluxes absolute
|
|
||||||
fvc::makeAbsolute(phi, U);
|
|
||||||
|
|
||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
@ -78,8 +78,18 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||||
|
|
||||||
// Do any mesh changes
|
{
|
||||||
mesh.update();
|
// Calculate the relative velocity used to map the relative flux phi
|
||||||
|
volVectorField Urel("Urel", U);
|
||||||
|
|
||||||
|
if (mesh.moving())
|
||||||
|
{
|
||||||
|
Urel -= fvc::reconstruct(fvc::meshPhi(U));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do any mesh changes
|
||||||
|
mesh.update();
|
||||||
|
}
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
@ -96,9 +106,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "correctPhi.H"
|
#include "correctPhi.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
|
||||||
fvc::makeRelative(phi, U);
|
|
||||||
|
|
||||||
if (mesh.changing() && checkMeshCourantNo)
|
if (mesh.changing() && checkMeshCourantNo)
|
||||||
{
|
{
|
||||||
#include "meshCourantNo.H"
|
#include "meshCourantNo.H"
|
||||||
|
|||||||
@ -3,16 +3,19 @@
|
|||||||
surfaceScalarField rAUf(fvc::interpolate(rAU));
|
surfaceScalarField rAUf(fvc::interpolate(rAU));
|
||||||
|
|
||||||
U = rAU*UEqn.H();
|
U = rAU*UEqn.H();
|
||||||
surfaceScalarField phiU("phiU", (fvc::interpolate(U) & mesh.Sf()));
|
|
||||||
|
phiAbs =
|
||||||
|
(fvc::interpolate(U) & mesh.Sf())
|
||||||
|
+ fvc::ddtPhiCorr(rAU, rho, U, phiAbs);
|
||||||
|
|
||||||
if (p_rgh.needReference())
|
if (p_rgh.needReference())
|
||||||
{
|
{
|
||||||
fvc::makeRelative(phiU, U);
|
fvc::makeRelative(phiAbs, U);
|
||||||
adjustPhi(phiU, U, p_rgh);
|
adjustPhi(phiAbs, U, p_rgh);
|
||||||
fvc::makeAbsolute(phiU, U);
|
fvc::makeAbsolute(phiAbs, U);
|
||||||
}
|
}
|
||||||
|
|
||||||
phi = phiU +
|
phi = phiAbs +
|
||||||
(
|
(
|
||||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||||
- ghf*fvc::snGrad(rho)
|
- ghf*fvc::snGrad(rho)
|
||||||
@ -38,11 +41,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
|
U += rAU*fvc::reconstruct((phi - phiAbs)/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
#include "continuityErrs.H"
|
||||||
|
|
||||||
|
phiAbs = phi;
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
// Make the fluxes relative to the mesh motion
|
||||||
fvc::makeRelative(phi, U);
|
fvc::makeRelative(phi, U);
|
||||||
|
|
||||||
|
|||||||
@ -936,12 +936,6 @@ int main(int argc, char *argv[])
|
|||||||
const word dictName
|
const word dictName
|
||||||
(args.optionLookupOrDefault<word>("dict", "extrudeToRegionMeshDict"));
|
(args.optionLookupOrDefault<word>("dict", "extrudeToRegionMeshDict"));
|
||||||
|
|
||||||
mappedPatchBase::sampleMode sampleMode = mappedPatchBase::NEARESTPATCHFACE;
|
|
||||||
if (args.optionFound("AMI"))
|
|
||||||
{
|
|
||||||
sampleMode = mappedPatchBase::NEARESTPATCHFACEAMI;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOdictionary dict
|
IOdictionary dict
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -966,6 +960,9 @@ int main(int argc, char *argv[])
|
|||||||
dict.lookup("faceZonesShadow") >> zoneShadowNames;
|
dict.lookup("faceZonesShadow") >> zoneShadowNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mappedPatchBase::sampleMode sampleMode =
|
||||||
|
mappedPatchBase::sampleModeNames_[dict.lookup("sampleMode")];
|
||||||
|
|
||||||
const Switch oneD(dict.lookup("oneD"));
|
const Switch oneD(dict.lookup("oneD"));
|
||||||
const Switch adaptMesh(dict.lookup("adaptMesh"));
|
const Switch adaptMesh(dict.lookup("adaptMesh"));
|
||||||
|
|
||||||
|
|||||||
@ -15,10 +15,10 @@ FoamFile
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Name of region to create
|
// Name of region to create
|
||||||
region liquidFilm;
|
region liquidFilm;
|
||||||
|
|
||||||
// FaceZones to extrude
|
// FaceZones to extrude
|
||||||
faceZones (f0);
|
faceZones (f0);
|
||||||
|
|
||||||
// FaceZone shadow
|
// FaceZone shadow
|
||||||
//faceZonesShadow (fBaffleShadow);
|
//faceZonesShadow (fBaffleShadow);
|
||||||
@ -30,10 +30,13 @@ faceZones (f0);
|
|||||||
// - extruding boundary faces: repatched to be on mapped patches
|
// - extruding boundary faces: repatched to be on mapped patches
|
||||||
// If false: leave original mesh intact. Extruded mesh will still have
|
// If false: leave original mesh intact. Extruded mesh will still have
|
||||||
// mapped patch which might need to be adapted.
|
// mapped patch which might need to be adapted.
|
||||||
adaptMesh true;
|
adaptMesh true;
|
||||||
|
|
||||||
|
// Sample mode for inter-region communication
|
||||||
|
sampleMode nearestPatchFace;
|
||||||
|
|
||||||
// Extrude 1D-columns of cells?
|
// Extrude 1D-columns of cells?
|
||||||
oneD false;
|
oneD false;
|
||||||
|
|
||||||
// If oneD is true. Specify which boundary is wanted between the layers
|
// If oneD is true. Specify which boundary is wanted between the layers
|
||||||
//oneDPolyPatchType emptyPolyPatch; //wedgePolyPatch
|
//oneDPolyPatchType emptyPolyPatch; //wedgePolyPatch
|
||||||
@ -42,23 +45,23 @@ oneD false;
|
|||||||
//- Extrusion model to use. The only logical choice is linearNormal?
|
//- Extrusion model to use. The only logical choice is linearNormal?
|
||||||
|
|
||||||
//- Linear extrusion in normal direction
|
//- Linear extrusion in normal direction
|
||||||
extrudeModel linearNormal;
|
extrudeModel linearNormal;
|
||||||
|
|
||||||
//- Linear extrusion in specified direction
|
//- Linear extrusion in specified direction
|
||||||
//extrudeModel linearDirection;
|
// extrudeModel linearDirection;
|
||||||
|
|
||||||
//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane.
|
//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane.
|
||||||
// extrudeModel wedge;
|
// extrudeModel wedge;
|
||||||
|
|
||||||
//- Extrudes into sphere around (0 0 0)
|
//- Extrudes into sphere around (0 0 0)
|
||||||
//extrudeModel linearRadial;
|
// extrudeModel linearRadial;
|
||||||
|
|
||||||
//- Extrudes into sphere with grading according to pressure (atmospherics)
|
//- Extrudes into sphere with grading according to pressure (atmospherics)
|
||||||
//extrudeModel sigmaRadial;
|
// extrudeModel sigmaRadial;
|
||||||
|
|
||||||
nLayers 10;
|
nLayers 10;
|
||||||
|
|
||||||
expansionRatio 0.9;
|
expansionRatio 0.9;
|
||||||
|
|
||||||
linearNormalCoeffs
|
linearNormalCoeffs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -40,7 +40,7 @@ Foam::Field<Type> Foam::interpolateSplineXY
|
|||||||
|
|
||||||
forAll(xNew, i)
|
forAll(xNew, i)
|
||||||
{
|
{
|
||||||
yNew[i] = interpolateSmoothXY(xNew[i], xOld, yOld);
|
yNew[i] = interpolateSplineXY(xNew[i], xOld, yOld);
|
||||||
}
|
}
|
||||||
|
|
||||||
return yNew;
|
return yNew;
|
||||||
|
|||||||
@ -107,7 +107,7 @@ bool Foam::adjustPhi
|
|||||||
{
|
{
|
||||||
massCorr = (massIn - fixedMassOut)/adjustableMassOut;
|
massCorr = (massIn - fixedMassOut)/adjustableMassOut;
|
||||||
}
|
}
|
||||||
else if (mag(fixedMassOut - massIn)/totalFlux > 1e-10)
|
else if (mag(fixedMassOut - massIn)/totalFlux > 1e-8)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
|
|||||||
@ -114,20 +114,67 @@ void Foam::mappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
|
|||||||
const mappedPatchBase& mpp =
|
const mappedPatchBase& mpp =
|
||||||
refCast<const mappedPatchBase>(this->patch().patch());
|
refCast<const mappedPatchBase>(this->patch().patch());
|
||||||
const fvMesh& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
|
const fvMesh& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
|
||||||
const label samplePatchI = mpp.samplePolyPatch().index();
|
|
||||||
const fvPatch& nbrPatch = nbrMesh.boundary()[samplePatchI];
|
|
||||||
|
|
||||||
|
Field<Type> nbrIntFld;
|
||||||
|
|
||||||
// Retrieve the neighbour field
|
switch (mpp.mode())
|
||||||
const fvPatchField<Type>& nbrField =
|
{
|
||||||
nbrPatch.template lookupPatchField<FieldType, Type>
|
case mappedPatchBase::NEARESTCELL:
|
||||||
(
|
{
|
||||||
this->dimensionedInternalField().name()
|
FatalErrorIn
|
||||||
);
|
(
|
||||||
|
"void mappedFixedValueFvPatchField<Type>::updateCoeffs()"
|
||||||
|
) << "Cannot apply "
|
||||||
|
<< mappedPatchBase::sampleModeNames_
|
||||||
|
[
|
||||||
|
mappedPatchBase::NEARESTCELL
|
||||||
|
]
|
||||||
|
<< " mapping mode for patch " << this->patch().name()
|
||||||
|
<< exit(FatalError);
|
||||||
|
|
||||||
// Retrieve the neighbour patch internal field
|
break;
|
||||||
Field<Type> nbrIntFld(nbrField.patchInternalField());
|
}
|
||||||
mpp.distribute(nbrIntFld);
|
case mappedPatchBase::NEARESTPATCHFACE:
|
||||||
|
{
|
||||||
|
const label samplePatchI = mpp.samplePolyPatch().index();
|
||||||
|
const fvPatchField<Type>& nbrPatchField =
|
||||||
|
this->sampleField().boundaryField()[samplePatchI];
|
||||||
|
nbrIntFld = nbrPatchField.patchInternalField();
|
||||||
|
mpp.distribute(nbrIntFld);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case mappedPatchBase::NEARESTFACE:
|
||||||
|
{
|
||||||
|
Field<Type> allValues(nbrMesh.nFaces(), pTraits<Type>::zero);
|
||||||
|
|
||||||
|
const FieldType& nbrField = this->sampleField();
|
||||||
|
|
||||||
|
forAll(nbrField.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
const fvPatchField<Type>& pf = nbrField.boundaryField()[patchI];
|
||||||
|
const Field<Type> pif(pf.patchInternalField());
|
||||||
|
|
||||||
|
label faceStart = pf.patch().start();
|
||||||
|
|
||||||
|
forAll(pf, faceI)
|
||||||
|
{
|
||||||
|
allValues[faceStart++] = pif[faceI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mpp.distribute(allValues);
|
||||||
|
nbrIntFld.transfer(allValues);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
FatalErrorIn("mappedFixedValueFvPatchField<Type>::updateCoeffs()")
|
||||||
|
<< "Unknown sampling mode: " << mpp.mode()
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Restore tag
|
// Restore tag
|
||||||
UPstream::msgType() = oldTag;
|
UPstream::msgType() = oldTag;
|
||||||
|
|||||||
@ -71,7 +71,10 @@ class mappedFixedValueFvPatchField
|
|||||||
:
|
:
|
||||||
public fixedValueFvPatchField<Type>
|
public fixedValueFvPatchField<Type>
|
||||||
{
|
{
|
||||||
// Private data
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
//- Name of field to sample - defaults to field associated with this
|
//- Name of field to sample - defaults to field associated with this
|
||||||
// patchField if not specified
|
// patchField if not specified
|
||||||
@ -90,7 +93,7 @@ class mappedFixedValueFvPatchField
|
|||||||
mutable autoPtr<interpolation<Type> > interpolator_;
|
mutable autoPtr<interpolation<Type> > interpolator_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Field to sample. Either on my or nbr mesh
|
//- Field to sample. Either on my or nbr mesh
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& sampleField() const;
|
const GeometricField<Type, fvPatchField, volMesh>& sampleField() const;
|
||||||
|
|||||||
@ -146,9 +146,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
|
|
||||||
// Private data
|
// Protected data
|
||||||
|
|
||||||
//- Patch to sample
|
//- Patch to sample
|
||||||
const polyPatch& patch_;
|
const polyPatch& patch_;
|
||||||
@ -199,7 +199,7 @@ private:
|
|||||||
dictionary surfDict_;
|
dictionary surfDict_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Collect single list of samples and originating processor+face.
|
//- Collect single list of samples and originating processor+face.
|
||||||
void collectSamples
|
void collectSamples
|
||||||
|
|||||||
@ -3,9 +3,10 @@ sinclude $(RULES)/mplib$(WM_MPLIB)
|
|||||||
|
|
||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
$(PFLAGS) $(PINC) \
|
$(PFLAGS) $(PINC) \
|
||||||
|
-I$(SCOTCH_ROOT)/include \
|
||||||
-I$(SCOTCH_ARCH_PATH)/include/$(FOAM_MPI) \
|
-I$(SCOTCH_ARCH_PATH)/include/$(FOAM_MPI) \
|
||||||
-I/usr/include/scotch \
|
-I/usr/include/scotch \
|
||||||
-I../decompositionMethods/lnInclude
|
-I../decompositionMethods/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) -lptscotch -lptscotcherrexit -lrt
|
-L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) -lptscotch -lptscotcherrexit -lrt
|
||||||
|
|||||||
@ -7,9 +7,10 @@ sinclude $(RULES)/mplib$(WM_MPLIB)
|
|||||||
|
|
||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
$(PFLAGS) $(PINC) \
|
$(PFLAGS) $(PINC) \
|
||||||
|
-I$(SCOTCH_ROOT)/include \
|
||||||
-I$(SCOTCH_ARCH_PATH)/include \
|
-I$(SCOTCH_ARCH_PATH)/include \
|
||||||
-I/usr/include/scotch \
|
-I/usr/include/scotch \
|
||||||
-I../decompositionMethods/lnInclude
|
-I../decompositionMethods/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-L$(FOAM_EXT_LIBBIN) -lscotch -lscotcherrexit -lrt
|
-L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN) -lscotch -lscotcherrexit -lrt
|
||||||
|
|||||||
@ -1,77 +1,77 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
under the terms of the GNU General Public License as published by
|
under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
for more details.
|
for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "kinematicSingleLayer.H"
|
#include "kinematicSingleLayer.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace regionModels
|
namespace regionModels
|
||||||
{
|
{
|
||||||
namespace surfaceFilmModels
|
namespace surfaceFilmModels
|
||||||
{
|
{
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void kinematicSingleLayer::constrainFilmField
|
void kinematicSingleLayer::constrainFilmField
|
||||||
(
|
(
|
||||||
Type& field,
|
Type& field,
|
||||||
const typename Type::cmptType& value
|
const typename Type::cmptType& value
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAll(intCoupledPatchIDs_, i)
|
forAll(intCoupledPatchIDs_, i)
|
||||||
{
|
{
|
||||||
label patchI = intCoupledPatchIDs_[i];
|
label patchI = intCoupledPatchIDs_[i];
|
||||||
field.boundaryField()[patchI] = value;
|
field.boundaryField()[patchI] = value;
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Constraining " << field.name()
|
Info<< "Constraining " << field.name()
|
||||||
<< " boundary " << field.boundaryField()[patchI].patch().name()
|
<< " boundary " << field.boundaryField()[patchI].patch().name()
|
||||||
<< " to " << value << endl;
|
<< " to " << value << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
forAll(passivePatchIDs_, i)
|
forAll(passivePatchIDs_, i)
|
||||||
{
|
{
|
||||||
label patchI = passivePatchIDs_[i];
|
label patchI = passivePatchIDs_[i];
|
||||||
field.boundaryField()[patchI] = value;
|
field.boundaryField()[patchI] = value;
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Constraining " << field.name()
|
Info<< "Constraining " << field.name()
|
||||||
<< " boundary " << field.boundaryField()[patchI].patch().name()
|
<< " boundary " << field.boundaryField()[patchI].patch().name()
|
||||||
<< " to " << value << endl;
|
<< " to " << value << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // end namespace Foam
|
} // end namespace Foam
|
||||||
} // end namespace regionModels
|
} // end namespace regionModels
|
||||||
} // end namespace surfaceFilmModels
|
} // end namespace surfaceFilmModels
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -24,6 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "nuSgsUSpaldingWallFunctionFvPatchScalarField.H"
|
#include "nuSgsUSpaldingWallFunctionFvPatchScalarField.H"
|
||||||
|
#include "LESModel.H"
|
||||||
#include "fvPatchFieldMapper.H"
|
#include "fvPatchFieldMapper.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
@ -47,8 +48,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
fixedValueFvPatchScalarField(p, iF),
|
||||||
UName_("U"),
|
|
||||||
nuName_("nu"),
|
|
||||||
kappa_(0.41),
|
kappa_(0.41),
|
||||||
E_(9.8)
|
E_(9.8)
|
||||||
{}
|
{}
|
||||||
@ -64,8 +63,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
UName_(ptf.UName_),
|
|
||||||
nuName_(ptf.nuName_),
|
|
||||||
kappa_(ptf.kappa_),
|
kappa_(ptf.kappa_),
|
||||||
E_(ptf.E_)
|
E_(ptf.E_)
|
||||||
{}
|
{}
|
||||||
@ -80,8 +77,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF, dict),
|
fixedValueFvPatchScalarField(p, iF, dict),
|
||||||
UName_(dict.lookupOrDefault<word>("U", "U")),
|
|
||||||
nuName_(dict.lookupOrDefault<word>("nu", "nu")),
|
|
||||||
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
||||||
E_(dict.lookupOrDefault<scalar>("E", 9.8))
|
E_(dict.lookupOrDefault<scalar>("E", 9.8))
|
||||||
{}
|
{}
|
||||||
@ -94,8 +89,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(nwfpsf),
|
fixedValueFvPatchScalarField(nwfpsf),
|
||||||
UName_(nwfpsf.UName_),
|
|
||||||
nuName_(nwfpsf.nuName_),
|
|
||||||
kappa_(nwfpsf.kappa_),
|
kappa_(nwfpsf.kappa_),
|
||||||
E_(nwfpsf.E_)
|
E_(nwfpsf.E_)
|
||||||
{}
|
{}
|
||||||
@ -109,8 +102,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(nwfpsf, iF),
|
fixedValueFvPatchScalarField(nwfpsf, iF),
|
||||||
UName_(nwfpsf.UName_),
|
|
||||||
nuName_(nwfpsf.nuName_),
|
|
||||||
kappa_(nwfpsf.kappa_),
|
kappa_(nwfpsf.kappa_),
|
||||||
E_(nwfpsf.E_)
|
E_(nwfpsf.E_)
|
||||||
{}
|
{}
|
||||||
@ -123,16 +114,15 @@ void nuSgsUSpaldingWallFunctionFvPatchScalarField::evaluate
|
|||||||
const Pstream::commsTypes
|
const Pstream::commsTypes
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
|
||||||
|
const label patchi = patch().index();
|
||||||
|
const fvPatchVectorField& U = lesModel.U().boundaryField()[patchi];
|
||||||
|
const scalarField nuw = lesModel.nu()().boundaryField()[patchi];
|
||||||
|
|
||||||
const scalarField& ry = patch().deltaCoeffs();
|
const scalarField& ry = patch().deltaCoeffs();
|
||||||
|
|
||||||
const fvPatchVectorField& U =
|
|
||||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
|
||||||
|
|
||||||
const scalarField magUp(mag(U.patchInternalField() - U));
|
const scalarField magUp(mag(U.patchInternalField() - U));
|
||||||
|
|
||||||
const scalarField& nuw =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(nuName_);
|
|
||||||
|
|
||||||
scalarField& nuSgsw = *this;
|
scalarField& nuSgsw = *this;
|
||||||
|
|
||||||
const scalarField magFaceGradU(mag(U.snGrad()));
|
const scalarField magFaceGradU(mag(U.snGrad()));
|
||||||
@ -185,8 +175,6 @@ void nuSgsUSpaldingWallFunctionFvPatchScalarField::evaluate
|
|||||||
void nuSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
|
void nuSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchField<scalar>::write(os);
|
fvPatchField<scalar>::write(os);
|
||||||
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "nu", "nu", nuName_);
|
|
||||||
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
|
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
|
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
@ -201,6 +189,7 @@ makePatchTypeField
|
|||||||
nuSgsUSpaldingWallFunctionFvPatchScalarField
|
nuSgsUSpaldingWallFunctionFvPatchScalarField
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace LESModels
|
} // End namespace LESModels
|
||||||
|
|||||||
@ -58,12 +58,6 @@ class nuSgsUSpaldingWallFunctionFvPatchScalarField
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Name of velocity field
|
|
||||||
word UName_;
|
|
||||||
|
|
||||||
//- Name of laminar viscosity field
|
|
||||||
word nuName_;
|
|
||||||
|
|
||||||
//- Von Karman constant
|
//- Von Karman constant
|
||||||
scalar kappa_;
|
scalar kappa_;
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,8 @@ faceZones (fRight_zone fLeft_zone);
|
|||||||
|
|
||||||
oneD true;
|
oneD true;
|
||||||
|
|
||||||
|
sampleMode nearestPatchFace;
|
||||||
|
|
||||||
oneDPolyPatchType emptyPolyPatch; //wedgePolyPatch
|
oneDPolyPatchType emptyPolyPatch; //wedgePolyPatch
|
||||||
|
|
||||||
extrudeModel linearNormal;
|
extrudeModel linearNormal;
|
||||||
|
|||||||
@ -18,6 +18,8 @@ region wallFilmRegion;
|
|||||||
|
|
||||||
faceZones (wallFilmFaces);
|
faceZones (wallFilmFaces);
|
||||||
|
|
||||||
|
sampleMode nearestPatchFace;
|
||||||
|
|
||||||
oneD false;
|
oneD false;
|
||||||
|
|
||||||
extrudeModel linearNormal;
|
extrudeModel linearNormal;
|
||||||
|
|||||||
@ -24,6 +24,8 @@ faceZones
|
|||||||
|
|
||||||
oneD false;
|
oneD false;
|
||||||
|
|
||||||
|
sampleMode nearestPatchFace;
|
||||||
|
|
||||||
extrudeModel linearNormal;
|
extrudeModel linearNormal;
|
||||||
|
|
||||||
nLayers 1;
|
nLayers 1;
|
||||||
|
|||||||
@ -20,6 +20,8 @@ faceZones (wallFilmFaces);
|
|||||||
|
|
||||||
oneD false;
|
oneD false;
|
||||||
|
|
||||||
|
sampleMode nearestPatchFace;
|
||||||
|
|
||||||
extrudeModel linearNormal;
|
extrudeModel linearNormal;
|
||||||
|
|
||||||
nLayers 1;
|
nLayers 1;
|
||||||
|
|||||||
@ -20,6 +20,8 @@ faceZones (wallFilmFaces);
|
|||||||
|
|
||||||
oneD false;
|
oneD false;
|
||||||
|
|
||||||
|
sampleMode nearestPatchFace;
|
||||||
|
|
||||||
extrudeModel linearNormal;
|
extrudeModel linearNormal;
|
||||||
|
|
||||||
nLayers 1;
|
nLayers 1;
|
||||||
|
|||||||
@ -39,7 +39,9 @@ dynamicRefineFvMeshCoeffs
|
|||||||
// on surfaceScalarFields that do not need to be reinterpolated.
|
// on surfaceScalarFields that do not need to be reinterpolated.
|
||||||
correctFluxes
|
correctFluxes
|
||||||
(
|
(
|
||||||
(phi U)
|
(phi Urel)
|
||||||
|
(phiAbs U)
|
||||||
|
(phiAbs_0 U_0)
|
||||||
(nHatf none)
|
(nHatf none)
|
||||||
(rho*phi none)
|
(rho*phi none)
|
||||||
(ghf none)
|
(ghf none)
|
||||||
|
|||||||
Reference in New Issue
Block a user