mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
add default names to chem. models as not to repeat in coup. props.
This commit is contained in:
@ -67,13 +67,13 @@ diffusionCoefficient::diffusionCoefficient
|
|||||||
),
|
),
|
||||||
// create a list from the Species table in the specified diffusionCoefficient dictionary
|
// create a list from the Species table in the specified diffusionCoefficient dictionary
|
||||||
speciesNames_(specDict_.lookup("species")),
|
speciesNames_(specDict_.lookup("species")),
|
||||||
tempFieldName_(propsDict_.lookup("tempFieldName")),
|
tempFieldName_(propsDict_.lookupOrDefault<word>("tempFieldName","T")),
|
||||||
tempField_(sm.mesh().lookupObject<volScalarField> (tempFieldName_)),
|
tempField_(sm.mesh().lookupObject<volScalarField> (tempFieldName_)),
|
||||||
pressureFieldName_(propsDict_.lookup("pressureFieldName")),
|
pressureFieldName_(propsDict_.lookupOrDefault<word>("pressureFieldName","p")),
|
||||||
P_(sm.mesh().lookupObject<volScalarField>(pressureFieldName_)),
|
P_(sm.mesh().lookupObject<volScalarField>(pressureFieldName_)),
|
||||||
densityFieldName_(propsDict_.lookup("densityFieldName")),
|
densityFieldName_(propsDict_.lookupOrDefault<word>("densityFieldName","rho")),
|
||||||
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
|
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
|
||||||
totalMoleFieldName_(propsDict_.lookup("totalMoleFieldName")),
|
totalMoleFieldName_(propsDict_.lookupOrDefault<word>("totalMoleFieldName","N")),
|
||||||
// needed to calculate the mixture diffusion coefficient
|
// needed to calculate the mixture diffusion coefficient
|
||||||
// dcoeff is dependent on molar fraction not mass fraction
|
// dcoeff is dependent on molar fraction not mass fraction
|
||||||
N_(sm.mesh().lookupObject<volScalarField>(totalMoleFieldName_)),
|
N_(sm.mesh().lookupObject<volScalarField>(totalMoleFieldName_)),
|
||||||
@ -81,10 +81,6 @@ diffusionCoefficient::diffusionCoefficient
|
|||||||
// X_(speciesNames_.size()),
|
// X_(speciesNames_.size()),
|
||||||
diffusantGasNames_(propsDict_.lookup("diffusantGasNames")),
|
diffusantGasNames_(propsDict_.lookup("diffusantGasNames")),
|
||||||
diffusionCoefficients_(diffusantGasNames_.size(),NULL)
|
diffusionCoefficients_(diffusantGasNames_.size(),NULL)
|
||||||
/* diffusionCoefficientNames_(propsDict_.lookup("diffusionCoefficientNames")),
|
|
||||||
//volumeScalarFields created in the ts folders
|
|
||||||
diffusionCoefficients_(diffusionCoefficientNames_.size(),NULL), //the value of diffusionCoefficient concentration for every diffusionCoefficient
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
Info << " Reading diffusionCoefficient list: " << diffusantGasNames_ << endl;
|
Info << " Reading diffusionCoefficient list: " << diffusantGasNames_ << endl;
|
||||||
for (int i = 0; i < diffusantGasNames_.size(); i++)
|
for (int i = 0; i < diffusantGasNames_.size(); i++)
|
||||||
|
|||||||
@ -56,15 +56,15 @@ massTransferCoeff::massTransferCoeff
|
|||||||
verbose_(propsDict_.lookupOrDefault<bool>("verbose",false)),
|
verbose_(propsDict_.lookupOrDefault<bool>("verbose",false)),
|
||||||
interpolation_(propsDict_.lookupOrDefault<bool>("interpolation",false)),
|
interpolation_(propsDict_.lookupOrDefault<bool>("interpolation",false)),
|
||||||
mesh_(sm.mesh()),
|
mesh_(sm.mesh()),
|
||||||
velFieldName_(propsDict_.lookup("velFieldName")),
|
velFieldName_(propsDict_.lookupOrDefault<word>("velFieldName","U")),
|
||||||
U_(mesh_.lookupObject<volVectorField>(velFieldName_)),
|
U_(mesh_.lookupObject<volVectorField>(velFieldName_)),
|
||||||
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
|
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("voidfractionFieldName","voidfraction")),
|
||||||
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
|
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
|
||||||
densityFieldName_(propsDict_.lookupOrDefault<word>("densityFieldName","rho")),
|
densityFieldName_(propsDict_.lookupOrDefault<word>("densityFieldName","rho")),
|
||||||
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
|
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
|
||||||
partNuName_(propsDict_.lookup("partNu")),
|
partNuName_(propsDict_.lookupOrDefault<word>("partViscos","partNu")),
|
||||||
partNu_(NULL),
|
partNu_(NULL),
|
||||||
partReynolds_(propsDict_.lookup("partReynolds")),
|
partReynolds_(propsDict_.lookupOrDefault<word>("partReynolds","partRe")),
|
||||||
partRe_(NULL)
|
partRe_(NULL)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
@ -86,20 +86,20 @@ species::species
|
|||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("zero",dimMass/(dimVol*dimTime),0.0)
|
dimensionedScalar("zero",dimMass/(dimVol*dimTime),0.0)
|
||||||
),
|
),
|
||||||
tempFieldName_(propsDict_.lookup("tempFieldName")),
|
tempFieldName_(propsDict_.lookupOrDefault<word>("tempFieldName","T")),
|
||||||
tempField_(sm.mesh().lookupObject<volScalarField> (tempFieldName_)),
|
tempField_(sm.mesh().lookupObject<volScalarField> (tempFieldName_)),
|
||||||
partTempName_(propsDict_.lookup("partTempName")),
|
partTempName_(propsDict_.lookupOrDefault<word>("partTempName","partTemp")),
|
||||||
partTemp_(NULL),
|
partTemp_(NULL),
|
||||||
densityFieldName_(propsDict_.lookup("densityFieldName")),
|
densityFieldName_(propsDict_.lookupOrDefault<word>("densityFieldName","rho")),
|
||||||
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
|
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
|
||||||
partRhoName_(propsDict_.lookup("partRhoName")),
|
partRhoName_(propsDict_.lookupOrDefault<word>("partRhoName","partRho")),
|
||||||
partRho_(NULL),
|
partRho_(NULL),
|
||||||
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
|
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("voidfractionFieldName","voidfraction")),
|
||||||
voidfraction_(sm.mesh().lookupObject<volScalarField>(voidfractionFieldName_)),
|
voidfraction_(sm.mesh().lookupObject<volScalarField>(voidfractionFieldName_)),
|
||||||
// total mole field
|
// total mole field
|
||||||
totalMoleFieldName_(propsDict_.lookup("totalMoleFieldName")),
|
totalMoleFieldName_(propsDict_.lookupOrDefault<word>("totalMoleFieldName","N")),
|
||||||
N_(sm.mesh().lookupObject<volScalarField>(totalMoleFieldName_)),
|
N_(sm.mesh().lookupObject<volScalarField>(totalMoleFieldName_)),
|
||||||
partMoleName_(propsDict_.lookup("partMoleName")),
|
partMoleName_(propsDict_.lookupOrDefault<word>("partMoleName","partN")),
|
||||||
partN_(NULL),
|
partN_(NULL),
|
||||||
loopCounter_(-1),
|
loopCounter_(-1),
|
||||||
Nevery_(propsDict_.lookupOrDefault<label>("Nevery",1))
|
Nevery_(propsDict_.lookupOrDefault<label>("Nevery",1))
|
||||||
@ -214,7 +214,7 @@ void species::execute()
|
|||||||
// realloc the arrays
|
// realloc the arrays
|
||||||
reAllocMyArrays();
|
reAllocMyArrays();
|
||||||
|
|
||||||
// get Y_i, T, rho at particle positions, fill arrays with them and push to LIGGGHTS
|
// get Y_i, T, rho at particle positions, fill arrays with them and push to LIGGGHTS
|
||||||
|
|
||||||
label cellI=0;
|
label cellI=0;
|
||||||
scalar Tfluid(0);
|
scalar Tfluid(0);
|
||||||
@ -224,7 +224,6 @@ void species::execute()
|
|||||||
Yfluid_.setSize(speciesNames_.size());
|
Yfluid_.setSize(speciesNames_.size());
|
||||||
scalar Nfluid(0);
|
scalar Nfluid(0);
|
||||||
|
|
||||||
|
|
||||||
// defining interpolators for T, rho, voidfraction, N
|
// defining interpolators for T, rho, voidfraction, N
|
||||||
interpolationCellPoint <scalar> TInterpolator_(tempField_);
|
interpolationCellPoint <scalar> TInterpolator_(tempField_);
|
||||||
interpolationCellPoint <scalar> rhoInterpolator_(rho_);
|
interpolationCellPoint <scalar> rhoInterpolator_(rho_);
|
||||||
@ -258,8 +257,8 @@ void species::execute()
|
|||||||
}
|
}
|
||||||
//fill arrays
|
//fill arrays
|
||||||
partTemp_[index][0] = Tfluid;
|
partTemp_[index][0] = Tfluid;
|
||||||
// partRho was filled with rhofluid*voidfraction before
|
// partRho was filled with rhofluid*voidfraction before
|
||||||
// probably wrong: need actual gas density, not averaged one
|
// probably wrong: need actual gas density, not averaged one
|
||||||
partRho_[index][0] = rhofluid;
|
partRho_[index][0] = rhofluid;
|
||||||
partN_[index][0] = Nfluid;
|
partN_[index][0] = Nfluid;
|
||||||
|
|
||||||
@ -289,7 +288,7 @@ void species::execute()
|
|||||||
|
|
||||||
// give DEM data
|
// give DEM data
|
||||||
particleCloud_.dataExchangeM().giveData(partTempName_, "scalar-atom", partTemp_);
|
particleCloud_.dataExchangeM().giveData(partTempName_, "scalar-atom", partTemp_);
|
||||||
particleCloud_.dataExchangeM().giveData(partRhoName_, "scalar-atom", partRho_);
|
particleCloud_.dataExchangeM().giveData(partRhoName_, "scalar-atom", partRho_);
|
||||||
particleCloud_.dataExchangeM().giveData(partMoleName_, "scalar-atom", partN_);
|
particleCloud_.dataExchangeM().giveData(partMoleName_, "scalar-atom", partN_);
|
||||||
|
|
||||||
for (int i=0; i<speciesNames_.size();i++)
|
for (int i=0; i<speciesNames_.size();i++)
|
||||||
@ -300,7 +299,7 @@ void species::execute()
|
|||||||
Info << "give data done" << endl;
|
Info << "give data done" << endl;
|
||||||
|
|
||||||
// pull changeOfSpeciesMass_, transform onto fields changeOfSpeciesMassFields_, add them up on changeOfGasMassField_
|
// pull changeOfSpeciesMass_, transform onto fields changeOfSpeciesMassFields_, add them up on changeOfGasMassField_
|
||||||
scalar timestep = mesh_.time().deltaTValue();
|
scalar timestep = mesh_.time().deltaTValue();
|
||||||
changeOfGasMassField_.primitiveFieldRef() = 0.0;
|
changeOfGasMassField_.primitiveFieldRef() = 0.0;
|
||||||
changeOfGasMassField_.boundaryFieldRef() = 0.0;
|
changeOfGasMassField_.boundaryFieldRef() = 0.0;
|
||||||
for (int i=0; i<speciesNames_.size();i++)
|
for (int i=0; i<speciesNames_.size();i++)
|
||||||
@ -317,7 +316,7 @@ void species::execute()
|
|||||||
);
|
);
|
||||||
|
|
||||||
// take care for implementation in LIGGGHTS: species produced from particles defined positive
|
// take care for implementation in LIGGGHTS: species produced from particles defined positive
|
||||||
// changeOf...Fields need to be mass per volume per timestep
|
// changeOf...Fields need to be mass per volume per timestep
|
||||||
changeOfSpeciesMassFields_[i].primitiveFieldRef() /= (changeOfSpeciesMassFields_[i].mesh().V() * Nevery_ * timestep);
|
changeOfSpeciesMassFields_[i].primitiveFieldRef() /= (changeOfSpeciesMassFields_[i].mesh().V() * Nevery_ * timestep);
|
||||||
changeOfSpeciesMassFields_[i].correctBoundaryConditions();
|
changeOfSpeciesMassFields_[i].correctBoundaryConditions();
|
||||||
changeOfGasMassField_ += changeOfSpeciesMassFields_[i];
|
changeOfGasMassField_ += changeOfSpeciesMassFields_[i];
|
||||||
|
|||||||
@ -105,26 +105,14 @@ reactionHeatProps
|
|||||||
speciesProps
|
speciesProps
|
||||||
{
|
{
|
||||||
ChemistryFile "$casePath/CFD/constant/foam.inp";
|
ChemistryFile "$casePath/CFD/constant/foam.inp";
|
||||||
tempFieldName "T";
|
// verbose true;
|
||||||
partTempName "partTemp";
|
// Nevery 1;
|
||||||
densityFieldName "rho";
|
|
||||||
partRhoName "partRho";
|
|
||||||
voidfractionFieldName "voidfraction";
|
|
||||||
totalMoleFieldName "N";
|
|
||||||
partMoleName "partN";
|
|
||||||
pressureFieldName "p";
|
|
||||||
partPName "partP";
|
|
||||||
// verbose true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
diffusionCoefficientsProps
|
diffusionCoefficientsProps
|
||||||
{
|
{
|
||||||
verbose true;
|
verbose true;
|
||||||
ChemistryFile "$casePath/CFD/constant/foam.inp";
|
ChemistryFile "$casePath/CFD/constant/foam.inp";
|
||||||
tempFieldName "T";
|
|
||||||
totalMoleFieldName "N";
|
|
||||||
pressureFieldName "p";
|
|
||||||
densityFieldName "rho";
|
|
||||||
diffusantGasNames ( CO
|
diffusantGasNames ( CO
|
||||||
// H2
|
// H2
|
||||||
);
|
);
|
||||||
@ -132,10 +120,6 @@ diffusionCoefficientsProps
|
|||||||
|
|
||||||
massTransferCoeffProps
|
massTransferCoeffProps
|
||||||
{
|
{
|
||||||
velFieldName "U";
|
|
||||||
voidfractionFieldName "voidfraction";
|
|
||||||
partNu "partNu";
|
|
||||||
partReynolds "partRe";
|
|
||||||
verbose true;
|
verbose true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user