mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -70,6 +70,8 @@ int main(int argc, char *argv[])
|
|||||||
+ turbulence->divDevReff(U)
|
+ turbulence->divDevReff(U)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
UEqn.relax();
|
||||||
|
|
||||||
if (momentumPredictor)
|
if (momentumPredictor)
|
||||||
{
|
{
|
||||||
solve(UEqn == -fvc::grad(p));
|
solve(UEqn == -fvc::grad(p));
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
if (nOuterCorr == 1)
|
if (nOuterCorr == 1)
|
||||||
{
|
{
|
||||||
p =
|
p =
|
||||||
(
|
(
|
||||||
rho
|
rho
|
||||||
- (1.0 - gamma)*rhol0
|
- (1.0 - gamma)*rhol0
|
||||||
@ -37,7 +37,14 @@
|
|||||||
- fvm::laplacian(rUAf, p)
|
- fvm::laplacian(rUAf, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.solve();
|
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
|
||||||
|
{
|
||||||
|
pEqn.solve(mesh.solver(p.name() + "Final"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pEqn.solve(mesh.solver(p.name()));
|
||||||
|
}
|
||||||
|
|
||||||
if (nonOrth == nNonOrthCorr)
|
if (nonOrth == nNonOrthCorr)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,13 +1,16 @@
|
|||||||
surfaceScalarField muf =
|
surfaceScalarField muEff
|
||||||
|
(
|
||||||
|
"muEff",
|
||||||
twoPhaseProperties.muf()
|
twoPhaseProperties.muf()
|
||||||
+ fvc::interpolate(rho*turbulence->nut());
|
+ fvc::interpolate(rho*turbulence->nut())
|
||||||
|
);
|
||||||
|
|
||||||
fvVectorMatrix UEqn
|
fvVectorMatrix UEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(rho, U)
|
fvm::ddt(rho, U)
|
||||||
+ fvm::div(rhoPhi, U)
|
+ fvm::div(rhoPhi, U)
|
||||||
- fvm::laplacian(muf, U)
|
- fvm::laplacian(muEff, U)
|
||||||
- (fvc::grad(U) & fvc::grad(muf))
|
- (fvc::grad(U) & fvc::grad(muEff))
|
||||||
//- fvc::div(muf*(mesh.Sf() & fvc::interpolate(fvc::grad(U)().T())))
|
//- fvc::div(muf*(mesh.Sf() & fvc::interpolate(fvc::grad(U)().T())))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,9 @@
|
|||||||
surfaceScalarField phic = mag(phi/mesh.magSf());
|
surfaceScalarField phic = mag(phi/mesh.magSf());
|
||||||
phic = min(interface.cAlpha()*phic, max(phic));
|
phic = min(interface.cAlpha()*phic, max(phic));
|
||||||
|
|
||||||
|
fvc::makeAbsolute(phi, U);
|
||||||
volScalarField divU = fvc::div(phi);
|
volScalarField divU = fvc::div(phi);
|
||||||
|
fvc::makeRelative(phi, U);
|
||||||
|
|
||||||
if (nAlphaSubCycles > 1)
|
if (nAlphaSubCycles > 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
- ghf*fvc::snGrad(rho)
|
- ghf*fvc::snGrad(rho)
|
||||||
)*rUAf*mesh.magSf();
|
)*rUAf*mesh.magSf();
|
||||||
|
|
||||||
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
{
|
{
|
||||||
fvScalarMatrix pdEqnIncomp
|
fvScalarMatrix pdEqnIncomp
|
||||||
(
|
(
|
||||||
@ -38,15 +38,36 @@
|
|||||||
- fvm::laplacian(rUAf, pd)
|
- fvm::laplacian(rUAf, pd)
|
||||||
);
|
);
|
||||||
|
|
||||||
solve
|
if
|
||||||
(
|
(
|
||||||
|
oCorr == nOuterCorr-1
|
||||||
|
&& corr == nCorr-1
|
||||||
|
&& nonOrth == nNonOrthCorr
|
||||||
|
)
|
||||||
|
{
|
||||||
|
solve
|
||||||
(
|
(
|
||||||
max(alpha1, scalar(0))*(psi1/rho1)
|
(
|
||||||
+ max(alpha2, scalar(0))*(psi2/rho2)
|
max(alpha1, scalar(0))*(psi1/rho1)
|
||||||
)
|
+ max(alpha2, scalar(0))*(psi2/rho2)
|
||||||
*pdEqnComp()
|
)
|
||||||
+ pdEqnIncomp
|
*pdEqnComp()
|
||||||
);
|
+ pdEqnIncomp,
|
||||||
|
mesh.solver(pd.name() + "Final")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
solve
|
||||||
|
(
|
||||||
|
(
|
||||||
|
max(alpha1, scalar(0))*(psi1/rho1)
|
||||||
|
+ max(alpha2, scalar(0))*(psi2/rho2)
|
||||||
|
)
|
||||||
|
*pdEqnComp()
|
||||||
|
+ pdEqnIncomp
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (nonOrth == nNonOrthCorr)
|
if (nonOrth == nNonOrthCorr)
|
||||||
{
|
{
|
||||||
@ -62,7 +83,8 @@
|
|||||||
|
|
||||||
p = max
|
p = max
|
||||||
(
|
(
|
||||||
(pd + gh*(alpha1*rho10 + alpha2*rho20))/(1.0 - gh*(alpha1*psi1 + alpha2*psi2)),
|
(pd + gh*(alpha1*rho10 + alpha2*rho20))
|
||||||
|
/(1.0 - gh*(alpha1*psi1 + alpha2*psi2)),
|
||||||
pMin
|
pMin
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,18 @@
|
|||||||
surfaceScalarField muf =
|
surfaceScalarField muEff
|
||||||
|
(
|
||||||
|
"muEff",
|
||||||
twoPhaseProperties->muf()
|
twoPhaseProperties->muf()
|
||||||
+ fvc::interpolate(rho*turbulence->nut());
|
+ fvc::interpolate(rho*turbulence->nut())
|
||||||
|
);
|
||||||
|
|
||||||
fvVectorMatrix UEqn
|
fvVectorMatrix UEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(rho, U)
|
fvm::ddt(rho, U)
|
||||||
+ fvm::div(rhoPhi, U)
|
+ fvm::div(rhoPhi, U)
|
||||||
- fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U)
|
- fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U)
|
||||||
- fvm::laplacian(muf, U)
|
- fvm::laplacian(muEff, U)
|
||||||
- (fvc::grad(U) & fvc::grad(muf))
|
- (fvc::grad(U) & fvc::grad(muEff))
|
||||||
//- fvc::div(muf*(fvc::interpolate(dev2(fvc::grad(U))) & mesh.Sf()))
|
//- fvc::div(muEff*(fvc::interpolate(dev2(fvc::grad(U))) & mesh.Sf()))
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
cd ${0%/*} || exit 1 # run from this directory
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# force update of Foam::FOAMversion string (git tag or $WM_PROJECT_VERSION)
|
# update Foam::FOAMversion string if required
|
||||||
/bin/rm -f OpenFOAM/Make/$WM_OPTIONS/global.? 2>/dev/null
|
wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/$WM_OPTIONS/global.? 2>/dev/null
|
||||||
|
|
||||||
wmakeLnInclude -f OpenFOAM
|
wmakeLnInclude -f OpenFOAM
|
||||||
wmakeLnInclude -f OSspecific/$WM_OS
|
wmakeLnInclude -f OSspecific/$WM_OS
|
||||||
|
|||||||
@ -23,20 +23,19 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Define the globals used in the FOAM library. It is important that these
|
Define the globals used in the OpenFOAM library.
|
||||||
are constructed in the appropriate order to avoid the use of unconstructed
|
It is important that these are constructed in the appropriate order to
|
||||||
data in the global namespace.
|
avoid the use of unconstructed data in the global namespace.
|
||||||
|
|
||||||
This file has the extension .ver to force it to be parsed by the script
|
This file has the extension .Cver to trigger a Makefile rule that converts
|
||||||
which converts WM_PROJECT_VERSION into the appropriate version number
|
WM_PROJECT_VERSION into the appropriate version string.
|
||||||
string.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
#include "foamVersion.H"
|
#include "foamVersion.H"
|
||||||
|
|
||||||
const char* const Foam::FOAMversion = WM_PROJECT_VERSION;
|
const char* const Foam::FOAMversion = "WM_PROJECT_VERSION";
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
// Setup an error handler for the global new operator
|
// Setup an error handler for the global new operator
|
||||||
@ -51,7 +50,7 @@ const char* const Foam::FOAMversion = WM_PROJECT_VERSION;
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#include "JobInfo.H"
|
#include "JobInfo.H"
|
||||||
bool Foam::JobInfo::constructed = false;
|
bool Foam::JobInfo::constructed(false);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
// Global error definitions (initialised by construction)
|
// Global error definitions (initialised by construction)
|
||||||
|
|||||||
@ -175,9 +175,8 @@ void turbulentInletFvPatchField<Type>::updateCoeffs()
|
|||||||
ranGen_.randomise(randomField[facei]);
|
ranGen_.randomise(randomField[facei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Correction-factor proposed by Yi Wang to compensate for the loss
|
// Correction-factor to compensate for the loss of RMS fluctuation
|
||||||
// of RMS fluctuation due to the temporal correlation introduced by
|
// due to the temporal correlation introduced by the alpha parameter.
|
||||||
// the alpha parameter.
|
|
||||||
scalar rmsCorr = sqrt(12*(2*alpha_ - sqr(alpha_)))/alpha_;
|
scalar rmsCorr = sqrt(12*(2*alpha_ - sqr(alpha_)))/alpha_;
|
||||||
|
|
||||||
patchField =
|
patchField =
|
||||||
@ -206,6 +205,7 @@ void turbulentInletFvPatchField<Type>::write(Ostream& os) const
|
|||||||
os.writeKeyword("fluctuationScale")
|
os.writeKeyword("fluctuationScale")
|
||||||
<< fluctuationScale_ << token::END_STATEMENT << nl;
|
<< fluctuationScale_ << token::END_STATEMENT << nl;
|
||||||
referenceField_.writeEntry("referenceField", os);
|
referenceField_.writeEntry("referenceField", os);
|
||||||
|
os.writeKeyword("alpha") << alpha_ << token::END_STATEMENT << nl;
|
||||||
this->writeEntry("value", os);
|
this->writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,6 @@ class turbulentInletFvPatchField
|
|||||||
:
|
:
|
||||||
public fixedValueFvPatchField<Type>
|
public fixedValueFvPatchField<Type>
|
||||||
{
|
{
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
Random ranGen_;
|
Random ranGen_;
|
||||||
|
|||||||
@ -35,65 +35,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ParcelType>
|
|
||||||
void Foam::KinematicCloud<ParcelType>::setInjectorCellAndPosition
|
|
||||||
(
|
|
||||||
label& pCell,
|
|
||||||
vector& pPosition
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const vector originalPosition = pPosition;
|
|
||||||
|
|
||||||
bool foundCell = false;
|
|
||||||
|
|
||||||
pCell = mesh_.findCell(pPosition);
|
|
||||||
|
|
||||||
if (pCell >= 0)
|
|
||||||
{
|
|
||||||
const vector& C = mesh_.C()[pCell];
|
|
||||||
pPosition += 1.0e-6*(C - pPosition);
|
|
||||||
|
|
||||||
foundCell = mesh_.pointInCell
|
|
||||||
(
|
|
||||||
pPosition,
|
|
||||||
pCell
|
|
||||||
);
|
|
||||||
}
|
|
||||||
reduce(foundCell, orOp<bool>());
|
|
||||||
|
|
||||||
// Last chance - find nearest cell and try that one
|
|
||||||
// - the point is probably on an edge
|
|
||||||
if (!foundCell)
|
|
||||||
{
|
|
||||||
pCell = mesh_.findNearestCell(pPosition);
|
|
||||||
|
|
||||||
if (pCell >= 0)
|
|
||||||
{
|
|
||||||
const vector& C = mesh_.C()[pCell];
|
|
||||||
pPosition += 1.0e-6*(C - pPosition);
|
|
||||||
|
|
||||||
foundCell = mesh_.pointInCell
|
|
||||||
(
|
|
||||||
pPosition,
|
|
||||||
pCell
|
|
||||||
);
|
|
||||||
}
|
|
||||||
reduce(foundCell, orOp<bool>());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!foundCell)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"void KinematicCloud<ParcelType>::findInjectorCell"
|
|
||||||
"(label&, vector&)"
|
|
||||||
)<< "Cannot find parcel injection cell. "
|
|
||||||
<< "Parcel position = " << originalPosition << nl
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
Foam::scalar Foam::KinematicCloud<ParcelType>::setNumberOfParticles
|
Foam::scalar Foam::KinematicCloud<ParcelType>::setNumberOfParticles
|
||||||
(
|
(
|
||||||
@ -324,7 +265,7 @@ void Foam::KinematicCloud<ParcelType>::evolve()
|
|||||||
g_.value()
|
g_.value()
|
||||||
);
|
);
|
||||||
|
|
||||||
inject(td);
|
inject();
|
||||||
|
|
||||||
if (coupled_)
|
if (coupled_)
|
||||||
{
|
{
|
||||||
@ -336,15 +277,11 @@ void Foam::KinematicCloud<ParcelType>::evolve()
|
|||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
template<class TrackingData>
|
void Foam::KinematicCloud<ParcelType>::inject()
|
||||||
void Foam::KinematicCloud<ParcelType>::inject
|
|
||||||
(
|
|
||||||
TrackingData& td
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
scalar time = this->db().time().value();
|
scalar time = this->db().time().value();
|
||||||
|
|
||||||
scalar pRho = td.constProps().rho0();
|
scalar pRho = constProps_.rho0();
|
||||||
|
|
||||||
this->injection().prepareForNextTimeStep(time0_, time);
|
this->injection().prepareForNextTimeStep(time0_, time);
|
||||||
|
|
||||||
@ -419,21 +356,21 @@ void Foam::KinematicCloud<ParcelType>::inject
|
|||||||
|
|
||||||
// Determine the injection cell
|
// Determine the injection cell
|
||||||
label pCell = -1;
|
label pCell = -1;
|
||||||
setInjectorCellAndPosition(pCell, pPosition);
|
this->injection().findInjectorCellAndPosition(pCell, pPosition);
|
||||||
|
|
||||||
if (pCell >= 0)
|
if (pCell >= 0)
|
||||||
{
|
{
|
||||||
// construct the parcel that is to be injected
|
// construct the parcel that is to be injected
|
||||||
ParcelType* pPtr = new ParcelType
|
ParcelType* pPtr = new ParcelType
|
||||||
(
|
(
|
||||||
td.cloud(),
|
*this,
|
||||||
parcelTypeId_,
|
parcelTypeId_,
|
||||||
pPosition,
|
pPosition,
|
||||||
pCell,
|
pCell,
|
||||||
pDiameter,
|
pDiameter,
|
||||||
pU,
|
pU,
|
||||||
pNumberOfParticles,
|
pNumberOfParticles,
|
||||||
td.constProps()
|
constProps_
|
||||||
);
|
);
|
||||||
|
|
||||||
scalar dt = time - timeInj;
|
scalar dt = time - timeInj;
|
||||||
@ -441,7 +378,7 @@ void Foam::KinematicCloud<ParcelType>::inject
|
|||||||
pPtr->stepFraction() = (this->db().time().deltaT().value() - dt)
|
pPtr->stepFraction() = (this->db().time().deltaT().value() - dt)
|
||||||
/this->time().deltaT().value();
|
/this->time().deltaT().value();
|
||||||
|
|
||||||
this->injectParcel(td, pPtr);
|
this->injectParcel(pPtr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,12 +392,7 @@ void Foam::KinematicCloud<ParcelType>::inject
|
|||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
template<class TrackingData>
|
void Foam::KinematicCloud<ParcelType>::injectParcel(ParcelType* p)
|
||||||
void Foam::KinematicCloud<ParcelType>::injectParcel
|
|
||||||
(
|
|
||||||
TrackingData& td,
|
|
||||||
ParcelType* p
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
addParticle(p);
|
addParticle(p);
|
||||||
nParcelsAdded_++;
|
nParcelsAdded_++;
|
||||||
|
|||||||
@ -223,13 +223,6 @@ protected:
|
|||||||
|
|
||||||
// Protected member functions
|
// Protected member functions
|
||||||
|
|
||||||
//- Set parcel position and cell into which parcel is introduced
|
|
||||||
void setInjectorCellAndPosition
|
|
||||||
(
|
|
||||||
label& pCell,
|
|
||||||
vector& pPosition
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Set the number of particles per parcel
|
//- Set the number of particles per parcel
|
||||||
scalar setNumberOfParticles
|
scalar setNumberOfParticles
|
||||||
(
|
(
|
||||||
@ -241,16 +234,10 @@ protected:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Inject more parcels
|
//- Inject more parcels
|
||||||
template<class TrackingData>
|
void inject();
|
||||||
void inject(TrackingData& td);
|
|
||||||
|
|
||||||
//- Inject parcel if it is valid - delete otherwise
|
//- Inject parcel if it is valid - delete otherwise
|
||||||
template<class TrackingData>
|
void injectParcel(ParcelType* p);
|
||||||
void injectParcel
|
|
||||||
(
|
|
||||||
TrackingData& td,
|
|
||||||
ParcelType* p
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Post-injection checks
|
//- Post-injection checks
|
||||||
void postInjectCheck();
|
void postInjectCheck();
|
||||||
|
|||||||
@ -174,7 +174,7 @@ void Foam::ReactingCloud<ParcelType>::evolve()
|
|||||||
this->g().value()
|
this->g().value()
|
||||||
);
|
);
|
||||||
|
|
||||||
inject(td);
|
inject();
|
||||||
|
|
||||||
if (this->coupled())
|
if (this->coupled())
|
||||||
{
|
{
|
||||||
@ -186,15 +186,11 @@ void Foam::ReactingCloud<ParcelType>::evolve()
|
|||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
template<class TrackingData>
|
void Foam::ReactingCloud<ParcelType>::inject()
|
||||||
void Foam::ReactingCloud<ParcelType>::inject
|
|
||||||
(
|
|
||||||
TrackingData& td
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
scalar time = this->db().time().value();
|
scalar time = this->db().time().value();
|
||||||
|
|
||||||
scalar pRho = td.constProps().rho0();
|
scalar pRho = this->constProps().rho0();
|
||||||
|
|
||||||
this->injection().prepareForNextTimeStep(this->time0(), time);
|
this->injection().prepareForNextTimeStep(this->time0(), time);
|
||||||
|
|
||||||
@ -269,14 +265,14 @@ void Foam::ReactingCloud<ParcelType>::inject
|
|||||||
|
|
||||||
// Determine the injection cell
|
// Determine the injection cell
|
||||||
label pCell = -1;
|
label pCell = -1;
|
||||||
this->setInjectorCellAndPosition(pCell, pPosition);
|
this->injection().findInjectorCellAndPosition(pCell, pPosition);
|
||||||
|
|
||||||
if (pCell >= 0)
|
if (pCell >= 0)
|
||||||
{
|
{
|
||||||
// construct the parcel that is to be injected
|
// construct the parcel that is to be injected
|
||||||
ParcelType* pPtr = new ParcelType
|
ParcelType* pPtr = new ParcelType
|
||||||
(
|
(
|
||||||
td.cloud(),
|
*this,
|
||||||
this->parcelTypeId(),
|
this->parcelTypeId(),
|
||||||
pPosition,
|
pPosition,
|
||||||
pCell,
|
pCell,
|
||||||
@ -287,7 +283,7 @@ void Foam::ReactingCloud<ParcelType>::inject
|
|||||||
composition().YLiquid0(),
|
composition().YLiquid0(),
|
||||||
composition().YSolid0(),
|
composition().YSolid0(),
|
||||||
composition().YMixture0(),
|
composition().YMixture0(),
|
||||||
td.constProps()
|
this->constProps()
|
||||||
);
|
);
|
||||||
|
|
||||||
scalar dt = time - timeInj;
|
scalar dt = time - timeInj;
|
||||||
@ -295,7 +291,7 @@ void Foam::ReactingCloud<ParcelType>::inject
|
|||||||
pPtr->stepFraction() = (this->db().time().deltaT().value() - dt)
|
pPtr->stepFraction() = (this->db().time().deltaT().value() - dt)
|
||||||
/this->db().time().deltaT().value();
|
/this->db().time().deltaT().value();
|
||||||
|
|
||||||
this->injectParcel(td, pPtr);
|
this->injectParcel(pPtr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -117,8 +117,7 @@ class ReactingCloud
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
//- Inject more parcels
|
//- Inject more parcels
|
||||||
template<class TrackingData>
|
void inject();
|
||||||
void inject(TrackingData& td);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -159,6 +159,57 @@ void Foam::InjectionModel<CloudType>::prepareForNextTimeStep
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
void Foam::InjectionModel<CloudType>::findInjectorCellAndPosition
|
||||||
|
(
|
||||||
|
label& cellI,
|
||||||
|
vector& position
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const vector p0 = position;
|
||||||
|
|
||||||
|
bool foundCell = false;
|
||||||
|
|
||||||
|
cellI = owner_.mesh().findCell(position);
|
||||||
|
|
||||||
|
if (cellI >= 0)
|
||||||
|
{
|
||||||
|
const vector& C = owner_.mesh().C()[cellI];
|
||||||
|
position += 1.0e-6*(C - position);
|
||||||
|
|
||||||
|
foundCell = owner_.mesh().pointInCell(position, cellI);
|
||||||
|
}
|
||||||
|
reduce(foundCell, orOp<bool>());
|
||||||
|
|
||||||
|
// Last chance - find nearest cell and try that one
|
||||||
|
// - the point is probably on an edge
|
||||||
|
if (!foundCell)
|
||||||
|
{
|
||||||
|
cellI = owner_.mesh().findNearestCell(position);
|
||||||
|
|
||||||
|
if (cellI >= 0)
|
||||||
|
{
|
||||||
|
const vector& C = owner_.mesh().C()[cellI];
|
||||||
|
position += 1.0e-6*(C - position);
|
||||||
|
|
||||||
|
foundCell = owner_.mesh().pointInCell(position, cellI);
|
||||||
|
}
|
||||||
|
reduce(foundCell, orOp<bool>());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!foundCell)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"InjectionModel<CloudType>::setInjectorCellAndPosition"
|
||||||
|
"(label&, vector&)"
|
||||||
|
)<< "Cannot find parcel injection cell. "
|
||||||
|
<< "Parcel position = " << p0 << nl
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#include "NewInjectionModel.C"
|
#include "NewInjectionModel.C"
|
||||||
|
|||||||
@ -208,6 +208,14 @@ public:
|
|||||||
|
|
||||||
// Injection geometry
|
// Injection geometry
|
||||||
|
|
||||||
|
//- Find the cell that contains the injector position
|
||||||
|
// Will modify position slightly towards the owner cell centroid
|
||||||
|
virtual void findInjectorCellAndPosition
|
||||||
|
(
|
||||||
|
label& cellI,
|
||||||
|
vector& position
|
||||||
|
);
|
||||||
|
|
||||||
//- Return the injection position
|
//- Return the injection position
|
||||||
virtual vector position
|
virtual vector position
|
||||||
(
|
(
|
||||||
|
|||||||
@ -3,10 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
wmake libo postCalc
|
wmake libo postCalc
|
||||||
wmake libso forces
|
|
||||||
wmake libso fieldAverage
|
|
||||||
wmake libso foamCalcFunctions
|
wmake libso foamCalcFunctions
|
||||||
wmake libso minMaxFields
|
|
||||||
wmake libso systemCall
|
(cd functionObjects && ./Allwmake)
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
# ----------------------------------------------------------------- end-of-file
|
||||||
|
|||||||
10
src/postProcessing/functionObjects/Allwmake
Executable file
10
src/postProcessing/functionObjects/Allwmake
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
set -x
|
||||||
|
|
||||||
|
wmake libso fieldAverage
|
||||||
|
wmake libso forces
|
||||||
|
wmake libso minMaxFields
|
||||||
|
wmake libso systemCall
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
@ -88,7 +88,7 @@ autoPtr<turbulenceModel> turbulenceModel::New
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
turbulencePropertiesDict.lookup("turbulenceModel")
|
turbulencePropertiesDict.lookup("simulationType")
|
||||||
>> turbulenceModelTypeName;
|
>> turbulenceModelTypeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
22
tutorials/buoyantFoam/hotRoom/constant/turbulenceProperties
Normal file
22
tutorials/buoyantFoam/hotRoom/constant/turbulenceProperties
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.5 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object turbulenceProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//simulationType laminar;
|
||||||
|
simulationType RASModel;
|
||||||
|
//simulationType LESModel;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -16,7 +16,9 @@ FoamFile
|
|||||||
|
|
||||||
LESModel laminar;
|
LESModel laminar;
|
||||||
|
|
||||||
delta smooth;
|
turbulence off;
|
||||||
|
|
||||||
|
delta cubeRootVol;
|
||||||
|
|
||||||
laminarCoeffs
|
laminarCoeffs
|
||||||
{
|
{
|
||||||
@ -1,15 +1,16 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: dev-09ca1eb6b56f |
|
||||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
| \\ / A nd | |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | www.OpenFOAM.org |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
{
|
{
|
||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class polyBoundaryMesh;
|
class polyBoundaryMesh;
|
||||||
|
location "constant/polyMesh";
|
||||||
object boundary;
|
object boundary;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.5 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object turbulenceProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//simulationType laminar;
|
||||||
|
//simulationType RASModel;
|
||||||
|
simulationType LESModel;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -120,7 +120,7 @@ PISO
|
|||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 1;
|
nAlphaSubCycles 1;
|
||||||
cGamma 1;
|
cAlpha 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -16,7 +16,9 @@ FoamFile
|
|||||||
|
|
||||||
LESModel laminar;
|
LESModel laminar;
|
||||||
|
|
||||||
delta smooth;
|
turbulence off;
|
||||||
|
|
||||||
|
delta cubeRootVol;
|
||||||
|
|
||||||
laminarCoeffs
|
laminarCoeffs
|
||||||
{
|
{
|
||||||
@ -1,15 +1,16 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: dev-09ca1eb6b56f |
|
||||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
| \\ / A nd | |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | www.OpenFOAM.org |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
{
|
{
|
||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class polyBoundaryMesh;
|
class polyBoundaryMesh;
|
||||||
|
location "constant/polyMesh";
|
||||||
object boundary;
|
object boundary;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.5 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object turbulenceProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//simulationType laminar;
|
||||||
|
//simulationType RASModel;
|
||||||
|
simulationType LESModel;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -120,7 +120,7 @@ PISO
|
|||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 1;
|
nAlphaSubCycles 1;
|
||||||
cGamma 1;
|
cAlpha 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -1,10 +1,10 @@
|
|||||||
.SUFFIXES: .Cver
|
.SUFFIXES: .Cver
|
||||||
|
|
||||||
#
|
#
|
||||||
# update version string
|
# update version string in C++ file and in $WM_PROJECT_DIR/.build file
|
||||||
#
|
#
|
||||||
Cvertoo = \
|
Cvertoo = \
|
||||||
sed s/WM_PROJECT_VERSION/\"$(shell wmakePrintBuild)\"/ $$SOURCE > $*.C; \
|
sed 's/WM_PROJECT_VERSION/$(shell wmakePrintBuild -update)/' $$SOURCE > $*.C; \
|
||||||
$(CC) $(c++FLAGS) -c $*.C -o $@
|
$(CC) $(c++FLAGS) -c $*.C -o $@
|
||||||
|
|
||||||
.Cver.dep:
|
.Cver.dep:
|
||||||
|
|||||||
@ -35,10 +35,15 @@ Script=${0##*/}
|
|||||||
usage() {
|
usage() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
usage: $Script
|
usage: $Script [OPTION]
|
||||||
|
options:
|
||||||
|
-check check the git head commit vs. \$WM_PROJECT_DIR/.build
|
||||||
|
(exit code 0 for no changes)
|
||||||
|
-update update the \$WM_PROJECT_DIR/.build from the git information
|
||||||
|
-version VER specify an alternative version
|
||||||
|
|
||||||
Print the version used when building the project, in this order of precedence:
|
Print the version used when building the project, in this order of precedence:
|
||||||
* git description
|
* the git head commit (prefixed with \$WM_PROJECT_VERSION)
|
||||||
* \$WM_PROJECT_DIR/.build
|
* \$WM_PROJECT_DIR/.build
|
||||||
* \$WM_PROJECT_VERSION
|
* \$WM_PROJECT_VERSION
|
||||||
|
|
||||||
@ -47,11 +52,33 @@ USAGE
|
|||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# provide immediate help
|
unset checkOnly update version
|
||||||
if [ "$1" = "-h" -o "$1" = "-help" ]
|
|
||||||
then
|
# parse options
|
||||||
usage
|
while [ "$#" -gt 0 ]
|
||||||
fi
|
do
|
||||||
|
case "$1" in
|
||||||
|
-h | -help)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
-check)
|
||||||
|
checkOnly=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-update)
|
||||||
|
update=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-version)
|
||||||
|
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
|
||||||
|
version=$2
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage "unknown option/argument: '$*'"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -61,35 +88,64 @@ fi
|
|||||||
build="$WM_PROJECT_DIR/.build"
|
build="$WM_PROJECT_DIR/.build"
|
||||||
previous=$(tail -1 $build 2>/dev/null)
|
previous=$(tail -1 $build 2>/dev/null)
|
||||||
|
|
||||||
#
|
if [ -n "$version" ]
|
||||||
# building under git
|
|
||||||
# note: could also use --abbrev=32 for maximum resolution
|
|
||||||
#
|
|
||||||
version=$(git describe --always --tags 2>/dev/null)
|
|
||||||
if [ $? -eq 0 ]
|
|
||||||
then
|
then
|
||||||
# update persistent build tag (this could be made optional or removed)
|
# specified a version - no error possible
|
||||||
if [ "$version" != "$previous" ]
|
rc=0
|
||||||
|
else
|
||||||
|
# building under git (get the head SHA1)
|
||||||
|
version=$(git show-ref --hash=12 --head refs/heads/master 2>/dev/null)
|
||||||
|
rc=$?
|
||||||
|
|
||||||
|
# prefix with WM_PROJECT_VERSION
|
||||||
|
if [ $rc -eq 0 ]
|
||||||
then
|
then
|
||||||
if [ -w "$build" -a \( -w "$WM_PROJECT_DIR" -o ! -e "$build" \) ]
|
version="${WM_PROJECT_VERSION}-$version"
|
||||||
then
|
|
||||||
echo $version >| "$build" 2>/dev/null
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# update persistent build tag if possible
|
||||||
|
if [ $rc -eq 0 -a -n "$update" -a "$version" != "$previous" ]
|
||||||
|
then
|
||||||
|
if [ -w "$build" -a \( -w "$WM_PROJECT_DIR" -o ! -e "$build" \) ]
|
||||||
|
then
|
||||||
|
echo $version >| "$build" 2>/dev/null
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# check git vs. persistent build tag - no output
|
||||||
|
if [ -n "$checkOnly" ]
|
||||||
|
then
|
||||||
|
if [ $rc -eq 0 ]
|
||||||
|
then
|
||||||
|
test "$version" = "$previous"
|
||||||
|
rc=$?
|
||||||
|
if [ $rc -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "same version as previous build"
|
||||||
|
else
|
||||||
|
echo "version changed from previous build"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "no git description found"
|
||||||
|
fi
|
||||||
|
exit $rc
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ $rc -eq 0 ]
|
||||||
|
then
|
||||||
|
# output the git information or the -version version
|
||||||
echo $version
|
echo $version
|
||||||
|
|
||||||
elif [ -n "$previous" ]
|
elif [ -n "$previous" ]
|
||||||
then
|
then
|
||||||
|
|
||||||
# use previous build tag
|
# use previous build tag
|
||||||
echo $previous
|
echo $previous
|
||||||
|
|
||||||
else
|
else
|
||||||
|
# fallback to WM_PROJECT_VERSION alone
|
||||||
# fallback to WM_PROJECT_VERSION
|
|
||||||
echo ${WM_PROJECT_VERSION:-unknown}
|
echo ${WM_PROJECT_VERSION:-unknown}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user