ReactingDPM
This commit is contained in:
parent
ed25887ecc
commit
cbd231c077
9 changed files with 347 additions and 2 deletions
|
|
@ -56,6 +56,12 @@ $(THERMOMPPICPARCEL)/defineBasicThermoKinematicMPPICParcel.C
|
|||
$(THERMOMPPICPARCEL)/makeBasicThermoKinematicMPPICParcelSubmodels.C
|
||||
|
||||
|
||||
/* reacting multiphase & Colliding parcel sub-models */
|
||||
REACTINGMPCOLLIDINGPARCEL=$(DERIVEDPARCELS)/basicReactingMultiphaseCollidingParcel
|
||||
$(REACTINGMPCOLLIDINGPARCEL)/defineBasicReactingMultiphaseCollidingParcel.C
|
||||
$(REACTINGMPCOLLIDINGPARCEL)/makeBasicReactingMultiphaseCollidingParcelSubmodels.C
|
||||
|
||||
|
||||
/* bolt-on models */
|
||||
RADIATION=submodels/addOns/radiation
|
||||
$(RADIATION)/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.C
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
EXE_INC = \
|
||||
EXE_INC = -g \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ Foam::CollidingCloud<CloudType>::CollidingCloud
|
|||
|
||||
if (readFields)
|
||||
{
|
||||
parcelType::readFields(*this);
|
||||
parcelType::readFields(*this, this->composition());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,6 +143,64 @@ Foam::ReactingCloud<CloudType>::ReactingCloud
|
|||
}
|
||||
}
|
||||
|
||||
template<class CloudType>
|
||||
Foam::ReactingCloud<CloudType>::ReactingCloud
|
||||
(
|
||||
const word& cloudName,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const volScalarField& mu,
|
||||
const dimensionedVector& g,
|
||||
bool readFields
|
||||
)
|
||||
:
|
||||
CloudType(cloudName, rho, U, mu, g, false),
|
||||
reactingCloud(),
|
||||
cloudCopyPtr_(NULL),
|
||||
constProps_(this->particleProperties()),
|
||||
compositionModel_(NULL),
|
||||
phaseChangeModel_(NULL),
|
||||
rhoTrans_(this->thermo().carrier().species().size())
|
||||
{
|
||||
if (this->solution().active())
|
||||
{
|
||||
setModels();
|
||||
|
||||
if (readFields)
|
||||
{
|
||||
parcelType::readFields(*this, this->composition());
|
||||
}
|
||||
}
|
||||
|
||||
// Set storage for mass source fields and initialise to zero
|
||||
forAll(rhoTrans_, i)
|
||||
{
|
||||
const word& specieName = this->thermo().carrier().species()[i];
|
||||
rhoTrans_.set
|
||||
(
|
||||
i,
|
||||
new DimensionedField<scalar, volMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
this->name() + ":rhoTrans_" + specieName,
|
||||
this->db().time().timeName(),
|
||||
this->db(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar("zero", dimMass, 0.0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (this->solution().resetSourcesOnStartup())
|
||||
{
|
||||
resetSourceTerms();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::ReactingCloud<CloudType>::ReactingCloud
|
||||
|
|
|
|||
|
|
@ -161,6 +161,16 @@ public:
|
|||
bool readFields = true
|
||||
);
|
||||
|
||||
ReactingCloud
|
||||
(
|
||||
const word& cloudName,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const volScalarField& mu,
|
||||
const dimensionedVector& g,
|
||||
bool readFields = true
|
||||
);
|
||||
|
||||
//- Copy constructor with new name
|
||||
ReactingCloud(ReactingCloud<CloudType>& c, const word& name);
|
||||
|
||||
|
|
|
|||
|
|
@ -107,6 +107,42 @@ Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud
|
|||
}
|
||||
}
|
||||
|
||||
template<class CloudType>
|
||||
Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud
|
||||
(
|
||||
const word& cloudName,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const volScalarField& mu,
|
||||
const dimensionedVector& g,
|
||||
bool readFields
|
||||
)
|
||||
:
|
||||
CloudType(cloudName, rho, U, mu, g, false),
|
||||
reactingMultiphaseCloud(),
|
||||
cloudCopyPtr_(NULL),
|
||||
constProps_(this->particleProperties()),
|
||||
devolatilisationModel_(NULL),
|
||||
surfaceReactionModel_(NULL),
|
||||
dMassDevolatilisation_(0.0),
|
||||
dMassSurfaceReaction_(0.0)
|
||||
{
|
||||
if (this->solution().active())
|
||||
{
|
||||
setModels();
|
||||
|
||||
if (readFields)
|
||||
{
|
||||
parcelType::readFields(*this, this->composition());
|
||||
}
|
||||
}
|
||||
|
||||
if (this->solution().resetSourcesOnStartup())
|
||||
{
|
||||
resetSourceTerms();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud
|
||||
|
|
|
|||
|
|
@ -161,6 +161,17 @@ public:
|
|||
bool readFields = true
|
||||
);
|
||||
|
||||
ReactingMultiphaseCloud
|
||||
(
|
||||
const word& cloudName,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const volScalarField& mu,
|
||||
const dimensionedVector& g,
|
||||
bool readFields = true
|
||||
);
|
||||
|
||||
|
||||
|
||||
//- Copy constructor with new name
|
||||
ReactingMultiphaseCloud
|
||||
|
|
|
|||
|
|
@ -292,14 +292,33 @@ public:
|
|||
// I-O
|
||||
|
||||
//- Read
|
||||
template<class CloudType, class CompositionType>
|
||||
static void readFields
|
||||
(
|
||||
CloudType& c,
|
||||
const CompositionType& compModel
|
||||
);
|
||||
|
||||
//- Read - no composition
|
||||
template<class CloudType>
|
||||
static void readFields(CloudType& c);
|
||||
|
||||
//- Write
|
||||
template<class CloudType, class CompositionType>
|
||||
static void writeFields
|
||||
(
|
||||
const CloudType& c,
|
||||
const CompositionType& compModel
|
||||
);
|
||||
|
||||
//- Read - composition supplied
|
||||
template<class CloudType>
|
||||
static void writeFields(const CloudType& c);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<< <ParcelType>
|
||||
|
|
|
|||
|
|
@ -180,6 +180,109 @@ void Foam::CollidingParcel<ParcelType>::readFields(CloudType& c)
|
|||
}
|
||||
}
|
||||
|
||||
template<class ParcelType>
|
||||
template<class CloudType, class CompositionType>
|
||||
void Foam::CollidingParcel<ParcelType>::readFields
|
||||
(
|
||||
CloudType& c,
|
||||
const CompositionType& compModel
|
||||
)
|
||||
{
|
||||
if (!c.size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ParcelType::readFields(c,compModel);
|
||||
|
||||
IOField<vector> f(c.fieldIOobject("f", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, f);
|
||||
|
||||
IOField<vector> angularMomentum
|
||||
(
|
||||
c.fieldIOobject("angularMomentum", IOobject::MUST_READ)
|
||||
);
|
||||
c.checkFieldIOobject(c, angularMomentum);
|
||||
|
||||
IOField<vector> torque(c.fieldIOobject("torque", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, torque);
|
||||
|
||||
labelFieldCompactIOField collisionRecordsPairAccessed
|
||||
(
|
||||
c.fieldIOobject("collisionRecordsPairAccessed", IOobject::MUST_READ)
|
||||
);
|
||||
c.checkFieldFieldIOobject(c, collisionRecordsPairAccessed);
|
||||
|
||||
labelFieldCompactIOField collisionRecordsPairOrigProcOfOther
|
||||
(
|
||||
c.fieldIOobject
|
||||
(
|
||||
"collisionRecordsPairOrigProcOfOther",
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
);
|
||||
c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther);
|
||||
|
||||
labelFieldCompactIOField collisionRecordsPairOrigIdOfOther
|
||||
(
|
||||
c.fieldIOobject
|
||||
(
|
||||
"collisionRecordsPairOrigIdOfOther",
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
);
|
||||
c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther);
|
||||
|
||||
pairDataFieldCompactIOField collisionRecordsPairData
|
||||
(
|
||||
c.fieldIOobject("collisionRecordsPairData", IOobject::MUST_READ)
|
||||
);
|
||||
c.checkFieldFieldIOobject(c, collisionRecordsPairData);
|
||||
|
||||
labelFieldCompactIOField collisionRecordsWallAccessed
|
||||
(
|
||||
c.fieldIOobject("collisionRecordsWallAccessed", IOobject::MUST_READ)
|
||||
);
|
||||
c.checkFieldFieldIOobject(c, collisionRecordsWallAccessed);
|
||||
|
||||
vectorFieldCompactIOField collisionRecordsWallPRel
|
||||
(
|
||||
c.fieldIOobject("collisionRecordsWallPRel", IOobject::MUST_READ)
|
||||
);
|
||||
c.checkFieldFieldIOobject(c, collisionRecordsWallPRel);
|
||||
|
||||
wallDataFieldCompactIOField collisionRecordsWallData
|
||||
(
|
||||
c.fieldIOobject("collisionRecordsWallData", IOobject::MUST_READ)
|
||||
);
|
||||
c.checkFieldFieldIOobject(c, collisionRecordsWallData);
|
||||
|
||||
label i = 0;
|
||||
|
||||
forAllIter(typename CloudType, c, iter)
|
||||
{
|
||||
CollidingParcel<ParcelType>& p = iter();
|
||||
|
||||
p.f_ = f[i];
|
||||
p.angularMomentum_ = angularMomentum[i];
|
||||
p.torque_ = torque[i];
|
||||
|
||||
p.collisionRecords_ = collisionRecordList
|
||||
(
|
||||
collisionRecordsPairAccessed[i],
|
||||
collisionRecordsPairOrigProcOfOther[i],
|
||||
collisionRecordsPairOrigIdOfOther[i],
|
||||
collisionRecordsPairData[i],
|
||||
collisionRecordsWallAccessed[i],
|
||||
collisionRecordsWallPRel[i],
|
||||
collisionRecordsWallData[i]
|
||||
);
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
template<class CloudType>
|
||||
|
|
@ -274,6 +377,108 @@ void Foam::CollidingParcel<ParcelType>::writeFields(const CloudType& c)
|
|||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
template<class CloudType, class CompositionType>
|
||||
void Foam::CollidingParcel<ParcelType>::writeFields
|
||||
(
|
||||
const CloudType& c,
|
||||
const CompositionType& compModel
|
||||
)
|
||||
{
|
||||
ParcelType::writeFields(c, compModel);
|
||||
|
||||
label np = c.size();
|
||||
|
||||
IOField<vector> f(c.fieldIOobject("f", IOobject::NO_READ), np);
|
||||
IOField<vector> angularMomentum
|
||||
(
|
||||
c.fieldIOobject("angularMomentum", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
IOField<vector> torque(c.fieldIOobject("torque", IOobject::NO_READ), np);
|
||||
|
||||
labelFieldCompactIOField collisionRecordsPairAccessed
|
||||
(
|
||||
c.fieldIOobject("collisionRecordsPairAccessed", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
labelFieldCompactIOField collisionRecordsPairOrigProcOfOther
|
||||
(
|
||||
c.fieldIOobject
|
||||
(
|
||||
"collisionRecordsPairOrigProcOfOther",
|
||||
IOobject::NO_READ
|
||||
),
|
||||
np
|
||||
);
|
||||
labelFieldCompactIOField collisionRecordsPairOrigIdOfOther
|
||||
(
|
||||
c.fieldIOobject("collisionRecordsPairOrigIdOfOther", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
pairDataFieldCompactIOField collisionRecordsPairData
|
||||
(
|
||||
c.fieldIOobject("collisionRecordsPairData", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
labelFieldCompactIOField collisionRecordsWallAccessed
|
||||
(
|
||||
c.fieldIOobject("collisionRecordsWallAccessed", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
vectorFieldCompactIOField collisionRecordsWallPRel
|
||||
(
|
||||
c.fieldIOobject("collisionRecordsWallPRel", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
wallDataFieldCompactIOField collisionRecordsWallData
|
||||
(
|
||||
c.fieldIOobject("collisionRecordsWallData", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
|
||||
forAllConstIter(typename CloudType, c, iter)
|
||||
{
|
||||
const CollidingParcel<ParcelType>& p = iter();
|
||||
|
||||
f[i] = p.f();
|
||||
angularMomentum[i] = p.angularMomentum();
|
||||
torque[i] = p.torque();
|
||||
|
||||
collisionRecordsPairAccessed[i] = p.collisionRecords().pairAccessed();
|
||||
collisionRecordsPairOrigProcOfOther[i] =
|
||||
p.collisionRecords().pairOrigProcOfOther();
|
||||
collisionRecordsPairOrigIdOfOther[i] =
|
||||
p.collisionRecords().pairOrigIdOfOther();
|
||||
collisionRecordsPairData[i] = p.collisionRecords().pairData();
|
||||
collisionRecordsWallAccessed[i] = p.collisionRecords().wallAccessed();
|
||||
collisionRecordsWallPRel[i] = p.collisionRecords().wallPRel();
|
||||
collisionRecordsWallData[i] = p.collisionRecords().wallData();
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
f.write();
|
||||
angularMomentum.write();
|
||||
torque.write();
|
||||
|
||||
collisionRecordsPairAccessed.write();
|
||||
collisionRecordsPairOrigProcOfOther.write();
|
||||
collisionRecordsPairOrigIdOfOther.write();
|
||||
collisionRecordsPairData.write();
|
||||
collisionRecordsWallAccessed.write();
|
||||
collisionRecordsWallPRel.write();
|
||||
collisionRecordsWallData.write();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
template<class ParcelType>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue