Lagrangian: LocalInteraction: Consistent handling of constraint types
The localInteraction model now no longer requires specification of an interaction on any constrained patch type (e.g., symmetry, cyclic, ...). Non-constrained types (patch, wall, ...) require an interaction to be specified as before and will trigger an error if this is not the case. In addition, constrained patches can be overridden by providing a 'patchType' specifier, in the same way as would be done to override a constrained boundary condition for finite volume. The filter tutorial now correctly demonstrates something unique; i.e., particles rebounding from a cyclic. It has therefore been reinstated. Resolves (properly) bug report https://bugs.openfoam.org/view.php?id=3923
This commit is contained in:
@ -57,10 +57,6 @@ RADIATION=submodels/addOns/radiation
|
||||
$(RADIATION)/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.C
|
||||
$(RADIATION)/scatter/cloudScatter/cloudScatter.C
|
||||
|
||||
PATCHINTERACTION=submodels/Momentum/PatchInteractionModel
|
||||
$(PATCHINTERACTION)/LocalInteraction/patchInteractionData.C
|
||||
$(PATCHINTERACTION)/LocalInteraction/patchInteractionDataList.C
|
||||
|
||||
MOMENTUMINJECTION=submodels/Momentum/InjectionModel
|
||||
$(MOMENTUMINJECTION)/MomentumLookupTableInjection/momentumParcelInjectionData.C
|
||||
$(MOMENTUMINJECTION)/MomentumLookupTableInjection/momentumParcelInjectionDataIO.C
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,6 +24,51 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "LocalInteraction.H"
|
||||
#include "wordAndDictionary.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
struct wordReAndDictionary
|
||||
:
|
||||
public Tuple2<wordRe, dictionary>
|
||||
{
|
||||
using Tuple2<wordRe, dictionary>::Tuple2;
|
||||
|
||||
wordReAndDictionary();
|
||||
|
||||
wordReAndDictionary(Istream& is);
|
||||
};
|
||||
|
||||
|
||||
inline Istream& operator>>(Istream& is, wordReAndDictionary& wd)
|
||||
{
|
||||
wd.first() = wordRe(is);
|
||||
dictionary d(is);
|
||||
wd.second().transfer(d);
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
inline Ostream& operator<<(Ostream& os, const wordReAndDictionary& wd)
|
||||
{
|
||||
return os << wd.first() << token::SPACE << wd.second();
|
||||
}
|
||||
|
||||
|
||||
inline wordReAndDictionary::wordReAndDictionary()
|
||||
{}
|
||||
|
||||
|
||||
inline wordReAndDictionary::wordReAndDictionary(Istream& is)
|
||||
{
|
||||
is >> *this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -35,19 +80,28 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
|
||||
)
|
||||
:
|
||||
PatchInteractionModel<CloudType>(dict, cloud, typeName),
|
||||
patchData_(cloud.mesh(), this->coeffDict()),
|
||||
nEscape_(patchData_.size(), 0),
|
||||
massEscape_(patchData_.size(), 0.0),
|
||||
nStick_(patchData_.size(), 0),
|
||||
massStick_(patchData_.size(), 0.0),
|
||||
patchInteractionTypes_
|
||||
(
|
||||
this->owner().mesh().boundaryMesh().size(),
|
||||
PatchInteractionModel<CloudType>::itOther
|
||||
),
|
||||
patchEs_(this->owner().mesh().boundaryMesh().size(), NaN),
|
||||
patchMus_(this->owner().mesh().boundaryMesh().size(), NaN),
|
||||
nEscape_(this->owner().mesh().boundaryMesh().size(), 0),
|
||||
massEscape_(this->owner().mesh().boundaryMesh().size(), scalar(0)),
|
||||
nStick_(this->owner().mesh().boundaryMesh().size(), 0),
|
||||
massStick_(this->owner().mesh().boundaryMesh().size(), scalar(0)),
|
||||
writeFields_(this->coeffDict().lookupOrDefault("writeFields", false)),
|
||||
massEscapePtr_(nullptr),
|
||||
massStickPtr_(nullptr)
|
||||
{
|
||||
const polyBoundaryMesh& patches = this->owner().mesh().boundaryMesh();
|
||||
|
||||
if (writeFields_)
|
||||
{
|
||||
word massEscapeName(this->owner().name() + ":massEscape");
|
||||
word massStickName(this->owner().name() + ":massStick");
|
||||
const word massEscapeName(this->owner().name() + ":massEscape");
|
||||
const word massStickName(this->owner().name() + ":massStick");
|
||||
|
||||
Info<< " Interaction fields will be written to " << massEscapeName
|
||||
<< " and " << massStickName << endl;
|
||||
|
||||
@ -59,24 +113,110 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
|
||||
Info<< " Interaction fields will not be written" << endl;
|
||||
}
|
||||
|
||||
// check that interactions are valid/specified
|
||||
forAll(patchData_, patchi)
|
||||
// Get the patch-settings dictionaries
|
||||
dictionary patchesDict;
|
||||
if (this->coeffDict().isDict("patches"))
|
||||
{
|
||||
const word& interactionTypeName =
|
||||
patchData_[patchi].interactionTypeName();
|
||||
const typename PatchInteractionModel<CloudType>::interactionType& it =
|
||||
this->wordToInteractionType(interactionTypeName);
|
||||
patchesDict = this->coeffDict().subDict("patches");
|
||||
}
|
||||
else
|
||||
{
|
||||
const List<wordReAndDictionary> patchNameAndDicts
|
||||
(
|
||||
this->coeffDict().lookup("patches")
|
||||
);
|
||||
|
||||
forAll(patchNameAndDicts, dicti)
|
||||
{
|
||||
patchesDict.set
|
||||
(
|
||||
keyType(string(patchNameAndDicts[dicti].first())),
|
||||
patchNameAndDicts[dicti].second()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Read the patch settings
|
||||
wordList unspecifiedNonConstraintPatches;
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const word& patchName = patches[patchi].name();
|
||||
|
||||
const bool havePatchDict = patchesDict.found(patchName);
|
||||
|
||||
const bool patchIsConstraint =
|
||||
polyPatch::constraintType(patches[patchi].type());
|
||||
|
||||
// No settings for constrained patch. No model.
|
||||
if (!havePatchDict && patchIsConstraint)
|
||||
{
|
||||
patchInteractionTypes_[patchi] =
|
||||
PatchInteractionModel<CloudType>::itNone;
|
||||
continue;
|
||||
}
|
||||
|
||||
// No settings for non-constrained patch. Error.
|
||||
if (!havePatchDict && !patchIsConstraint)
|
||||
{
|
||||
unspecifiedNonConstraintPatches.append(patches[patchi].name());
|
||||
continue;
|
||||
}
|
||||
|
||||
const dictionary& patchDict = patchesDict.subDict(patchName);
|
||||
|
||||
// Settings for constrained patch. Ignored unless "patchType" is
|
||||
// correctly specified.
|
||||
if (havePatchDict && patchIsConstraint)
|
||||
{
|
||||
if (!patchDict.found("patchType"))
|
||||
{
|
||||
patchInteractionTypes_[patchi] =
|
||||
PatchInteractionModel<CloudType>::itNone;
|
||||
continue;
|
||||
}
|
||||
|
||||
const word patchType = patchDict.lookup<word>("patchType");
|
||||
|
||||
if (patchType != patches[patchi].type())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Type " << patchType
|
||||
<< " specified for patch " << patchName
|
||||
<< " does not match the patch type "
|
||||
<< patches[patchi].type() << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
// Read and set the interaction model
|
||||
const word itName = patchDict.lookup<word>("type");
|
||||
const interactionType it = this->wordToInteractionType(itName);
|
||||
|
||||
if (it == PatchInteractionModel<CloudType>::itOther)
|
||||
{
|
||||
const word& patchName = patchData_[patchi].patchName();
|
||||
FatalErrorInFunction
|
||||
<< "Unknown patch interaction type "
|
||||
<< interactionTypeName << " for patch " << patchName
|
||||
<< ". Valid selections are:"
|
||||
<< this->PatchInteractionModel<CloudType>::interactionTypeNames_
|
||||
<< itName << " for patch " << patchName
|
||||
<< ". Valid types are:"
|
||||
<< PatchInteractionModel<CloudType>::interactionTypeNames_
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
|
||||
patchInteractionTypes_[patchi] = it;
|
||||
|
||||
if (it == PatchInteractionModel<CloudType>::itRebound)
|
||||
{
|
||||
patchEs_[patchi] = patchDict.lookupOrDefault<scalar>("e", 1);
|
||||
patchMus_[patchi] = patchDict.lookupOrDefault<scalar>("mu", 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Error if interactions are unspecified for non-constraint patches
|
||||
if (!unspecifiedNonConstraintPatches.empty())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "No interaction type was specified for non-constraint patches: "
|
||||
<< unspecifiedNonConstraintPatches
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,7 +228,9 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
|
||||
)
|
||||
:
|
||||
PatchInteractionModel<CloudType>(pim),
|
||||
patchData_(pim.patchData_),
|
||||
patchInteractionTypes_(pim.patchInteractionTypes_),
|
||||
patchEs_(pim.patchEs_),
|
||||
patchMus_(pim.patchMus_),
|
||||
nEscape_(pim.nEscape_),
|
||||
massEscape_(pim.massEscape_),
|
||||
nStick_(pim.nStick_),
|
||||
@ -174,102 +316,86 @@ bool Foam::LocalInteraction<CloudType>::correct
|
||||
bool& keepParticle
|
||||
)
|
||||
{
|
||||
label patchi = patchData_.applyToPatch(pp.index());
|
||||
const label patchi = pp.index();
|
||||
|
||||
if (patchi >= 0)
|
||||
{
|
||||
vector& U = p.U();
|
||||
bool& moving = p.moving();
|
||||
|
||||
typename PatchInteractionModel<CloudType>::interactionType it =
|
||||
this->wordToInteractionType
|
||||
(
|
||||
patchData_[patchi].interactionTypeName()
|
||||
);
|
||||
|
||||
switch (it)
|
||||
switch (patchInteractionTypes_[patchi])
|
||||
{
|
||||
case PatchInteractionModel<CloudType>::itNone:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
case PatchInteractionModel<CloudType>::itEscape:
|
||||
{
|
||||
scalar dm = p.mass()*p.nParticle();
|
||||
const scalar dm = p.mass()*p.nParticle();
|
||||
|
||||
keepParticle = false;
|
||||
moving = false;
|
||||
U = Zero;
|
||||
nEscape_[patchi]++;
|
||||
p.moving() = false;
|
||||
p.U() = Zero;
|
||||
nEscape_[patchi] ++;
|
||||
massEscape_[patchi] += dm;
|
||||
|
||||
if (writeFields_)
|
||||
{
|
||||
label pI = pp.index();
|
||||
label fI = pp.whichFace(p.face());
|
||||
massEscape().boundaryFieldRef()[pI][fI] += dm;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PatchInteractionModel<CloudType>::itStick:
|
||||
{
|
||||
scalar dm = p.mass()*p.nParticle();
|
||||
|
||||
keepParticle = true;
|
||||
moving = false;
|
||||
U = Zero;
|
||||
nStick_[patchi]++;
|
||||
massStick_[patchi] += dm;
|
||||
if (writeFields_)
|
||||
{
|
||||
label pI = pp.index();
|
||||
label fI = pp.whichFace(p.face());
|
||||
massStick().boundaryFieldRef()[pI][fI] += dm;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PatchInteractionModel<CloudType>::itRebound:
|
||||
{
|
||||
keepParticle = true;
|
||||
moving = true;
|
||||
|
||||
vector nw;
|
||||
vector Up;
|
||||
|
||||
this->owner().patchData(p, pp, nw, Up);
|
||||
|
||||
// Calculate motion relative to patch velocity
|
||||
U -= Up;
|
||||
|
||||
scalar Un = U & nw;
|
||||
vector Ut = U - Un*nw;
|
||||
|
||||
if (Un > 0)
|
||||
{
|
||||
U -= (1.0 + patchData_[patchi].e())*Un*nw;
|
||||
}
|
||||
|
||||
U -= patchData_[patchi].mu()*Ut;
|
||||
|
||||
// Return velocity to global space
|
||||
U += Up;
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown interaction type "
|
||||
<< patchData_[patchi].interactionTypeName()
|
||||
<< "(" << it << ") for patch "
|
||||
<< patchData_[patchi].patchName()
|
||||
<< ". Valid selections are:" << this->interactionTypeNames_
|
||||
<< endl << abort(FatalError);
|
||||
}
|
||||
const label patchFacei = pp.whichFace(p.face());
|
||||
massEscape().boundaryFieldRef()[patchi][patchFacei] += dm;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
case PatchInteractionModel<CloudType>::itStick:
|
||||
{
|
||||
const scalar dm = p.mass()*p.nParticle();
|
||||
|
||||
keepParticle = true;
|
||||
p.moving() = false;
|
||||
p.U() = Zero;
|
||||
nStick_[patchi] ++;
|
||||
massStick_[patchi] += dm;
|
||||
|
||||
if (writeFields_)
|
||||
{
|
||||
const label patchFacei = pp.whichFace(p.face());
|
||||
massStick().boundaryFieldRef()[patchi][patchFacei] += dm;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
case PatchInteractionModel<CloudType>::itRebound:
|
||||
{
|
||||
keepParticle = true;
|
||||
p.moving() = true;
|
||||
|
||||
vector nw, Up;
|
||||
this->owner().patchData(p, pp, nw, Up);
|
||||
|
||||
// Make motion relative to patch velocity
|
||||
p.U() -= Up;
|
||||
|
||||
const scalar Un = p.U() & nw;
|
||||
const vector Ut = p.U() - Un*nw;
|
||||
|
||||
if (Un > 0)
|
||||
{
|
||||
p.U() -= (1 + patchEs_[patchi])*Un*nw;
|
||||
}
|
||||
|
||||
p.U() -= patchMus_[patchi]*Ut;
|
||||
|
||||
// Return velocity to global space
|
||||
p.U() += Up;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -277,45 +403,57 @@ bool Foam::LocalInteraction<CloudType>::correct
|
||||
template<class CloudType>
|
||||
void Foam::LocalInteraction<CloudType>::info(Ostream& os)
|
||||
{
|
||||
// retrieve any stored data
|
||||
labelList npe0(patchData_.size(), 0);
|
||||
const polyBoundaryMesh& patches = this->owner().mesh().boundaryMesh();
|
||||
|
||||
// Determine the number of non-processor patches
|
||||
label nPatches = patches.size();
|
||||
for (; isA<processorPolyPatch>(patches[nPatches - 1]); nPatches --);
|
||||
|
||||
// Retrieve any stored data
|
||||
labelList npe0(nPatches, 0);
|
||||
this->getModelProperty("nEscape", npe0);
|
||||
|
||||
scalarList mpe0(patchData_.size(), 0.0);
|
||||
scalarList mpe0(nPatches, scalar(0));
|
||||
this->getModelProperty("massEscape", mpe0);
|
||||
|
||||
labelList nps0(patchData_.size(), 0);
|
||||
labelList nps0(nPatches, 0);
|
||||
this->getModelProperty("nStick", nps0);
|
||||
|
||||
scalarList mps0(patchData_.size(), 0.0);
|
||||
scalarList mps0(nPatches, scalar(0));
|
||||
this->getModelProperty("massStick", mps0);
|
||||
|
||||
// accumulate current data
|
||||
labelList npe(nEscape_);
|
||||
// Accumulate current data
|
||||
labelList npe(SubList<label>(nEscape_, nPatches));
|
||||
Pstream::listCombineGather(npe, plusEqOp<label>());
|
||||
npe = npe + npe0;
|
||||
|
||||
scalarList mpe(massEscape_);
|
||||
scalarList mpe(SubList<scalar>(massEscape_, nPatches));
|
||||
Pstream::listCombineGather(mpe, plusEqOp<scalar>());
|
||||
mpe = mpe + mpe0;
|
||||
|
||||
labelList nps(nStick_);
|
||||
labelList nps(SubList<label>(nStick_, nPatches));
|
||||
Pstream::listCombineGather(nps, plusEqOp<label>());
|
||||
nps = nps + nps0;
|
||||
|
||||
scalarList mps(massStick_);
|
||||
scalarList mps(SubList<scalar>(massStick_, nPatches));
|
||||
Pstream::listCombineGather(mps, plusEqOp<scalar>());
|
||||
mps = mps + mps0;
|
||||
|
||||
|
||||
forAll(patchData_, i)
|
||||
for (label patchi = 0; patchi < nPatches; ++ patchi)
|
||||
{
|
||||
if
|
||||
(
|
||||
patchInteractionTypes_[patchi]
|
||||
!= PatchInteractionModel<CloudType>::itNone
|
||||
)
|
||||
{
|
||||
os << " Parcel fate (number, mass) : patch "
|
||||
<< patchData_[i].patchName() << nl
|
||||
<< " - escape = " << npe[i]
|
||||
<< ", " << mpe[i] << nl
|
||||
<< " - stick = " << nps[i]
|
||||
<< ", " << mps[i] << nl;
|
||||
<< this->owner().mesh().boundaryMesh()[patchi].name() << nl
|
||||
<< " - escape = " << npe[patchi]
|
||||
<< ", " << mpe[patchi] << nl
|
||||
<< " - stick = " << nps[patchi]
|
||||
<< ", " << mps[patchi] << nl;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->writeTime())
|
||||
@ -324,13 +462,13 @@ void Foam::LocalInteraction<CloudType>::info(Ostream& os)
|
||||
nEscape_ = 0;
|
||||
|
||||
this->setModelProperty("massEscape", mpe);
|
||||
massEscape_ = 0.0;
|
||||
massEscape_ = scalar(0);
|
||||
|
||||
this->setModelProperty("nStick", nps);
|
||||
nStick_ = 0;
|
||||
|
||||
this->setModelProperty("massStick", mps);
|
||||
massStick_ = 0.0;
|
||||
massStick_ = scalar(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,7 +33,6 @@ Description
|
||||
#define LocalInteraction_H
|
||||
|
||||
#include "PatchInteractionModel.H"
|
||||
#include "patchInteractionDataList.H"
|
||||
#include "Switch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -49,10 +48,26 @@ class LocalInteraction
|
||||
:
|
||||
public PatchInteractionModel<CloudType>
|
||||
{
|
||||
// Private Typedefs
|
||||
|
||||
//- Interaction type enumeration
|
||||
typedef
|
||||
typename PatchInteractionModel<CloudType>::interactionType
|
||||
interactionType;
|
||||
|
||||
|
||||
// Private Data
|
||||
|
||||
//- List of participating patches
|
||||
const patchInteractionDataList patchData_;
|
||||
// Interactions
|
||||
|
||||
//- Patch interaction types
|
||||
List<interactionType> patchInteractionTypes_;
|
||||
|
||||
//- Patch elasticity coefficients (for rebound)
|
||||
List<scalar> patchEs_;
|
||||
|
||||
//- Patch restitution coefficients (for rebound)
|
||||
List<scalar> patchMus_;
|
||||
|
||||
|
||||
// Counters for particle fates
|
||||
|
||||
@ -1,88 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "patchInteractionData.H"
|
||||
#include "dictionaryEntry.H"
|
||||
#include "PatchInteractionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::patchInteractionData::patchInteractionData()
|
||||
:
|
||||
interactionTypeName_("unknownInteractionTypeName"),
|
||||
patchName_("unknownPatch"),
|
||||
e_(0.0),
|
||||
mu_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::word& Foam::patchInteractionData::interactionTypeName() const
|
||||
{
|
||||
return interactionTypeName_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::word& Foam::patchInteractionData::patchName() const
|
||||
{
|
||||
return patchName_;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::patchInteractionData::e() const
|
||||
{
|
||||
return e_;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::patchInteractionData::mu() const
|
||||
{
|
||||
return mu_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
Foam::Istream& Foam::operator>>
|
||||
(
|
||||
Istream& is,
|
||||
patchInteractionData& pid
|
||||
)
|
||||
{
|
||||
is.check("Istream& operator>>(Istream&, patchInteractionData&)");
|
||||
|
||||
const dictionaryEntry entry(dictionary::null, is);
|
||||
|
||||
pid.patchName_ = entry.keyword();
|
||||
entry.lookup("type") >> pid.interactionTypeName_;
|
||||
pid.e_ = entry.lookupOrDefault<scalar>("e", 1.0);
|
||||
pid.mu_ = entry.lookupOrDefault<scalar>("mu", 0.0);
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,117 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::patchInteractionData
|
||||
|
||||
Description
|
||||
Helper class for the LocalInteraction patch interaction model
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef patchInteractionData_H
|
||||
#define patchInteractionData_H
|
||||
|
||||
#include "Istream.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class patchInteractionData Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// Forward declaration of classes
|
||||
class patchInteractionData;
|
||||
|
||||
// Forward declaration of friend functions
|
||||
Istream& operator>>
|
||||
(
|
||||
Istream& is,
|
||||
patchInteractionData& pid
|
||||
);
|
||||
|
||||
|
||||
class patchInteractionData
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Interaction type name
|
||||
word interactionTypeName_;
|
||||
|
||||
//- Patch name
|
||||
word patchName_;
|
||||
|
||||
//- Elasticity coefficient
|
||||
scalar e_;
|
||||
|
||||
//- Restitution coefficient
|
||||
scalar mu_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
|
||||
//- Construct null
|
||||
patchInteractionData();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return const access to the interaction type name
|
||||
const word& interactionTypeName() const;
|
||||
|
||||
//- Return const access to the patch name
|
||||
const word& patchName() const;
|
||||
|
||||
//- Return const access to the elasticity coefficient
|
||||
scalar e() const;
|
||||
|
||||
//- Return const access to the restitution coefficient
|
||||
scalar mu() const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Istream operator
|
||||
friend Istream& operator>>
|
||||
(
|
||||
Istream& is,
|
||||
patchInteractionData& pid
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,123 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "patchInteractionDataList.H"
|
||||
#include "stringListOps.H"
|
||||
#include "emptyPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::patchInteractionDataList::patchInteractionDataList()
|
||||
:
|
||||
List<patchInteractionData>(),
|
||||
patchGroupIDs_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::patchInteractionDataList::patchInteractionDataList
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
List<patchInteractionData>(dict.lookup("patches")),
|
||||
patchGroupIDs_(this->size())
|
||||
{
|
||||
const polyBoundaryMesh& bMesh = mesh.boundaryMesh();
|
||||
const wordList allPatchNames = bMesh.names();
|
||||
|
||||
const List<patchInteractionData>& items = *this;
|
||||
forAllReverse(items, i)
|
||||
{
|
||||
const word& patchName = items[i].patchName();
|
||||
labelList patchIDs = findStrings(patchName, allPatchNames);
|
||||
|
||||
if (patchIDs.empty())
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Cannot find any patch names matching " << patchName
|
||||
<< endl;
|
||||
}
|
||||
|
||||
patchGroupIDs_[i].transfer(patchIDs);
|
||||
}
|
||||
|
||||
// Check that all patches are specified
|
||||
DynamicList<word> badPatches;
|
||||
forAll(bMesh, patchi)
|
||||
{
|
||||
const polyPatch& pp = bMesh[patchi];
|
||||
if
|
||||
(
|
||||
!pp.coupled()
|
||||
&& !isA<emptyPolyPatch>(pp)
|
||||
&& applyToPatch(pp.index()) < 0
|
||||
)
|
||||
{
|
||||
badPatches.append(pp.name());
|
||||
}
|
||||
}
|
||||
|
||||
if (badPatches.size() > 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "All patches must be specified when employing local patch "
|
||||
<< "interaction. Please specify data for patches:" << nl
|
||||
<< badPatches << nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::patchInteractionDataList::patchInteractionDataList
|
||||
(
|
||||
const patchInteractionDataList& pidl
|
||||
)
|
||||
:
|
||||
List<patchInteractionData>(pidl),
|
||||
patchGroupIDs_(pidl.patchGroupIDs_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::patchInteractionDataList::applyToPatch(const label id) const
|
||||
{
|
||||
forAll(patchGroupIDs_, groupI)
|
||||
{
|
||||
const labelList& patchIDs = patchGroupIDs_[groupI];
|
||||
forAll(patchIDs, patchi)
|
||||
{
|
||||
if (patchIDs[patchi] == id)
|
||||
{
|
||||
return groupI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,88 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::patchInteractionDataList
|
||||
|
||||
Description
|
||||
List container for patchInteractionData class
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef patchInteractionDataList_H
|
||||
#define patchInteractionDataList_H
|
||||
|
||||
#include "patchInteractionData.H"
|
||||
#include "polyMesh.H"
|
||||
#include "dictionary.H"
|
||||
#include "labelList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class patchInteractionDataList Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class patchInteractionDataList
|
||||
:
|
||||
public List<patchInteractionData>
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- List of patch IDs for each patch group
|
||||
labelListList patchGroupIDs_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
|
||||
//- Construct null
|
||||
patchInteractionDataList();
|
||||
|
||||
//- Construct copy
|
||||
patchInteractionDataList(const patchInteractionDataList& pidl);
|
||||
|
||||
//- Construct from Istream
|
||||
patchInteractionDataList(const polyMesh& mesh, const dictionary& dict);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return label of group containing patch id
|
||||
// Returns -1 if patch id is not present
|
||||
label applyToPatch(const label id) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
70
tutorials/modules/multicomponentFluid/filter/0/G
Normal file
70
tutorials/modules/multicomponentFluid/filter/0/G
Normal file
@ -0,0 +1,70 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "1";
|
||||
object G;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [1 0 -3 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type MarshakRadiation;
|
||||
emissivityMode lookup;
|
||||
emissivity uniform 1;
|
||||
value uniform 0;
|
||||
refValue uniform 0;
|
||||
refGradient uniform 0;
|
||||
valueFraction uniform 0;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type MarshakRadiation;
|
||||
emissivityMode lookup;
|
||||
emissivity uniform 1;
|
||||
value uniform 0;
|
||||
refValue uniform 0;
|
||||
refGradient uniform 0;
|
||||
valueFraction uniform 0;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
cycLeft_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
cycLeft_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
59
tutorials/modules/multicomponentFluid/filter/0/H2O
Normal file
59
tutorials/modules/multicomponentFluid/filter/0/H2O
Normal file
@ -0,0 +1,59 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "1";
|
||||
object H2O;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 0 0 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 0;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
cycLeft_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
cycLeft_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
59
tutorials/modules/multicomponentFluid/filter/0/N2
Normal file
59
tutorials/modules/multicomponentFluid/filter/0/N2
Normal file
@ -0,0 +1,59 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "1";
|
||||
object N2;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 0 0 0 0 0 0];
|
||||
|
||||
internalField uniform 0.77;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value $internalField;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
cycLeft_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
cycLeft_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
59
tutorials/modules/multicomponentFluid/filter/0/O2
Normal file
59
tutorials/modules/multicomponentFluid/filter/0/O2
Normal file
@ -0,0 +1,59 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "1";
|
||||
object O2;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 0 0 0 0 0 0];
|
||||
|
||||
internalField uniform 0.23;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value $internalField;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
cycLeft_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
cycLeft_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
60
tutorials/modules/multicomponentFluid/filter/0/T
Normal file
60
tutorials/modules/multicomponentFluid/filter/0/T
Normal file
@ -0,0 +1,60 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "1";
|
||||
object T;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 0 0 1 0 0 0];
|
||||
|
||||
internalField uniform 350;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 400;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 350;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
cycLeft_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
cycLeft_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
59
tutorials/modules/multicomponentFluid/filter/0/U
Normal file
59
tutorials/modules/multicomponentFluid/filter/0/U
Normal file
@ -0,0 +1,59 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volVectorField;
|
||||
location "1";
|
||||
object U;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform (0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type noSlip;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (5 0 0);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
cycLeft_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
cycLeft_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
61
tutorials/modules/multicomponentFluid/filter/0/alphat
Normal file
61
tutorials/modules/multicomponentFluid/filter/0/alphat
Normal file
@ -0,0 +1,61 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "1";
|
||||
object alphat;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [1 -1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type compressible::alphatWallFunction;
|
||||
value uniform 0;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type calculated;
|
||||
value uniform 0;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type calculated;
|
||||
value uniform 0;
|
||||
}
|
||||
cycLeft_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
cycLeft_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
60
tutorials/modules/multicomponentFluid/filter/0/epsilon
Normal file
60
tutorials/modules/multicomponentFluid/filter/0/epsilon
Normal file
@ -0,0 +1,60 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "1";
|
||||
object epsilon;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 2 -3 0 0 0 0];
|
||||
|
||||
internalField uniform 0.0449;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type epsilonWallFunction;
|
||||
value uniform 0.0449;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 0.0449;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
cycLeft_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
cycLeft_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
60
tutorials/modules/multicomponentFluid/filter/0/k
Normal file
60
tutorials/modules/multicomponentFluid/filter/0/k
Normal file
@ -0,0 +1,60 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "1";
|
||||
object k;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 2 -2 0 0 0 0];
|
||||
|
||||
internalField uniform 0.0938;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type kqRWallFunction;
|
||||
value uniform 0.0938;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 0.0938;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
cycLeft_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
cycLeft_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
61
tutorials/modules/multicomponentFluid/filter/0/nut
Normal file
61
tutorials/modules/multicomponentFluid/filter/0/nut
Normal file
@ -0,0 +1,61 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "1";
|
||||
object nut;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 2 -1 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type nutkWallFunction;
|
||||
value uniform 0;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type calculated;
|
||||
value uniform 0;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type calculated;
|
||||
value uniform 0;
|
||||
}
|
||||
cycLeft_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
cycLeft_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
cycRight_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
65
tutorials/modules/multicomponentFluid/filter/0/p
Normal file
65
tutorials/modules/multicomponentFluid/filter/0/p
Normal file
@ -0,0 +1,65 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object p;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [1 -1 -2 0 0 0 0];
|
||||
|
||||
internalField uniform 100000;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type fixedFluxPressure;
|
||||
}
|
||||
|
||||
inlet
|
||||
{
|
||||
type fixedFluxPressure;
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 100000;
|
||||
}
|
||||
|
||||
cycLeft_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
|
||||
cycRight_half0
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
|
||||
cycLeft_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
|
||||
cycRight_half1
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
13
tutorials/modules/multicomponentFluid/filter/Allrun
Executable file
13
tutorials/modules/multicomponentFluid/filter/Allrun
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication topoSet
|
||||
runApplication createBaffles -overwrite
|
||||
|
||||
runApplication $(getApplication)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -0,0 +1,184 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object cloudProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
type reactingCloud;
|
||||
|
||||
solution
|
||||
{
|
||||
coupled true;
|
||||
transient yes;
|
||||
cellValueSourceCorrection on;
|
||||
maxCo 0.3;
|
||||
|
||||
sourceTerms
|
||||
{
|
||||
schemes
|
||||
{
|
||||
rho explicit 1;
|
||||
U explicit 1;
|
||||
Yi explicit 1;
|
||||
h explicit 1;
|
||||
radiation explicit 1;
|
||||
}
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
rho cell;
|
||||
U cellPoint;
|
||||
mu cell;
|
||||
T cell;
|
||||
Cp cell;
|
||||
kappa cell;
|
||||
p cell;
|
||||
}
|
||||
|
||||
integrationSchemes
|
||||
{
|
||||
U Euler;
|
||||
T analytical;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
constantProperties
|
||||
{
|
||||
rho0 1000;
|
||||
T0 300;
|
||||
Cp0 4100;
|
||||
|
||||
constantVolume false;
|
||||
}
|
||||
|
||||
|
||||
subModels
|
||||
{
|
||||
particleForces
|
||||
{
|
||||
sphereDrag;
|
||||
gravity;
|
||||
}
|
||||
|
||||
injectionModels
|
||||
{
|
||||
model1
|
||||
{
|
||||
type reactingLookupTableInjection;
|
||||
massTotal 1e-2;
|
||||
parcelBasisType mass;
|
||||
SOI 0.5;
|
||||
inputFile "parcelInjectionProperties";
|
||||
duration 1.0;
|
||||
parcelsPerSecond 250;
|
||||
randomise true;
|
||||
}
|
||||
}
|
||||
|
||||
dispersionModel none;
|
||||
|
||||
patchInteractionModel localInteraction;
|
||||
|
||||
heatTransferModel RanzMarshall;
|
||||
|
||||
compositionModel singlePhaseMixture;
|
||||
|
||||
phaseChangeModel liquidEvaporation;
|
||||
|
||||
stochasticCollisionModel none;
|
||||
|
||||
surfaceFilmModel none;
|
||||
|
||||
radiation off;
|
||||
|
||||
localInteractionCoeffs
|
||||
{
|
||||
patches
|
||||
(
|
||||
walls
|
||||
{
|
||||
type rebound;
|
||||
}
|
||||
|
||||
"cycRight.*"
|
||||
{
|
||||
patchType cyclic;
|
||||
type rebound;
|
||||
}
|
||||
|
||||
"inlet|outlet"
|
||||
{
|
||||
type escape;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
RanzMarshallCoeffs
|
||||
{
|
||||
BirdCorrection true;
|
||||
}
|
||||
|
||||
singlePhaseMixtureCoeffs
|
||||
{
|
||||
phases
|
||||
(
|
||||
liquid
|
||||
{
|
||||
H2O 1;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
liquidEvaporationCoeffs
|
||||
{
|
||||
enthalpyTransfer enthalpyDifference;
|
||||
|
||||
activeLiquids ( H2O );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cloudFunctions
|
||||
{
|
||||
patchPostProcessing1
|
||||
{
|
||||
type patchPostProcessing;
|
||||
maxStoredParcels 20;
|
||||
patches
|
||||
(
|
||||
cycLeft_half0
|
||||
cycLeft_half1
|
||||
cycRight_half0
|
||||
cycRight_half1
|
||||
);
|
||||
}
|
||||
|
||||
facePostProcessing1
|
||||
{
|
||||
type facePostProcessing;
|
||||
surfaceFormat vtk;
|
||||
resetOnWrite no;
|
||||
log yes;
|
||||
|
||||
faceZones
|
||||
(
|
||||
cycLeft
|
||||
cycRight
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,19 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object combustionProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
combustionModel none;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,84 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object fvModels;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
buoyancyForce
|
||||
{
|
||||
type buoyancyForce;
|
||||
}
|
||||
|
||||
clouds
|
||||
{
|
||||
type clouds;
|
||||
libs ("liblagrangianParcel.so");
|
||||
}
|
||||
|
||||
filter1
|
||||
{
|
||||
type explicitPorositySource;
|
||||
|
||||
explicitPorositySourceCoeffs
|
||||
{
|
||||
cellZone filter;
|
||||
|
||||
type DarcyForchheimer;
|
||||
|
||||
d (500000 -1000 -1000);
|
||||
f (0 0 0);
|
||||
|
||||
coordinateSystem
|
||||
{
|
||||
type cartesian;
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 0 0);
|
||||
e2 (0 1 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
massSource
|
||||
{
|
||||
type massSource;
|
||||
|
||||
points
|
||||
(
|
||||
(2.75 0.5 0)
|
||||
);
|
||||
|
||||
massFlowRate
|
||||
{
|
||||
type scale;
|
||||
scale squarePulse;
|
||||
start 0.2;
|
||||
duration 2;
|
||||
value 1e-4;
|
||||
}
|
||||
|
||||
fieldValues
|
||||
{
|
||||
U (0 50 0);
|
||||
h 100000;
|
||||
O2 0;
|
||||
H2O 1;
|
||||
k 0.0938;
|
||||
epsilon 0.0449;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
21
tutorials/modules/multicomponentFluid/filter/constant/g
Normal file
21
tutorials/modules/multicomponentFluid/filter/constant/g
Normal file
@ -0,0 +1,21 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class uniformDimensionedVectorField;
|
||||
location "constant";
|
||||
object g;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -2 0 0 0 0];
|
||||
value (0 0 0);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,28 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object momentumTransport;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
simulationType RAS;
|
||||
|
||||
RAS
|
||||
{
|
||||
model kEpsilon;
|
||||
|
||||
turbulence on;
|
||||
|
||||
printCoeffs on;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,25 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object scalarListList;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// (x y z) (u v w) d rho mDot T Cp (Y0..Y2)
|
||||
(
|
||||
(0.1 0.32 0.0) (0.5 0.25 0.0) 0.001 1000 0.2 300 4200 (1)
|
||||
(0.1 0.44 0.0) (0.5 0.10 0.0) 0.001 1000 0.2 300 4200 (1)
|
||||
(0.1 0.56 0.0) (0.5 -0.10 0.0) 0.001 1000 0.2 300 4200 (1)
|
||||
(0.1 0.68 0.0) (0.5 -0.25 0.0) 0.001 1000 0.2 300 4200 (1)
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,109 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object physicalProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
thermoType
|
||||
{
|
||||
type heRhoThermo;
|
||||
mixture multicomponentMixture;
|
||||
transport sutherland;
|
||||
thermo janaf;
|
||||
energy sensibleEnthalpy;
|
||||
equationOfState perfectGas;
|
||||
specie specie;
|
||||
}
|
||||
|
||||
species
|
||||
(
|
||||
O2
|
||||
H2O
|
||||
N2
|
||||
);
|
||||
|
||||
defaultSpecie N2;
|
||||
|
||||
O2
|
||||
{
|
||||
specie
|
||||
{
|
||||
molWeight 31.9988;
|
||||
}
|
||||
thermodynamics
|
||||
{
|
||||
Tlow 200;
|
||||
Thigh 5000;
|
||||
Tcommon 1000;
|
||||
highCpCoeffs ( 3.69758 0.00061352 -1.25884e-07 1.77528e-11 -1.13644e-15 -1233.93 3.18917 );
|
||||
lowCpCoeffs ( 3.21294 0.00112749 -5.75615e-07 1.31388e-09 -8.76855e-13 -1005.25 6.03474 );
|
||||
}
|
||||
transport
|
||||
{
|
||||
As 1.67212e-06;
|
||||
Ts 170.672;
|
||||
}
|
||||
}
|
||||
|
||||
H2O
|
||||
{
|
||||
specie
|
||||
{
|
||||
molWeight 18.0153;
|
||||
}
|
||||
thermodynamics
|
||||
{
|
||||
Tlow 200;
|
||||
Thigh 5000;
|
||||
Tcommon 1000;
|
||||
highCpCoeffs ( 2.67215 0.00305629 -8.73026e-07 1.201e-10 -6.39162e-15 -29899.2 6.86282 );
|
||||
lowCpCoeffs ( 3.38684 0.00347498 -6.3547e-06 6.96858e-09 -2.50659e-12 -30208.1 2.59023 );
|
||||
}
|
||||
transport
|
||||
{
|
||||
As 1.67212e-06;
|
||||
Ts 170.672;
|
||||
}
|
||||
}
|
||||
|
||||
N2
|
||||
{
|
||||
specie
|
||||
{
|
||||
molWeight 28.0134;
|
||||
}
|
||||
thermodynamics
|
||||
{
|
||||
Tlow 200;
|
||||
Thigh 5000;
|
||||
Tcommon 1000;
|
||||
highCpCoeffs ( 2.92664 0.00148798 -5.68476e-07 1.0097e-10 -6.75335e-15 -922.798 5.98053 );
|
||||
lowCpCoeffs ( 3.29868 0.00140824 -3.96322e-06 5.64152e-09 -2.44486e-12 -1020.9 3.95037 );
|
||||
}
|
||||
transport
|
||||
{
|
||||
As 1.67212e-06;
|
||||
Ts 170.672;
|
||||
}
|
||||
}
|
||||
|
||||
liquids
|
||||
{
|
||||
H2O;
|
||||
}
|
||||
|
||||
solids
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,117 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
convertToMeters 1;
|
||||
|
||||
vertices
|
||||
(
|
||||
(0.00 0.25 0) // 0
|
||||
(1.00 0.25 0) // 1
|
||||
(1.25 0.00 0) // 2
|
||||
(2.25 0.00 0) // 3
|
||||
(2.50 0.25 0) // 4
|
||||
(4.00 0.25 0) // 5
|
||||
|
||||
(4.00 0.75 0) // 6
|
||||
(2.50 0.75 0) // 7
|
||||
(2.25 1.00 0) // 8
|
||||
(1.25 1.00 0) // 9
|
||||
(1.00 0.75 0) // 10
|
||||
(0.00 0.75 0) // 11
|
||||
|
||||
|
||||
(0.00 0.25 0.1) // 12
|
||||
(1.00 0.25 0.1) // 13
|
||||
(1.25 0.00 0.1) // 14
|
||||
(2.25 0.00 0.1) // 15
|
||||
(2.50 0.25 0.1) // 16
|
||||
(4.00 0.25 0.1) // 17
|
||||
|
||||
(4.00 0.75 0.1) // 18
|
||||
(2.50 0.75 0.1) // 19
|
||||
(2.25 1.00 0.1) // 20
|
||||
(1.25 1.00 0.1) // 21
|
||||
(1.00 0.75 0.1) // 22
|
||||
(0.00 0.75 0.1) // 23
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex ( 0 1 10 11 12 13 22 23) (20 20 1) simpleGrading (1 1 1)
|
||||
hex ( 1 2 9 10 13 14 21 22) ( 8 20 1) simpleGrading (1 1 1)
|
||||
hex ( 2 3 8 9 14 15 20 21) (20 20 1) simpleGrading (1 1 1)
|
||||
hex ( 3 4 7 8 15 16 19 20) ( 8 20 1) simpleGrading (1 1 1)
|
||||
hex ( 4 5 6 7 16 17 18 19) (30 20 1) simpleGrading (1 1 1)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
walls
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
( 0 1 13 12)
|
||||
( 1 2 14 13)
|
||||
( 2 3 15 14)
|
||||
( 3 4 16 15)
|
||||
( 4 5 17 16)
|
||||
( 6 7 19 18)
|
||||
( 7 8 20 19)
|
||||
( 8 9 21 20)
|
||||
( 9 10 22 21)
|
||||
(10 11 23 22)
|
||||
);
|
||||
}
|
||||
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(11 0 12 23)
|
||||
);
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
( 5 6 18 17)
|
||||
);
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
( 0 11 10 1)
|
||||
( 1 10 9 2)
|
||||
( 2 9 8 3)
|
||||
( 3 8 7 4)
|
||||
( 4 7 6 5)
|
||||
(12 13 22 23)
|
||||
(13 14 21 22)
|
||||
(14 15 20 21)
|
||||
(15 16 19 20)
|
||||
(16 17 18 19)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,56 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application foamRun;
|
||||
|
||||
solver multicomponentFluid;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 5;
|
||||
|
||||
deltaT 0.001;
|
||||
|
||||
writeControl adjustableRunTime;
|
||||
|
||||
writeInterval 0.1;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
writeFormat binary;
|
||||
|
||||
writePrecision 10;
|
||||
|
||||
writeCompression off;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
adjustTimeStep yes;
|
||||
|
||||
maxCo 1.0;
|
||||
|
||||
maxDeltaT 1;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,62 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object createBafflesDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
internalFacesOnly true;
|
||||
|
||||
baffles
|
||||
{
|
||||
cycLeft
|
||||
{
|
||||
type faceZone;
|
||||
zoneName cycLeft;
|
||||
|
||||
owner
|
||||
{
|
||||
name cycLeft_half0;
|
||||
type cyclic;
|
||||
neighbourPatch cycLeft_half1;
|
||||
}
|
||||
|
||||
neighbour
|
||||
{
|
||||
name cycLeft_half1;
|
||||
type cyclic;
|
||||
neighbourPatch cycLeft_half0;
|
||||
}
|
||||
}
|
||||
|
||||
cycRight
|
||||
{
|
||||
type faceZone;
|
||||
zoneName cycRight;
|
||||
|
||||
owner
|
||||
{
|
||||
name cycRight_half0;
|
||||
type cyclic;
|
||||
neighbourPatch cycRight_half1;
|
||||
}
|
||||
|
||||
neighbour
|
||||
{
|
||||
name cycRight_half1;
|
||||
type cyclic;
|
||||
neighbourPatch cycRight_half0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,57 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
default Euler;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
|
||||
div(phi,U) Gauss upwind;
|
||||
div(phid,p) Gauss upwind;
|
||||
div(phi,K) Gauss linear;
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
div(U) Gauss linear;
|
||||
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
|
||||
div(phi,Yi_h) Gauss upwind;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
102
tutorials/modules/multicomponentFluid/filter/system/fvSolution
Normal file
102
tutorials/modules/multicomponentFluid/filter/system/fvSolution
Normal file
@ -0,0 +1,102 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
rho
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
tolerance 1e-05;
|
||||
relTol 0.1;
|
||||
}
|
||||
|
||||
rhoFinal
|
||||
{
|
||||
$rho;
|
||||
tolerance 1e-05;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
"(U|k|epsilon)"
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother symGaussSeidel;
|
||||
tolerance 1e-06;
|
||||
relTol 0.1;
|
||||
}
|
||||
|
||||
"(U|k|epsilon)Final"
|
||||
{
|
||||
$U;
|
||||
tolerance 1e-06;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
p
|
||||
{
|
||||
solver GAMG;
|
||||
tolerance 0;
|
||||
relTol 0.1;
|
||||
smoother GaussSeidel;
|
||||
}
|
||||
|
||||
pFinal
|
||||
{
|
||||
$p;
|
||||
tolerance 1e-06;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
"(Yi|O2|N2|H2O).*"
|
||||
{
|
||||
solver PBiCGStab;
|
||||
preconditioner DILU;
|
||||
tolerance 1e-6;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
h
|
||||
{
|
||||
$Yi;
|
||||
relTol 0.1;
|
||||
}
|
||||
|
||||
hFinal
|
||||
{
|
||||
$Yi;
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{
|
||||
transonic no;
|
||||
nOuterCorrectors 1;
|
||||
nCorrectors 2;
|
||||
nNonOrthogonalCorrectors 0;
|
||||
momentumPredictor yes;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
equations
|
||||
{
|
||||
".*" 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
120
tutorials/modules/multicomponentFluid/filter/system/topoSetDict
Normal file
120
tutorials/modules/multicomponentFluid/filter/system/topoSetDict
Normal file
@ -0,0 +1,120 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object topoSetDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
actions
|
||||
(
|
||||
// filter
|
||||
{
|
||||
name filterCellSet;
|
||||
type cellSet;
|
||||
action new;
|
||||
source boxToCell;
|
||||
box (1.5 -10 -10) (2 10 10);
|
||||
}
|
||||
{
|
||||
name filter;
|
||||
type cellZoneSet;
|
||||
action new;
|
||||
source setToCellZone;
|
||||
set filterCellSet;
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
name leftFluidCellSet;
|
||||
type cellSet;
|
||||
action new;
|
||||
source boxToCell;
|
||||
box (-10 -10 -10) (1.5 10 10);
|
||||
}
|
||||
{
|
||||
name leftFluid;
|
||||
type cellZoneSet;
|
||||
action new;
|
||||
source setToCellZone;
|
||||
set leftFluidCellSet;
|
||||
}
|
||||
{
|
||||
name rightFluidCellSet;
|
||||
type cellSet;
|
||||
action new;
|
||||
source boxToCell;
|
||||
box (2 -1 -1) (10 10 10);
|
||||
}
|
||||
{
|
||||
name rightFluid;
|
||||
type cellZoneSet;
|
||||
action new;
|
||||
source setToCellZone;
|
||||
set rightFluidCellSet;
|
||||
}
|
||||
|
||||
|
||||
// cycLeft
|
||||
{
|
||||
name cycLeftFaceSet;
|
||||
type faceSet;
|
||||
action new;
|
||||
source cellToFace;
|
||||
set filterCellSet;
|
||||
option all;
|
||||
}
|
||||
{
|
||||
name cycLeftFaceSet;
|
||||
type faceSet;
|
||||
action subset;
|
||||
source cellToFace;
|
||||
set leftFluidCellSet;
|
||||
option all;
|
||||
}
|
||||
// Create faceZone from cycLeft
|
||||
{
|
||||
name cycLeft;
|
||||
type faceZoneSet;
|
||||
action new;
|
||||
source setToFaceZone;
|
||||
faceSet cycLeftFaceSet;
|
||||
}
|
||||
|
||||
// cycRight
|
||||
{
|
||||
name cycRightFaceSet;
|
||||
type faceSet;
|
||||
action new;
|
||||
source cellToFace;
|
||||
set filterCellSet;
|
||||
option all;
|
||||
}
|
||||
{
|
||||
name cycRightFaceSet;
|
||||
type faceSet;
|
||||
action subset;
|
||||
source cellToFace;
|
||||
set rightFluidCellSet;
|
||||
option all;
|
||||
}
|
||||
// Create faceZone from cycRight
|
||||
{
|
||||
name cycRight;
|
||||
type faceZoneSet;
|
||||
action new;
|
||||
source setToFaceZone;
|
||||
faceSet cycRightFaceSet;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user