add default names to chem. models as not to repeat in coup. props.

This commit is contained in:
ekinaci
2017-06-28 15:48:57 +02:00
parent e9f69b08ee
commit 069b824765
4 changed files with 23 additions and 44 deletions

View File

@ -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++)

View File

@ -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)
{} {}

View File

@ -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))
@ -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_);

View File

@ -105,26 +105,14 @@ reactionHeatProps
speciesProps speciesProps
{ {
ChemistryFile "$casePath/CFD/constant/foam.inp"; ChemistryFile "$casePath/CFD/constant/foam.inp";
tempFieldName "T";
partTempName "partTemp";
densityFieldName "rho";
partRhoName "partRho";
voidfractionFieldName "voidfraction";
totalMoleFieldName "N";
partMoleName "partN";
pressureFieldName "p";
partPName "partP";
// verbose true; // verbose true;
// Nevery 1;
} }
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;
} }