Compare commits
3 Commits
feature-st
...
develop.sw
| Author | SHA1 | Date | |
|---|---|---|---|
| e65dc2d578 | |||
| 37db8ccd20 | |||
| a5d6c8ced0 |
@ -49,7 +49,7 @@
|
||||
|
||||
<!--
|
||||
Providing details of your set-up can help us identify any issues, e.g.
|
||||
OpenFOAM version : v2306|v2212|v2206|v2112|v2106 etc
|
||||
OpenFOAM version : v2206|v2112|v2106|v2012|v2006 etc
|
||||
Operating system : ubuntu|openSUSE|centos etc
|
||||
Hardware info : any info that may help?
|
||||
Compiler : gcc|intel|clang etc
|
||||
|
||||
10
Allwmake
10
Allwmake
@ -96,12 +96,10 @@ echo " ${WM_PROJECT_DIR##*/}"
|
||||
echo " $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler"
|
||||
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
|
||||
echo
|
||||
|
||||
# The api/patch information
|
||||
sed -e 's/^/ /; s/=/ = /' ./META-INFO/api-info 2>/dev/null || true
|
||||
|
||||
echo " bin = $(_foamCountDirEntries "$FOAM_APPBIN") entries"
|
||||
echo " lib = $(_foamCountDirEntries "$FOAM_LIBBIN") entries"
|
||||
echo " api = $(etc/openfoam -show-api 2>/dev/null)"
|
||||
echo " patch = $(etc/openfoam -show-patch 2>/dev/null)"
|
||||
echo " bin = $(_foamCountDirEntries "$FOAM_APPBIN") entries"
|
||||
echo " lib = $(_foamCountDirEntries "$FOAM_LIBBIN") entries"
|
||||
echo
|
||||
echo ========================================
|
||||
|
||||
|
||||
@ -5,22 +5,17 @@ It is likely incomplete...
|
||||
|
||||
## Contributors (alphabetical by surname)
|
||||
|
||||
- Horacio Aguerre
|
||||
- Yu Ankun
|
||||
- Tetsuo Aoyagi
|
||||
- Akira Azami
|
||||
- William Bainbridge
|
||||
- Gabriel Barajas
|
||||
- Kutalmis Bercin
|
||||
- Julius Bergmann
|
||||
- Ivor Clifford
|
||||
- Greg Collecutt
|
||||
- Jonathan Cranford
|
||||
- Santiago Marquez Damian
|
||||
- Sergio Ferraris
|
||||
- Matej Forman
|
||||
- Marian Fuchs
|
||||
- Gabriel Gerlero
|
||||
- Pawan Ghildiyal
|
||||
- Chris Greenshields
|
||||
- Bernhard Gschaider
|
||||
@ -55,11 +50,8 @@ It is likely incomplete...
|
||||
- Gavin Tabor
|
||||
- Zeljko Tukovic
|
||||
- Eugene De Villiers
|
||||
- Louis Vittoz
|
||||
- Vuko Vukcevic
|
||||
- Yi Wang
|
||||
- Norbert Weber
|
||||
- Volker Weissmann
|
||||
- Henry Weller
|
||||
- Niklas Wikstrom
|
||||
- Guanyang Xue
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
api=2306
|
||||
patch=0
|
||||
api=2206
|
||||
patch=220907
|
||||
|
||||
14
README.md
14
README.md
@ -40,9 +40,9 @@ Violations of the Trademark are monitored, and will be duly prosecuted.
|
||||
|
||||
If OpenFOAM has already been compiled on your system, simply source
|
||||
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
|
||||
For example, for the OpenFOAM-v2306 version:
|
||||
For example, for the OpenFOAM-v2206 version:
|
||||
```
|
||||
source /installation/path/OpenFOAM-v2306/etc/bashrc
|
||||
source /installation/path/OpenFOAM-v2206/etc/bashrc
|
||||
```
|
||||
|
||||
## Compiling OpenFOAM
|
||||
@ -127,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel
|
||||
to the OpenFOAM directory. For example,
|
||||
```
|
||||
/path/parent
|
||||
|-- OpenFOAM-v2306
|
||||
\-- ThirdParty-v2306
|
||||
|-- OpenFOAM-v2206
|
||||
\-- ThirdParty-v2206
|
||||
```
|
||||
There are, however, many cases where this simple convention is inadequate:
|
||||
|
||||
@ -136,7 +136,7 @@ There are, however, many cases where this simple convention is inadequate:
|
||||
operating system or cluster installation provides it)
|
||||
|
||||
* When we have changed the OpenFOAM directory name to some arbitrary
|
||||
directory name, e.g. openfoam-sandbox2306, etc..
|
||||
directory name, e.g. openfoam-sandbox2206, etc..
|
||||
|
||||
* When we would like any additional 3rd party software to be located
|
||||
inside of the OpenFOAM directory to ensure that the installation is
|
||||
@ -156,9 +156,9 @@ when locating the ThirdParty directory with the following precedence:
|
||||
2. PREFIX/ThirdParty-VERSION
|
||||
* this corresponds to the traditional approach
|
||||
3. PREFIX/ThirdParty-vAPI
|
||||
* allows for an updated value of VERSION, *eg*, `v2306-myCustom`,
|
||||
* allows for an updated value of VERSION, *eg*, `v2206-myCustom`,
|
||||
without requiring a renamed ThirdParty. The API value would still
|
||||
be `2306` and the original `ThirdParty-v2306/` would be found.
|
||||
be `2206` and the original `ThirdParty-v2206/` would be found.
|
||||
4. PREFIX/ThirdParty-API
|
||||
* same as the previous example, but using an unadorned API value.
|
||||
5. PREFIX/ThirdParty-common
|
||||
|
||||
@ -18,6 +18,6 @@ dimensionedScalar rho("rho", dimDensity, transportProperties);
|
||||
|
||||
scalar MaxCo =
|
||||
max(mesh.surfaceInterpolation::deltaCoeffs()*c0).value()
|
||||
*runTime.deltaTValue();
|
||||
*runTime.deltaT().value();
|
||||
|
||||
Info<< "Max acoustic Courant Number = " << MaxCo << endl;
|
||||
|
||||
@ -3,7 +3,6 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/overset/lnInclude \
|
||||
-I$(LIB_SRC)/overset/include/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -31,25 +31,3 @@
|
||||
Info<< "Reading diffusivity DT\n" << endl;
|
||||
|
||||
dimensionedScalar DT("DT", dimViscosity, transportProperties);
|
||||
|
||||
bool oversetPatchErrOutput =
|
||||
simple.dict().getOrDefault("oversetPatchErrOutput", false);
|
||||
|
||||
// Dummy phi for oversetPatchErrOutput
|
||||
tmp<surfaceScalarField> tdummyPhi;
|
||||
if (oversetPatchErrOutput)
|
||||
{
|
||||
tdummyPhi = tmp<surfaceScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dummyPhi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimless, Zero)
|
||||
);
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -58,7 +58,6 @@ Description
|
||||
#include "fvOptions.H"
|
||||
#include "simpleControl.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "oversetPatchPhiErr.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -100,11 +99,6 @@ int main(int argc, char *argv[])
|
||||
fvOptions.constrain(TEqn);
|
||||
TEqn.solve();
|
||||
fvOptions.correct(T);
|
||||
|
||||
if (oversetPatchErrOutput)
|
||||
{
|
||||
oversetPatchPhiErr(TEqn, tdummyPhi.ref());
|
||||
}
|
||||
}
|
||||
|
||||
#include "write.H"
|
||||
|
||||
@ -1,4 +1,125 @@
|
||||
#include "../createFields.H"
|
||||
Info<< "Reading velocity field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
// Initialise the velocity internal field to zero
|
||||
U = dimensionedVector(U.dimensions(), Zero);
|
||||
|
||||
surfaceScalarField phi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
fvc::flux(U)
|
||||
);
|
||||
|
||||
if (args.found("initialiseUBCs"))
|
||||
{
|
||||
U.correctBoundaryConditions();
|
||||
phi = fvc::flux(U);
|
||||
}
|
||||
|
||||
|
||||
// Construct a pressure field
|
||||
// If it is available read it otherwise construct from the velocity BCs
|
||||
// converting fixed-value BCs to zero-gradient and vice versa.
|
||||
|
||||
// Allow override from command-line -pName option
|
||||
const word pName = args.getOrDefault<word>("pName", "p");
|
||||
|
||||
// Infer the pressure BCs from the velocity
|
||||
wordList pBCTypes
|
||||
(
|
||||
U.boundaryField().size(),
|
||||
fixedValueFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
forAll(U.boundaryField(), patchi)
|
||||
{
|
||||
if (U.boundaryField()[patchi].fixesValue())
|
||||
{
|
||||
pBCTypes[patchi] = zeroGradientFvPatchScalarField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
// Note that registerObject is false for the pressure field. The pressure
|
||||
// field in this solver doesn't have a physical value during the solution.
|
||||
// It shouldn't be looked up and used by sub models or boundary conditions.
|
||||
Info<< "Constructing pressure field " << pName << nl << endl;
|
||||
volScalarField p
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
pName,
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(sqr(dimVelocity), Zero),
|
||||
pBCTypes
|
||||
);
|
||||
|
||||
// Infer the velocity potential BCs from the pressure
|
||||
wordList PhiBCTypes
|
||||
(
|
||||
p.boundaryField().size(),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
forAll(p.boundaryField(), patchi)
|
||||
{
|
||||
if (p.boundaryField()[patchi].fixesValue())
|
||||
{
|
||||
PhiBCTypes[patchi] = fixedValueFvPatchScalarField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "Constructing velocity potential field Phi\n" << endl;
|
||||
volScalarField Phi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimLength*dimVelocity, Zero),
|
||||
PhiBCTypes
|
||||
);
|
||||
|
||||
label PhiRefCell = 0;
|
||||
scalar PhiRefValue = 0;
|
||||
setRefCell
|
||||
(
|
||||
Phi,
|
||||
potentialFlow.dict(),
|
||||
PhiRefCell,
|
||||
PhiRefValue
|
||||
);
|
||||
mesh.setFluxRequired(Phi.name());
|
||||
|
||||
#include "createMRF.H"
|
||||
|
||||
// Add solver-specific interpolations
|
||||
{
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd
|
||||
Copyright (C) 2017 OpenCFD Ltd
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -83,7 +83,6 @@ Description
|
||||
\heading Options
|
||||
\plaintable
|
||||
-writep | write the Euler pressure
|
||||
-writephi | Write the final volumetric flux
|
||||
-writePhi | Write the final velocity potential
|
||||
-initialiseUBCs | Update the velocity boundaries before solving for Phi
|
||||
\endplaintable
|
||||
@ -118,12 +117,6 @@ int main(int argc, char *argv[])
|
||||
"Initialise U boundary conditions"
|
||||
);
|
||||
|
||||
argList::addBoolOption
|
||||
(
|
||||
"writephi",
|
||||
"Write the final volumetric flux field"
|
||||
);
|
||||
|
||||
argList::addBoolOption
|
||||
(
|
||||
"writePhi",
|
||||
@ -142,8 +135,6 @@ int main(int argc, char *argv[])
|
||||
"Execute functionObjects"
|
||||
);
|
||||
|
||||
#include "addRegionOption.H"
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createNamedDynamicFvMesh.H"
|
||||
@ -158,6 +149,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
mesh.update();
|
||||
|
||||
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
||||
|
||||
// Since solver contains no time loop it would never execute
|
||||
// function objects so do it ourselves
|
||||
@ -203,16 +195,11 @@ int main(int argc, char *argv[])
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// Write U
|
||||
// Write U and phi
|
||||
U.write();
|
||||
phi.write();
|
||||
|
||||
// Optionally write the volumetric flux, phi
|
||||
if (args.found("writephi"))
|
||||
{
|
||||
phi.write();
|
||||
}
|
||||
|
||||
// Optionally write velocity potential, Phi
|
||||
// Optionally write Phi
|
||||
if (args.found("writePhi"))
|
||||
{
|
||||
Phi.write();
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020,2023 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -132,11 +132,6 @@ void PDRkEpsilon::correct()
|
||||
|
||||
// Update epsilon and G at the wall
|
||||
epsilon_.boundaryFieldRef().updateCoeffs();
|
||||
// Push new cell values to
|
||||
// coupled neighbours. Note that we want to avoid the re-updateCoeffs
|
||||
// of the wallFunctions so make sure to bypass the evaluate on
|
||||
// those patches and only do the coupled ones.
|
||||
epsilon_.boundaryFieldRef().evaluateCoupled<coupledFvPatch>();
|
||||
|
||||
// Add the blockage generation term so that it is included consistently
|
||||
// in both the k and epsilon equations
|
||||
|
||||
@ -109,7 +109,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
IOobject::NO_REGISTER
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(Nv.dimensions(), Zero)
|
||||
|
||||
@ -171,7 +171,10 @@ if (ign.ignited())
|
||||
|
||||
fvOptions.correct(Su);
|
||||
|
||||
Su.clamp_range(SuMin, SuMax);
|
||||
// Limit the maximum Su
|
||||
// ~~~~~~~~~~~~~~~~~~~~
|
||||
Su.min(SuMax);
|
||||
Su.max(SuMin);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -215,7 +218,7 @@ if (ign.ignited())
|
||||
+ (
|
||||
scalar(1)
|
||||
+ (2*XiShapeCoef)
|
||||
*(scalar(0.5) - clamp(b, zero_one{}))
|
||||
*(scalar(0.5) - min(max(b, scalar(0)), scalar(1)))
|
||||
)*(XiEqStar - scalar(1.001))
|
||||
);
|
||||
|
||||
@ -223,7 +226,7 @@ if (ign.ignited())
|
||||
volScalarField R(Gstar*XiEqStar/(XiEqStar - scalar(1)));
|
||||
volScalarField G(R*(XiEq - scalar(1.001))/XiEq);
|
||||
|
||||
//R *= (Gstar + 2*mag(devSymm(fvc::grad(U))))/Gstar;
|
||||
//R *= (Gstar + 2*mag(dev(symm(fvc::grad(U)))))/Gstar;
|
||||
|
||||
// Solve for the flame wrinkling
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -12,7 +12,7 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl;
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
IOobject::NO_REGISTER
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("Ydefault", dimless, 1)
|
||||
@ -29,7 +29,7 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl;
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
IOobject::NO_REGISTER
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("p", dimPressure, p0)
|
||||
@ -46,7 +46,7 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl;
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
IOobject::NO_REGISTER
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("T", dimTemperature, T0)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
runTime.setDeltaT(min(dtChem, maxDeltaT));
|
||||
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dtChem = chemistry.solve(runTime.deltaTValue());
|
||||
dtChem = chemistry.solve(runTime.deltaT().value());
|
||||
scalar Qdot = chemistry.Qdot()()[0]/rho[0];
|
||||
integratedHeat += Qdot*runTime.deltaTValue();
|
||||
integratedHeat += Qdot*runTime.deltaT().value();
|
||||
|
||||
@ -39,13 +39,13 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.clamp_min(0);
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].clamp_min(0);
|
||||
Y[inertIndex].max(0.0);
|
||||
|
||||
radiation->correct();
|
||||
|
||||
|
||||
@ -38,11 +38,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.clamp_min(0);
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].clamp_min(0);
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
|
||||
@ -103,10 +103,16 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
if (dict.found("value"))
|
||||
{
|
||||
// Fallback: set to the internal field
|
||||
fvPatchField<scalar>::patchInternalField(*this);
|
||||
fvPatchField<scalar>::operator=
|
||||
(
|
||||
scalarField("value", dict, p.size())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
fvPatchField<scalar>::operator=(patchInternalField());
|
||||
}
|
||||
|
||||
refValue() = *this;
|
||||
@ -159,10 +165,14 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& pmu = patch().lookupPatchField<volScalarField>(muName_);
|
||||
const auto& prho = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
const auto& ppsi = patch().lookupPatchField<volScalarField>(psiName_);
|
||||
const auto& pU = patch().lookupPatchField<volVectorField>(UName_);
|
||||
const fvPatchScalarField& pmu =
|
||||
patch().lookupPatchField<volScalarField, scalar>(muName_);
|
||||
const fvPatchScalarField& prho =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const fvPatchField<scalar>& ppsi =
|
||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
const fvPatchVectorField& pU =
|
||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
||||
|
||||
// Prandtl number reading consistent with rhoCentralFoam
|
||||
const dictionary& thermophysicalProperties =
|
||||
@ -197,7 +207,7 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
|
||||
// Write
|
||||
void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<scalar>::write(os);
|
||||
fvPatchScalarField::write(os);
|
||||
|
||||
os.writeEntryIfDifferent<word>("U", "U", UName_);
|
||||
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
||||
@ -207,7 +217,7 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
|
||||
os.writeEntry("accommodationCoeff", accommodationCoeff_);
|
||||
Twall_.writeEntry("Twall", os);
|
||||
os.writeEntry("gamma", gamma_);
|
||||
fvPatchField<scalar>::writeValueEntry(os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -105,15 +105,18 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
if (this->readValueEntry(dict))
|
||||
if (dict.found("value"))
|
||||
{
|
||||
const auto* hasRefValue = dict.findEntry("refValue", keyType::LITERAL);
|
||||
const auto* hasFrac = dict.findEntry("valueFraction", keyType::LITERAL);
|
||||
fvPatchField<vector>::operator=
|
||||
(
|
||||
vectorField("value", dict, p.size())
|
||||
);
|
||||
|
||||
if (hasRefValue && hasFrac)
|
||||
if (dict.found("refValue") && dict.found("valueFraction"))
|
||||
{
|
||||
this->refValue().assign(*hasRefValue, p.size());
|
||||
this->valueFraction().assign(*hasFrac, p.size());
|
||||
this->refValue() = vectorField("refValue", dict, p.size());
|
||||
this->valueFraction() =
|
||||
scalarField("valueFraction", dict, p.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -152,9 +155,12 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& pmu = patch().lookupPatchField<volScalarField>(muName_);
|
||||
const auto& prho = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
const auto& ppsi = patch().lookupPatchField<volScalarField>(psiName_);
|
||||
const fvPatchScalarField& pmu =
|
||||
patch().lookupPatchField<volScalarField, scalar>(muName_);
|
||||
const fvPatchScalarField& prho =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const fvPatchField<scalar>& ppsi =
|
||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
|
||||
Field<scalar> C1
|
||||
(
|
||||
@ -181,8 +187,8 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
|
||||
|
||||
if (curvature_)
|
||||
{
|
||||
const auto& ptauMC =
|
||||
patch().lookupPatchField<volTensorField>(tauMCName_);
|
||||
const fvPatchTensorField& ptauMC =
|
||||
patch().lookupPatchField<volTensorField, tensor>(tauMCName_);
|
||||
vectorField n(patch().nf());
|
||||
|
||||
refValue() -= C1/prho*transform(I - n*n, (n & ptauMC));
|
||||
@ -194,7 +200,7 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
|
||||
|
||||
void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<vector>::write(os);
|
||||
fvPatchVectorField::write(os);
|
||||
os.writeEntryIfDifferent<word>("T", "T", TName_);
|
||||
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
||||
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
|
||||
@ -209,7 +215,7 @@ void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
|
||||
refValue().writeEntry("refValue", os);
|
||||
valueFraction().writeEntry("valueFraction", os);
|
||||
|
||||
fvPatchField<vector>::writeValueEntry(os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -104,8 +104,11 @@ void Foam::fixedRhoFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& psip = patch().lookupPatchField<volScalarField>(psiName_);
|
||||
const auto& pp = patch().lookupPatchField<volScalarField>(pName_);
|
||||
const fvPatchField<scalar>& psip =
|
||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
|
||||
const fvPatchField<scalar>& pp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(pName_);
|
||||
|
||||
operator==(psip*pp);
|
||||
|
||||
@ -115,10 +118,11 @@ void Foam::fixedRhoFvPatchScalarField::updateCoeffs()
|
||||
|
||||
void Foam::fixedRhoFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<scalar>::write(os);
|
||||
fvPatchScalarField::write(os);
|
||||
|
||||
os.writeEntryIfDifferent<word>("p", "p", pName_);
|
||||
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
|
||||
fvPatchField<scalar>::writeValueEntry(os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -17,7 +17,7 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> interpolate
|
||||
vf,
|
||||
dir,
|
||||
"reconstruct("
|
||||
+ (reconFieldName.empty() ? vf.name() : reconFieldName)
|
||||
+ (reconFieldName != word::null ? reconFieldName : vf.name())
|
||||
+ ')'
|
||||
)
|
||||
);
|
||||
|
||||
@ -9,7 +9,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -29,7 +29,7 @@ if (mesh.changing())
|
||||
wordList pcorrTypes
|
||||
(
|
||||
p.boundaryField().size(),
|
||||
fvPatchFieldBase::zeroGradientType()
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
// Set BCs of pcorr to fixed-value for patches at which p is fixed
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
bool ddtCorr
|
||||
(
|
||||
pimple.dict().getOrDefault("ddtCorr", true)
|
||||
);
|
||||
@ -69,8 +69,6 @@ mesh.setFluxRequired(p.name());
|
||||
|
||||
// Mask field for zeroing out contributions on hole cells
|
||||
#include "createCellMask.H"
|
||||
// Create bool field with interpolated cells
|
||||
#include "createInterpolatedCells.H"
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,6 +43,7 @@ Description
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "fluidThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "bound.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "pressureControl.H"
|
||||
#include "CorrectPhi.H"
|
||||
@ -88,8 +89,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readControls.H"
|
||||
#include "readDyMControls.H"
|
||||
|
||||
|
||||
// Store divrhoU from the previous mesh so that it can be mapped
|
||||
// and used in correctPhi to ensure the corrected phi has the
|
||||
// same divergence
|
||||
@ -125,6 +128,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
||||
{
|
||||
|
||||
// Do any mesh changes
|
||||
mesh.update();
|
||||
|
||||
@ -133,22 +137,52 @@ int main(int argc, char *argv[])
|
||||
MRF.update();
|
||||
|
||||
#include "setCellMask.H"
|
||||
#include "setInterpolatedCells.H"
|
||||
#include "correctRhoPhiFaceMask.H"
|
||||
|
||||
const surfaceScalarField faceMaskOld
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
||||
);
|
||||
|
||||
// Zero Uf on old faceMask (H-I)
|
||||
rhoUf() *= faceMaskOld;
|
||||
|
||||
surfaceVectorField rhoUfint(fvc::interpolate(rho*U));
|
||||
|
||||
// Update Uf and phi on new C-I faces
|
||||
rhoUf() += (1-faceMaskOld)*rhoUfint;
|
||||
|
||||
// Update Uf boundary
|
||||
forAll(rhoUf().boundaryField(), patchI)
|
||||
{
|
||||
rhoUf().boundaryFieldRef()[patchI] =
|
||||
rhoUfint.boundaryField()[patchI];
|
||||
}
|
||||
|
||||
// Calculate absolute flux from the mapped surface velocity
|
||||
phi = mesh.Sf() & rhoUf();
|
||||
|
||||
if (correctPhi)
|
||||
{
|
||||
// Corrects flux on separated regions
|
||||
#include "correctPhi.H"
|
||||
}
|
||||
|
||||
// Zero phi on current H-I
|
||||
const surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
|
||||
phi *= faceMask;
|
||||
U *= cellMask;
|
||||
|
||||
// Make the fluxes relative to the mesh-motion
|
||||
fvc::makeRelative(phi, rho, U);
|
||||
|
||||
if (checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
}
|
||||
|
||||
if (checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -25,6 +25,17 @@ surfaceScalarField phiHbyA
|
||||
fvc::interpolate(rho)*fvc::flux(HbyA)
|
||||
);
|
||||
|
||||
if (ddtCorr)
|
||||
{
|
||||
surfaceScalarField faceMaskOld
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
||||
);
|
||||
|
||||
phiHbyA +=
|
||||
faceMaskOld*MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf));
|
||||
}
|
||||
|
||||
fvc::makeRelative(phiHbyA, rho, U);
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
@ -123,4 +134,8 @@ if (thermo.dpdt())
|
||||
}
|
||||
}
|
||||
|
||||
surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
phi *= faceMask;
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
#include "readTimeControls.H"
|
||||
|
||||
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
|
||||
|
||||
checkMeshCourantNo =
|
||||
pimple.dict().getOrDefault("checkMeshCourantNo", false);
|
||||
|
||||
|
||||
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);
|
||||
@ -7,7 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
sqrt
|
||||
(
|
||||
2*M_PI*sigma*sqr(aMesh.edgeInterpolation::deltaCoeffs())
|
||||
*mag(aMesh.edgeInterpolation::deltaCoeffs())
|
||||
*aMesh.edgeInterpolation::deltaCoeffs()
|
||||
/rhol
|
||||
)
|
||||
).value()*runTime.deltaTValue();
|
||||
).value()*runTime.deltaT().value();
|
||||
|
||||
Info<< "Max Capillary Courant Number = " << CoNumSigma << '\n' << endl;
|
||||
}
|
||||
|
||||
@ -1,6 +1,3 @@
|
||||
// Volume-to surface mapping object
|
||||
const volSurfaceMapping vsm(aMesh);
|
||||
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
@ -29,3 +26,6 @@ volScalarField H
|
||||
mesh,
|
||||
dimensionedScalar(dimLength, Zero)
|
||||
);
|
||||
|
||||
// Create volume-to surface mapping object
|
||||
volSurfaceMapping vsm(aMesh);
|
||||
|
||||
@ -87,13 +87,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
fam::ddt(h, Us)
|
||||
+ fam::div(phi2s, Us)
|
||||
+ fam::Sp
|
||||
(
|
||||
0.0125
|
||||
*frictionFactor.internalField()
|
||||
*mag(Us.internalField()),
|
||||
Us
|
||||
)
|
||||
+ fam::Sp(0.0125*frictionFactor*mag(Us), Us)
|
||||
==
|
||||
Gs*h
|
||||
- fam::Sp(Sd, Us)
|
||||
|
||||
@ -47,10 +47,10 @@ if (aMesh.nInternalEdges())
|
||||
);
|
||||
|
||||
CoNum = max(SfUfbyDelta/aMesh.magLe())
|
||||
.value()*runTime.deltaTValue();
|
||||
.value()*runTime.deltaT().value();
|
||||
|
||||
meanCoNum = (sum(SfUfbyDelta)/sum(aMesh.magLe()))
|
||||
.value()*runTime.deltaTValue();
|
||||
.value()*runTime.deltaT().value();
|
||||
|
||||
velMag = max(mag(phis)/aMesh.magLe()).value();
|
||||
}
|
||||
|
||||
@ -47,7 +47,6 @@ forAll(Us, faceI)
|
||||
Us[faceI].z() =
|
||||
Uinf.value()*0.25*R[faceI].x()*R[faceI].z()/sqr(mag(R[faceI]));
|
||||
}
|
||||
Us.boundaryFieldRef().evaluateCoupled<coupledFaPatch>();
|
||||
|
||||
Us -= aMesh.faceAreaNormals()*(aMesh.faceAreaNormals() & Us);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// Volume-to surface mapping object
|
||||
const volSurfaceMapping vsm(aMesh);
|
||||
// Create volume-to surface mapping object
|
||||
volSurfaceMapping vsm(aMesh);
|
||||
|
||||
volScalarField Cvf
|
||||
(
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// Volume-to surface mapping object
|
||||
const volSurfaceMapping vsm(aMesh);
|
||||
// Create volume-to surface mapping object
|
||||
volSurfaceMapping vsm(aMesh);
|
||||
|
||||
volScalarField Cvf
|
||||
(
|
||||
|
||||
@ -10,7 +10,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -29,7 +29,7 @@ if (mesh.changing())
|
||||
wordList pcorrTypes
|
||||
(
|
||||
p.boundaryField().size(),
|
||||
fvPatchFieldBase::zeroGradientType()
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
// Set BCs of pcorr to fixed-value for patches at which p is fixed
|
||||
|
||||
@ -124,6 +124,3 @@ dimensionedScalar initialMass("initialMass", fvc::domainIntegrate(rho));
|
||||
|
||||
// Mask field for zeroing out contributions on hole cells
|
||||
#include "createCellMask.H"
|
||||
|
||||
// Create bool field with interpolated cells
|
||||
#include "createInterpolatedCells.H"
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -50,7 +50,6 @@ Description
|
||||
#include "CorrectPhi.H"
|
||||
#include "cellCellStencilObject.H"
|
||||
#include "localMin.H"
|
||||
#include "oversetAdjustPhi.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -87,6 +86,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
|
||||
#include "readControls.H"
|
||||
#include "readDyMControls.H"
|
||||
|
||||
#include "compressibleCourantNo.H"
|
||||
@ -126,14 +128,45 @@ int main(int argc, char *argv[])
|
||||
MRF.update();
|
||||
|
||||
#include "setCellMask.H"
|
||||
#include "setInterpolatedCells.H"
|
||||
#include "correctRhoPhiFaceMask.H"
|
||||
|
||||
const surfaceScalarField faceMaskOld
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
||||
);
|
||||
|
||||
// Zero Uf on old faceMask (H-I)
|
||||
rhoUf() *= faceMaskOld;
|
||||
|
||||
//fvc::correctRhoUf(rhoUfint, rho, U, phi);
|
||||
surfaceVectorField rhoUfint(fvc::interpolate(rho*U));
|
||||
|
||||
// Update Uf and phi on new C-I faces
|
||||
rhoUf() += (1-faceMaskOld)*rhoUfint;
|
||||
|
||||
// Update Uf boundary
|
||||
forAll(rhoUf().boundaryField(), patchI)
|
||||
{
|
||||
rhoUf().boundaryFieldRef()[patchI] =
|
||||
rhoUfint.boundaryField()[patchI];
|
||||
}
|
||||
|
||||
// Calculate absolute flux from the mapped surface velocity
|
||||
phi = mesh.Sf() & rhoUf();
|
||||
|
||||
if (correctPhi)
|
||||
{
|
||||
#include "correctPhi.H"
|
||||
}
|
||||
|
||||
// Zero phi on current H-I
|
||||
const surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
|
||||
phi *= faceMask;
|
||||
U *= cellMask;
|
||||
|
||||
// Make the fluxes relative to the mesh-motion
|
||||
fvc::makeRelative(phi, rho, U);
|
||||
}
|
||||
|
||||
@ -21,13 +21,16 @@ surfaceScalarField phiHbyA
|
||||
fvc::flux(rho*HbyA) + phig
|
||||
);
|
||||
|
||||
if (adjustFringe)
|
||||
if (ddtCorr)
|
||||
{
|
||||
fvc::makeRelative(phiHbyA,rho, U);
|
||||
oversetAdjustPhi(phiHbyA, U);
|
||||
fvc::makeAbsolute(phiHbyA,rho, U);
|
||||
}
|
||||
surfaceScalarField faceMaskOld
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
||||
);
|
||||
|
||||
phiHbyA +=
|
||||
faceMaskOld*MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi));
|
||||
}
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
@ -119,4 +122,8 @@ if (thermo.dpdt())
|
||||
}
|
||||
}
|
||||
|
||||
surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
phi *= faceMask;
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
#include "readTimeControls.H"
|
||||
|
||||
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
|
||||
|
||||
checkMeshCourantNo =
|
||||
pimple.dict().getOrDefault("checkMeshCourantNo", false);
|
||||
|
||||
|
||||
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);
|
||||
@ -7,7 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -19,7 +19,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -113,19 +113,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
@ -137,10 +133,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
if (!frozenFlow)
|
||||
{
|
||||
Info<< "\nSolving for fluid region "
|
||||
@ -172,24 +166,20 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
Info<< "\nSolving for solid region "
|
||||
<< solidRegions[i].name() << endl;
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
|
||||
@ -76,21 +76,17 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
#include "readFluidMultiRegionSIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionSIMPLEControls.H"
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
@ -103,10 +99,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
if (!frozenFlow)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
@ -127,24 +121,20 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
#include "readFluidMultiRegionSIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionSIMPLEControls.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
Info<< "\nSolving for solid region "
|
||||
<< solidRegions[i].name() << endl;
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ forAll(fluidRegions, i)
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
dimensionedScalar(word::null, dimLength, Zero)
|
||||
dimensionedScalar("hRef", dimLength, Zero) // uses name
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -5,5 +5,3 @@
|
||||
|
||||
const bool momentumPredictor =
|
||||
simple.getOrDefault("momentumPredictor", true);
|
||||
|
||||
simple.readIfPresent("frozenFlow", frozenFlowFluid[i]);
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
const fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
rhoThermo& thermo = thermoFluid[i];
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C
|
||||
solid/solidRegionDiffNo.C
|
||||
../solid/solidRegionDiffNo.C
|
||||
chtMultiRegionTwoPhaseEulerFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/chtMultiRegionTwoPhaseEulerFoam
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -108,23 +108,19 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
Info<< "\nSolving for solid region "
|
||||
<< solidRegions[i].name() << endl;
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
@ -139,24 +135,20 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
frozenFlow = true;
|
||||
#include "solveFluid.H"
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
|
||||
Info<< "\nSolving for solid region "
|
||||
<< solidRegions[i].name() << endl;
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,29 +88,26 @@ kappa
|
||||
|
||||
case mtLookup:
|
||||
{
|
||||
if (mesh.foundObject<volScalarField>(kappaName_))
|
||||
{
|
||||
const auto* ptr =
|
||||
mesh.cfindObject<volScalarField>(kappaName_);
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
return patch().patchField(*ptr);
|
||||
}
|
||||
return patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
kappaName_
|
||||
);
|
||||
}
|
||||
else if (mesh.foundObject<volSymmTensorField>(kappaName_))
|
||||
{
|
||||
const auto* ptr =
|
||||
mesh.cfindObject<volSymmTensorField>(kappaName_);
|
||||
const symmTensorField& KWall =
|
||||
patch().lookupPatchField<volSymmTensorField, scalar>
|
||||
(
|
||||
kappaName_
|
||||
);
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
const symmTensorField& KWall = patch().patchField(*ptr);
|
||||
const vectorField n(patch().nf());
|
||||
|
||||
const vectorField n(patch().nf());
|
||||
|
||||
return n & KWall & n;
|
||||
}
|
||||
return n & KWall & n;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Did not find field " << kappaName_
|
||||
@ -120,6 +117,9 @@ kappa
|
||||
<< " or volSymmTensorField."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -131,8 +131,10 @@ kappa
|
||||
mesh.lookupObject<phaseSystem>("phaseProperties")
|
||||
);
|
||||
|
||||
auto tkappaEff = tmp<scalarField>::New(patch().size(), Zero);
|
||||
auto& kappaEff = tkappaEff.ref();
|
||||
tmp<scalarField> kappaEff
|
||||
(
|
||||
new scalarField(patch().size(), 0.0)
|
||||
);
|
||||
|
||||
forAll(fluid.phases(), phasei)
|
||||
{
|
||||
@ -140,10 +142,10 @@ kappa
|
||||
|
||||
const fvPatchScalarField& alpha = phase.boundaryField()[patchi];
|
||||
|
||||
kappaEff += alpha*phase.kappaEff(patchi)();
|
||||
kappaEff.ref() += alpha*phase.kappaEff(patchi)();
|
||||
}
|
||||
|
||||
return tkappaEff;
|
||||
return kappaEff;
|
||||
|
||||
break;
|
||||
}
|
||||
@ -159,11 +161,9 @@ kappa
|
||||
}
|
||||
}
|
||||
|
||||
// Return zero-sized (not nullptr)
|
||||
return tmp<scalarField>::New();
|
||||
return scalarField(0);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -243,12 +243,14 @@ turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
||||
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
|
||||
if (this->readMixedEntries(dict))
|
||||
if (dict.found("refValue"))
|
||||
{
|
||||
// Full restart
|
||||
refValue() = scalarField("refValue", dict, p.size());
|
||||
refGrad() = scalarField("refGradient", dict, p.size());
|
||||
valueFraction() = scalarField("valueFraction", dict, p.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -292,7 +294,8 @@ updateCoeffs()
|
||||
|
||||
// Since we're inside initEvaluate/evaluate there might be processor
|
||||
// comms underway. Change the tag we use.
|
||||
const int oldTag = UPstream::incrMsgType();
|
||||
int oldTag = UPstream::msgType();
|
||||
UPstream::msgType() = oldTag+1;
|
||||
|
||||
// Get the coupling information from the mappedPatchBase
|
||||
const label patchi = patch().index();
|
||||
@ -305,11 +308,12 @@ updateCoeffs()
|
||||
|
||||
scalarField& Tp = *this;
|
||||
|
||||
const auto& nbrField =
|
||||
refCast
|
||||
<
|
||||
const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
|
||||
>(nbrPatch.lookupPatchField<volScalarField>(TnbrName_));
|
||||
const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField&
|
||||
nbrField = refCast
|
||||
<const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField>
|
||||
(
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
|
||||
);
|
||||
|
||||
// Swap to obtain full local values of neighbour internal field
|
||||
scalarField TcNbr(nbrField.patchInternalField());
|
||||
@ -326,13 +330,13 @@ updateCoeffs()
|
||||
scalarField qr(Tp.size(), 0.0);
|
||||
if (qrName_ != "none")
|
||||
{
|
||||
qr = patch().lookupPatchField<volScalarField>(qrName_);
|
||||
qr = patch().lookupPatchField<volScalarField, scalar>(qrName_);
|
||||
}
|
||||
|
||||
scalarField qrNbr(Tp.size(), 0.0);
|
||||
if (qrNbrName_ != "none")
|
||||
{
|
||||
qrNbr = nbrPatch.lookupPatchField<volScalarField>(qrNbrName_);
|
||||
qrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(qrNbrName_);
|
||||
mpp.distribute(qrNbr);
|
||||
}
|
||||
|
||||
@ -470,9 +474,10 @@ updateCoeffs()
|
||||
<< regionTypeNames_ << nl << exit(FatalError);
|
||||
}
|
||||
|
||||
UPstream::msgType(oldTag); // Restore tag
|
||||
|
||||
mixedFvPatchScalarField::updateCoeffs();
|
||||
|
||||
// Restore tag
|
||||
UPstream::msgType() = oldTag;
|
||||
}
|
||||
|
||||
|
||||
@ -481,7 +486,7 @@ void turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::write
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
mixedFvPatchField<scalar>::write(os);
|
||||
mixedFvPatchScalarField::write(os);
|
||||
os.writeEntry("kappaMethod", KMethodTypeNames_[method_]);
|
||||
os.writeEntryIfDifferent<word>("kappa","none", kappaName_);
|
||||
|
||||
|
||||
@ -221,7 +221,7 @@ forAll(fluidRegions, i)
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
dimensionedScalar(word::null, dimLength, Zero)
|
||||
dimensionedScalar("hRef", dimLength, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -13,11 +13,11 @@ forAll(cumulativeContErrIO, i)
|
||||
"cumulativeContErr",
|
||||
runTime.timeName(),
|
||||
"uniform",
|
||||
mesh.thisDb(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
dimensionedScalar(word::null, dimless, Zero)
|
||||
dimensionedScalar(dimless, Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -9,5 +9,3 @@
|
||||
(
|
||||
pimpleDict.getOrDefault<int>("nEnergyCorrectors", 1)
|
||||
);
|
||||
|
||||
pimpleDict.readIfPresent("frozenFlow", frozenFlowFluid[i]);
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
twoPhaseSystem& fluid = phaseSystemFluid[i];
|
||||
|
||||
phaseModel& phase1 = fluid.phase1();
|
||||
|
||||
@ -1 +0,0 @@
|
||||
../../solid/solidRegionDiffNo.C
|
||||
@ -48,7 +48,7 @@ if (Y.size())
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.clamp_min(0);
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
@ -56,6 +56,6 @@ if (Y.size())
|
||||
if (Y.size())
|
||||
{
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].clamp_min(0);
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ forAll(fluidRegions, i)
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
dimensionedScalar(word::null, dimLength, Zero)
|
||||
dimensionedScalar("hRef", dimLength, Zero) // uses name
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -13,11 +13,11 @@ forAll(cumulativeContErrIO, i)
|
||||
"cumulativeContErr",
|
||||
runTime.timeName(),
|
||||
"uniform",
|
||||
mesh.thisDb(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
dimensionedScalar(word::null, dimless, Zero)
|
||||
dimensionedScalar(dimless, Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -8,5 +8,3 @@
|
||||
|
||||
const bool momentumPredictor =
|
||||
pimple.getOrDefault("momentumPredictor", true);
|
||||
|
||||
pimple.readIfPresent("frozenFlow", frozenFlowFluid[i]);
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
fvMesh& mesh = fluidRegions[i];
|
||||
|
||||
CombustionModel<rhoReactionThermo>& reaction = reactionFluid[i];
|
||||
|
||||
rhoReactionThermo& thermo = reaction.thermo();
|
||||
|
||||
@ -49,11 +49,11 @@ if (adjustTimeStep)
|
||||
(
|
||||
min
|
||||
(
|
||||
min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaTValue(),
|
||||
min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaT().value(),
|
||||
min(runTime.deltaTValue(), maxDeltaT)
|
||||
)
|
||||
);
|
||||
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -59,12 +59,12 @@ if (adjustTimeStep)
|
||||
(
|
||||
min
|
||||
(
|
||||
min(deltaTFluid, maxDeltaTSolid)*runTime.deltaTValue(),
|
||||
min(deltaTFluid, maxDeltaTSolid)*runTime.deltaT().value(),
|
||||
maxDeltaT
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
(
|
||||
solidRegions[i],
|
||||
thermos[i],
|
||||
coordinateSystem::typeName
|
||||
coordinateSystem::typeName_()
|
||||
)
|
||||
);
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
),
|
||||
solidRegions[i],
|
||||
dimensionedSymmTensor(tkappaByCp().dimensions(), Zero),
|
||||
fvPatchFieldBase::zeroGradientType()
|
||||
zeroGradientFvPatchSymmTensorField::typeName
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
fvMesh& mesh = solidRegions[i];
|
||||
solidThermo& thermo = thermos[i];
|
||||
|
||||
tmp<volScalarField> trho = thermo.rho();
|
||||
|
||||
@ -15,7 +15,7 @@ if (!thermo.isotropic())
|
||||
(
|
||||
mesh,
|
||||
thermo,
|
||||
coordinateSystem::typeName
|
||||
coordinateSystem::typeName_()
|
||||
);
|
||||
|
||||
tmp<volVectorField> tkappaByCp = thermo.Kappa()/thermo.Cp();
|
||||
@ -34,7 +34,7 @@ if (!thermo.isotropic())
|
||||
),
|
||||
mesh,
|
||||
dimensionedSymmTensor(tkappaByCp().dimensions(), Zero),
|
||||
fvPatchFieldBase::zeroGradientType()
|
||||
zeroGradientFvPatchSymmTensorField::typeName
|
||||
)
|
||||
);
|
||||
volSymmTensorField& aniAlpha = *taniAlpha;
|
||||
|
||||
@ -44,7 +44,7 @@ IOobject turbulencePropertiesHeader
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
IOobject::NO_REGISTER
|
||||
false
|
||||
);
|
||||
|
||||
if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(false))
|
||||
|
||||
@ -89,10 +89,17 @@ void Foam::adjointOutletPressureFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>("phi");
|
||||
const auto& phiap = patch().lookupPatchField<surfaceScalarField>("phia");
|
||||
const auto& Up = patch().lookupPatchField<volVectorField>("U");
|
||||
const auto& Uap = patch().lookupPatchField<volVectorField>("Ua");
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>("phi");
|
||||
|
||||
const fvsPatchField<scalar>& phiap =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>("phia");
|
||||
|
||||
const fvPatchField<vector>& Up =
|
||||
patch().lookupPatchField<volVectorField, vector>("U");
|
||||
|
||||
const fvPatchField<vector>& Uap =
|
||||
patch().lookupPatchField<volVectorField, vector>("Ua");
|
||||
|
||||
operator==((phiap/patch().magSf() - 1.0)*phip/patch().magSf() + (Up & Uap));
|
||||
|
||||
@ -102,8 +109,8 @@ void Foam::adjointOutletPressureFvPatchScalarField::updateCoeffs()
|
||||
|
||||
void Foam::adjointOutletPressureFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<scalar>::write(os);
|
||||
fvPatchField<scalar>::writeValueEntry(os);
|
||||
fvPatchScalarField::write(os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -90,8 +90,11 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& phiap = patch().lookupPatchField<surfaceScalarField>("phia");
|
||||
const auto& Up = patch().lookupPatchField<volVectorField>("U");
|
||||
const fvsPatchField<scalar>& phiap =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>("phia");
|
||||
|
||||
const fvPatchField<vector>& Up =
|
||||
patch().lookupPatchField<volVectorField, vector>("U");
|
||||
|
||||
scalarField Un(mag(patch().nf() & Up));
|
||||
vectorField UtHat((Up - patch().nf()*Un)/(Un + SMALL));
|
||||
@ -107,8 +110,8 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs()
|
||||
|
||||
void Foam::adjointOutletVelocityFvPatchVectorField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<vector>::write(os);
|
||||
fvPatchField<vector>::writeValueEntry(os);
|
||||
fvPatchVectorField::write(os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -37,10 +37,7 @@ scalar meanCoNum = 0.0;
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
{
|
||||
surfaceScalarField phiMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask + interpolatedCells)
|
||||
);
|
||||
surfaceScalarField phiMask(localMin<scalar>(mesh).interpolate(cellMask));
|
||||
|
||||
scalarField sumPhi(fvc::surfaceSum(mag(phiMask*phi))().internalField());
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
// Solve the Momentum equation
|
||||
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
tmp<fvVectorMatrix> tUEqn
|
||||
|
||||
@ -24,7 +24,7 @@ if (mesh.changing())
|
||||
wordList pcorrTypes
|
||||
(
|
||||
p.boundaryField().size(),
|
||||
fvPatchFieldBase::zeroGradientType()
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
// Set BCs of pcorr to fixed-value for patches at which p is fixed
|
||||
@ -94,7 +94,7 @@ if (mesh.changing())
|
||||
{
|
||||
if (refCells[zoneId] != -1)
|
||||
{
|
||||
validCells.push_back(refCells[zoneId]);
|
||||
validCells.append(refCells[zoneId]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
#include "createTimeControls.H"
|
||||
|
||||
bool correctPhi
|
||||
(
|
||||
pimple.dict().getOrDefault("correctPhi", false)
|
||||
);
|
||||
|
||||
bool checkMeshCourantNo
|
||||
(
|
||||
pimple.dict().getOrDefault("checkMeshCourantNo", false)
|
||||
);
|
||||
|
||||
bool massFluxInterpolation
|
||||
(
|
||||
pimple.dict().getOrDefault("massFluxInterpolation", false)
|
||||
);
|
||||
|
||||
bool adjustFringe
|
||||
(
|
||||
pimple.dict().getOrDefault("oversetAdjustPhi", false)
|
||||
);
|
||||
|
||||
bool ddtCorr
|
||||
(
|
||||
pimple.dict().getOrDefault("ddtCorr", true)
|
||||
);
|
||||
@ -0,0 +1,273 @@
|
||||
// Interpolation used
|
||||
interpolationCellPoint<vector> UInterpolator(HbyA);
|
||||
|
||||
// Determine faces on outside of interpolated cells
|
||||
bitSet isOwnerInterpolatedFace(mesh.nInternalFaces());
|
||||
bitSet isNeiInterpolatedFace(mesh.nInternalFaces());
|
||||
|
||||
// Determine donor cells
|
||||
labelListList donorCell(mesh.nInternalFaces());
|
||||
|
||||
scalarListList weightCellCells(mesh.nInternalFaces());
|
||||
|
||||
// Interpolated HbyA faces
|
||||
vectorField UIntFaces(mesh.nInternalFaces(), Zero);
|
||||
|
||||
// Determine receptor neighbour cells
|
||||
labelList receptorNeigCell(mesh.nInternalFaces(), -1);
|
||||
|
||||
{
|
||||
const cellCellStencilObject& overlap = Stencil::New(mesh);
|
||||
const labelList& cellTypes = overlap.cellTypes();
|
||||
const labelIOList& zoneID = overlap.zoneID();
|
||||
|
||||
label nZones = gMax(zoneID)+1;
|
||||
PtrList<fvMeshSubset> meshParts(nZones);
|
||||
labelList nCellsPerZone(nZones, Zero);
|
||||
|
||||
// A mesh subset for each zone
|
||||
forAll(meshParts, zonei)
|
||||
{
|
||||
meshParts.set
|
||||
(
|
||||
zonei,
|
||||
// Select cells where the zoneID == zonei
|
||||
new fvMeshSubset(mesh, zonei, zoneID)
|
||||
);
|
||||
}
|
||||
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
{
|
||||
label ownType = cellTypes[mesh.faceOwner()[faceI]];
|
||||
label neiType = cellTypes[mesh.faceNeighbour()[faceI]];
|
||||
if
|
||||
(
|
||||
ownType == cellCellStencil::INTERPOLATED
|
||||
&& neiType == cellCellStencil::CALCULATED
|
||||
)
|
||||
{
|
||||
isOwnerInterpolatedFace.set(faceI);
|
||||
|
||||
const vector& fc = mesh.faceCentres()[faceI];
|
||||
|
||||
for (label zoneI = 0; zoneI < nZones; zoneI++)
|
||||
{
|
||||
if (zoneI != zoneID[mesh.faceOwner()[faceI]])
|
||||
{
|
||||
const fvMesh& partMesh = meshParts[zoneI].subMesh();
|
||||
const labelList& cellMap = meshParts[zoneI].cellMap();
|
||||
label cellI = partMesh.findCell(fc);
|
||||
|
||||
if (cellI != -1)
|
||||
{
|
||||
// Determine weights
|
||||
labelList stencil(partMesh.cellCells()[cellI]);
|
||||
|
||||
stencil.append(cellI);
|
||||
|
||||
label st = stencil.size();
|
||||
|
||||
donorCell[faceI].setSize(st);
|
||||
|
||||
weightCellCells[faceI].setSize(st);
|
||||
|
||||
scalarField weights(st);
|
||||
|
||||
forAll(stencil, i)
|
||||
{
|
||||
scalar d = mag
|
||||
(
|
||||
partMesh.cellCentres()[stencil[i]]
|
||||
- fc
|
||||
);
|
||||
weights[i] = 1.0/d;
|
||||
donorCell[faceI][i] = cellMap[stencil[i]];
|
||||
}
|
||||
weights /= sum(weights);
|
||||
|
||||
weightCellCells[faceI] = weights;
|
||||
|
||||
forAll(stencil, i)
|
||||
{
|
||||
UIntFaces[faceI] +=
|
||||
weightCellCells[faceI][i]
|
||||
*UInterpolator.interpolate
|
||||
(
|
||||
fc,
|
||||
donorCell[faceI][i]
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
receptorNeigCell[faceI] = mesh.faceNeighbour()[faceI];
|
||||
}
|
||||
else if
|
||||
(
|
||||
ownType == cellCellStencil::CALCULATED
|
||||
&& neiType == cellCellStencil::INTERPOLATED
|
||||
)
|
||||
{
|
||||
isNeiInterpolatedFace.set(faceI);
|
||||
|
||||
const vector& fc = mesh.faceCentres()[faceI];
|
||||
for (label zoneI = 0; zoneI < nZones; zoneI++)
|
||||
{
|
||||
if (zoneI != zoneID[mesh.faceNeighbour()[faceI]])
|
||||
{
|
||||
const fvMesh& partMesh = meshParts[zoneI].subMesh();
|
||||
const labelList& cellMap = meshParts[zoneI].cellMap();
|
||||
label cellI = partMesh.findCell(fc);
|
||||
|
||||
if (cellI != -1)
|
||||
{
|
||||
// Determine weights
|
||||
labelList stencil(partMesh.cellCells()[cellI]);
|
||||
|
||||
stencil.append(cellI);
|
||||
|
||||
label st = stencil.size();
|
||||
|
||||
donorCell[faceI].setSize(st);
|
||||
|
||||
weightCellCells[faceI].setSize(st);
|
||||
|
||||
scalarField weights(st);
|
||||
|
||||
forAll(stencil, i)
|
||||
{
|
||||
scalar d = mag
|
||||
(
|
||||
partMesh.cellCentres()[stencil[i]]
|
||||
- fc
|
||||
);
|
||||
weights[i] = 1.0/d;
|
||||
donorCell[faceI][i] = cellMap[stencil[i]];
|
||||
}
|
||||
weights /= sum(weights);
|
||||
|
||||
weightCellCells[faceI] = weights;
|
||||
|
||||
forAll(stencil, i)
|
||||
{
|
||||
UIntFaces[faceI] +=
|
||||
weightCellCells[faceI][i]
|
||||
*UInterpolator.interpolate
|
||||
(
|
||||
fc,
|
||||
donorCell[faceI][i]
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
receptorNeigCell[faceI] = mesh.faceOwner()[faceI];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// contravariant U
|
||||
vectorField U1Contrav(mesh.nInternalFaces(), Zero);
|
||||
|
||||
surfaceVectorField faceNormals(mesh.Sf()/mesh.magSf());
|
||||
|
||||
forAll(isNeiInterpolatedFace, faceI)
|
||||
{
|
||||
label cellId = -1;
|
||||
if (isNeiInterpolatedFace.test(faceI))
|
||||
{
|
||||
cellId = mesh.faceNeighbour()[faceI];
|
||||
}
|
||||
else if (isOwnerInterpolatedFace.test(faceI))
|
||||
{
|
||||
cellId = mesh.faceOwner()[faceI];
|
||||
}
|
||||
|
||||
if (cellId != -1)
|
||||
{
|
||||
const vector& n = faceNormals[faceI];
|
||||
vector n1(Zero);
|
||||
|
||||
// 2-D cases
|
||||
if (mesh.nSolutionD() == 2)
|
||||
{
|
||||
for (direction cmpt=0; cmpt<vector::nComponents; cmpt++)
|
||||
{
|
||||
if (mesh.geometricD()[cmpt] == -1)
|
||||
{
|
||||
switch (cmpt)
|
||||
{
|
||||
case vector::X:
|
||||
{
|
||||
n1 = vector(0, n.z(), -n.y());
|
||||
break;
|
||||
}
|
||||
|
||||
case vector::Y:
|
||||
{
|
||||
n1 = vector(n.z(), 0, -n.x());
|
||||
break;
|
||||
}
|
||||
|
||||
case vector::Z:
|
||||
{
|
||||
n1 = vector(n.y(), -n.x(), 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mesh.nSolutionD() == 3)
|
||||
{
|
||||
//Determine which is the primary direction
|
||||
if (mag(n.x()) > mag(n.y()) && mag(n.x()) > mag(n.z()))
|
||||
{
|
||||
n1 = vector(n.y(), -n.x(), 0);
|
||||
}
|
||||
else if (mag(n.y()) > mag(n.z()))
|
||||
{
|
||||
n1 = vector(0, n.z(), -n.y());
|
||||
}
|
||||
else
|
||||
{
|
||||
n1 = vector(-n.z(), 0, n.x());
|
||||
}
|
||||
}
|
||||
n1.normalise();
|
||||
|
||||
const vector n2 = normalised(n ^ n1);
|
||||
|
||||
tensor rot =
|
||||
tensor
|
||||
(
|
||||
n.x() ,n.y(), n.z(),
|
||||
n1.x() ,n1.y(), n1.z(),
|
||||
n2.x() ,n2.y(), n2.z()
|
||||
);
|
||||
|
||||
// tensor rot =
|
||||
// tensor
|
||||
// (
|
||||
// n & x ,n & y, n & z,
|
||||
// n1 & x ,n1 & y, n1 & z,
|
||||
// n2 & x ,n2 & y, n2 & z
|
||||
// );
|
||||
|
||||
U1Contrav[faceI].x() =
|
||||
2*transform(rot, UIntFaces[faceI]).x()
|
||||
- transform(rot, HbyA[receptorNeigCell[faceI]]).x();
|
||||
|
||||
U1Contrav[faceI].y() = transform(rot, HbyA[cellId]).y();
|
||||
|
||||
U1Contrav[faceI].z() = transform(rot, HbyA[cellId]).z();
|
||||
|
||||
HbyA[cellId] = transform(inv(rot), U1Contrav[faceI]);
|
||||
}
|
||||
}
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -46,9 +46,12 @@ Description
|
||||
#include "fvOptions.H"
|
||||
|
||||
#include "cellCellStencilObject.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "localMin.H"
|
||||
#include "interpolationCellPoint.H"
|
||||
#include "transform.H"
|
||||
#include "fvMeshSubset.H"
|
||||
#include "oversetAdjustPhi.H"
|
||||
#include "oversetPatchPhiErr.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -65,9 +68,10 @@ int main(int argc, char *argv[])
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
#include "createDyMControls.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "createFields.H"
|
||||
#include "createUf.H"
|
||||
#include "createMRF.H"
|
||||
@ -84,9 +88,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readDyMControls.H"
|
||||
#include "readOversetDyMControls.H"
|
||||
|
||||
#include "readControls.H"
|
||||
#include "CourantNo.H"
|
||||
|
||||
#include "setDeltaT.H"
|
||||
@ -95,20 +97,45 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
mesh.update();
|
||||
bool changed = mesh.update();
|
||||
|
||||
if (mesh.changing())
|
||||
if (changed)
|
||||
{
|
||||
#include "setCellMask.H"
|
||||
#include "setInterpolatedCells.H"
|
||||
#include "correctPhiFaceMask.H"
|
||||
|
||||
fvc::makeRelative(phi, U);
|
||||
surfaceScalarField faceMaskOld
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
||||
);
|
||||
|
||||
if (checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
// Zero Uf on old faceMask (H-I)
|
||||
Uf *= faceMaskOld;
|
||||
// Update Uf and phi on new C-I faces
|
||||
Uf += (1-faceMaskOld)*fvc::interpolate(U);
|
||||
phi = mesh.Sf() & Uf;
|
||||
|
||||
// Zero phi on current H-I
|
||||
surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
phi *= faceMask;
|
||||
}
|
||||
|
||||
|
||||
if (mesh.changing() && correctPhi)
|
||||
{
|
||||
// Calculate absolute flux from the mapped surface velocity
|
||||
#include "correctPhi.H"
|
||||
}
|
||||
|
||||
// Make the flux relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
|
||||
@ -1,11 +1,36 @@
|
||||
// Option 1: interpolate rAU, do not block out rAU on blocked cells
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
mesh.interpolate(rAU);
|
||||
|
||||
// Option 2: do not interpolate rAU but block out rAU
|
||||
//surfaceScalarField rAUf("rAUf", fvc::interpolate(blockedCells*rAU));
|
||||
|
||||
|
||||
// Option 3: do not interpolate rAU but zero out rAUf on faces on holes
|
||||
// But what about:
|
||||
//
|
||||
// H
|
||||
// H I C C C C
|
||||
// H
|
||||
//
|
||||
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||
volVectorField H("H", UEqn.H());
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = constrainHbyA(rAU*H, U, p);
|
||||
|
||||
if (massFluxInterpolation)
|
||||
{
|
||||
#include "interpolatedFaces.H"
|
||||
}
|
||||
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
H.write();
|
||||
rAU.write();
|
||||
HbyA.write();
|
||||
}
|
||||
|
||||
if (pimple.nCorrPISO() <= 1)
|
||||
{
|
||||
tUEqn.clear();
|
||||
@ -13,16 +38,33 @@ if (pimple.nCorrPISO() <= 1)
|
||||
|
||||
phiHbyA = fvc::flux(HbyA);
|
||||
|
||||
if (ddtCorr)
|
||||
{
|
||||
surfaceScalarField faceMaskOld
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
||||
);
|
||||
phiHbyA += rAUf*faceMaskOld*fvc::ddtCorr(U, Uf);
|
||||
}
|
||||
|
||||
MRF.makeRelative(phiHbyA);
|
||||
|
||||
// WIP
|
||||
if (p.needReference())
|
||||
{
|
||||
fvc::makeRelative(phiHbyA, U);
|
||||
adjustPhi(phiHbyA, U, p);
|
||||
fvc::makeAbsolute(phiHbyA, U);
|
||||
}
|
||||
|
||||
|
||||
if (adjustFringe)
|
||||
{
|
||||
fvc::makeRelative(phiHbyA, U);
|
||||
oversetAdjustPhi(phiHbyA, U, zoneIdMass);
|
||||
oversetAdjustPhi(phiHbyA, U);
|
||||
fvc::makeAbsolute(phiHbyA, U);
|
||||
}
|
||||
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
@ -37,26 +79,27 @@ while (pimple.correctNonOrthogonal())
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phiHbyA - pEqn.flux();
|
||||
pEqn.relax();
|
||||
U =
|
||||
cellMask*
|
||||
(
|
||||
HbyA
|
||||
- rAU*fvc::reconstruct((pEqn.flux())/rAUf)
|
||||
);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
|
||||
if (oversetPatchErrOutput)
|
||||
{
|
||||
oversetPatchPhiErr(pEqn, phiHbyA);
|
||||
// option 2:
|
||||
// rAUf*fvc::snGrad(p)*mesh.magSf();
|
||||
}
|
||||
}
|
||||
|
||||
// Excludes error in interpolated/hole cells
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
// Explicitly relax pressure for momentum corrector
|
||||
p.relax();
|
||||
volVectorField gradP(fvc::grad(p));
|
||||
|
||||
// Option 2: zero out velocity on blocked out cells
|
||||
//U = HbyA - rAU*cellMask*gradP;
|
||||
// Option 3: zero out velocity on blocked out cells
|
||||
// This is needed for the scalar Eq (k,epsilon, etc)
|
||||
// which can use U as source term
|
||||
U = cellMask*(HbyA - rAU*gradP);
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
fvOptions.correct(U);
|
||||
|
||||
{
|
||||
Uf = fvc::interpolate(U);
|
||||
@ -66,4 +109,9 @@ while (pimple.correctNonOrthogonal())
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
phi *= faceMask;
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
#include "readTimeControls.H"
|
||||
|
||||
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
|
||||
|
||||
checkMeshCourantNo = pimple.dict().getOrDefault("checkMeshCourantNo", false);
|
||||
|
||||
massFluxInterpolation =
|
||||
pimple.dict().getOrDefault("massFluxInterpolation", false);
|
||||
|
||||
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);
|
||||
@ -24,3 +24,7 @@ bool adjustFringe
|
||||
(
|
||||
simple.dict().getOrDefault("oversetAdjustPhi", false)
|
||||
);
|
||||
bool massFluxInterpolation
|
||||
(
|
||||
simple.dict().getOrDefault("massFluxInterpolation", false)
|
||||
);
|
||||
|
||||
@ -1,10 +1,18 @@
|
||||
{
|
||||
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("rAUf", faceMask*fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
|
||||
|
||||
//mesh.interpolate(HbyA);
|
||||
if (massFluxInterpolation)
|
||||
{
|
||||
#include "interpolatedFaces.H"
|
||||
}
|
||||
|
||||
tUEqn.clear();
|
||||
|
||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
|
||||
|
||||
@ -130,7 +130,7 @@ int main(int argc, char *argv[])
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector(cloudSU.dimensions()/dimVolume, Zero),
|
||||
fvPatchFieldBase::zeroGradientType()
|
||||
zeroGradientFvPatchVectorField::typeName
|
||||
);
|
||||
|
||||
cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V();
|
||||
|
||||
@ -111,7 +111,7 @@ int main(int argc, char *argv[])
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector(cloudSU.dimensions()/dimVolume, Zero),
|
||||
fvPatchFieldBase::zeroGradientType()
|
||||
zeroGradientFvPatchVectorField::typeName
|
||||
);
|
||||
|
||||
cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V();
|
||||
|
||||
@ -40,11 +40,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.clamp_min(0);
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].clamp_min(0);
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
|
||||
@ -41,11 +41,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.clamp_min(0);
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].clamp_min(0);
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ IOobject io
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
IOobject::NO_REGISTER
|
||||
false
|
||||
);
|
||||
|
||||
if (io.typeHeaderOk<IOdictionary>())
|
||||
@ -32,4 +32,4 @@ if (io.typeHeaderOk<IOdictionary>())
|
||||
);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
||||
@ -38,11 +38,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.clamp_min(0);
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].clamp_min(0);
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
|
||||
@ -38,11 +38,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.clamp_min(0);
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].clamp_min(0);
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
|
||||
@ -39,11 +39,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.clamp_min(0);
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].clamp_min(0);
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ int main(int argc, char *argv[])
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector(cloudSU.dimensions()/dimVolume, Zero),
|
||||
fvPatchFieldBase::zeroGradientType()
|
||||
zeroGradientFvPatchVectorField::typeName
|
||||
);
|
||||
|
||||
cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V();
|
||||
|
||||
@ -64,7 +64,8 @@ volScalarField mu
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
mixture.mu()
|
||||
mixture.mu(),
|
||||
calculatedFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
|
||||
@ -138,7 +139,7 @@ volScalarField alphac
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimless, Zero),
|
||||
fvPatchFieldBase::zeroGradientType()
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
alphac.oldTime();
|
||||
|
||||
|
||||
@ -1,5 +1,14 @@
|
||||
{
|
||||
alphav = clamp((rho - rholSat)/(rhovSat - rholSat), zero_one{});
|
||||
alphav =
|
||||
max
|
||||
(
|
||||
min
|
||||
(
|
||||
(rho - rholSat)/(rhovSat - rholSat),
|
||||
scalar(1)
|
||||
),
|
||||
scalar(0)
|
||||
);
|
||||
alphal = 1.0 - alphav;
|
||||
|
||||
Info<< "max-min alphav: " << max(alphav).value()
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
wordList pcorrTypes
|
||||
(
|
||||
p.boundaryField().size(),
|
||||
fvPatchFieldBase::zeroGradientType()
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
for (label i=0; i<p.boundaryField().size(); i++)
|
||||
|
||||
@ -86,7 +86,6 @@ VoFPatchTransfer::VoFPatchTransfer
|
||||
wordRes patchNames;
|
||||
if (coeffDict_.readIfPresent("patches", patchNames))
|
||||
{
|
||||
// Can also use pbm.indices(), but no warnings...
|
||||
patchIDs_ = pbm.patchSet(patchNames).sortedToc();
|
||||
|
||||
Info<< " applying to " << patchIDs_.size() << " patches:" << nl;
|
||||
|
||||
@ -140,7 +140,7 @@ Foam::fv::VoFSolidificationMeltingSource::VoFSolidificationMeltingSource
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimless, Zero),
|
||||
fvPatchFieldBase::zeroGradientType()
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
),
|
||||
curTimeIndex_(-1)
|
||||
{
|
||||
|
||||
@ -129,5 +129,10 @@ compressibleInterPhaseTransportModel turbulence
|
||||
// Mask field for zeroing out contributions on hole cells
|
||||
#include "createCellMask.H"
|
||||
|
||||
surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
|
||||
// Create bool field with interpolated cells
|
||||
#include "createInterpolatedCells.H"
|
||||
|
||||
@ -80,6 +80,9 @@ int main(int argc, char *argv[])
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "createTimeControls.H"
|
||||
#include "createDyMControls.H"
|
||||
#include "createFields.H"
|
||||
|
||||
@ -106,7 +109,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readDyMControls.H"
|
||||
#include "readControls.H"
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
@ -151,10 +154,40 @@ int main(int argc, char *argv[])
|
||||
// Update cellMask field for blocking out hole cells
|
||||
#include "setCellMask.H"
|
||||
#include "setInterpolatedCells.H"
|
||||
#include "correctPhiFaceMask.H"
|
||||
|
||||
faceMask =
|
||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime());
|
||||
|
||||
// Zero Uf on old faceMask (H-I)
|
||||
Uf *= faceMask;
|
||||
|
||||
const surfaceVectorField Uint(fvc::interpolate(U));
|
||||
// Update Uf and phi on new C-I faces
|
||||
Uf += (1-faceMask)*Uint;
|
||||
|
||||
// Update Uf boundary
|
||||
forAll(Uf.boundaryField(), patchI)
|
||||
{
|
||||
Uf.boundaryFieldRef()[patchI] =
|
||||
Uint.boundaryField()[patchI];
|
||||
}
|
||||
|
||||
phi = mesh.Sf() & Uf;
|
||||
|
||||
// Correct phi on individual regions
|
||||
if (correctPhi)
|
||||
{
|
||||
#include "correctPhi.H"
|
||||
}
|
||||
|
||||
mixture.correct();
|
||||
|
||||
// Zero phi on current H-I
|
||||
faceMask = localMin<scalar>(mesh).interpolate(cellMask);
|
||||
|
||||
phi *= faceMask;
|
||||
U *= cellMask;
|
||||
|
||||
// Make the flux relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
@ -169,6 +202,10 @@ int main(int argc, char *argv[])
|
||||
#include "alphaControls.H"
|
||||
#include "compressibleAlphaEqnSubCycle.H"
|
||||
|
||||
const surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
rhoPhi *= faceMask;
|
||||
|
||||
turbulence.correctPhasePhi();
|
||||
|
||||
@ -10,6 +10,19 @@
|
||||
fvc::flux(HbyA)
|
||||
);
|
||||
|
||||
if (ddtCorr)
|
||||
{
|
||||
surfaceScalarField faceMaskOld
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
||||
);
|
||||
phiHbyA +=
|
||||
MRF.zeroFilter
|
||||
(
|
||||
fvc::interpolate(rho*rAU)*faceMaskOld*fvc::ddtCorr(U, Uf)
|
||||
);
|
||||
}
|
||||
|
||||
MRF.makeRelative(phiHbyA);
|
||||
|
||||
surfaceScalarField phig
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user