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
speciesNames_(specDict_.lookup("species")),
tempFieldName_(propsDict_.lookup("tempFieldName")),
tempFieldName_(propsDict_.lookupOrDefault<word>("tempFieldName","T")),
tempField_(sm.mesh().lookupObject<volScalarField> (tempFieldName_)),
pressureFieldName_(propsDict_.lookup("pressureFieldName")),
pressureFieldName_(propsDict_.lookupOrDefault<word>("pressureFieldName","p")),
P_(sm.mesh().lookupObject<volScalarField>(pressureFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
densityFieldName_(propsDict_.lookupOrDefault<word>("densityFieldName","rho")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
totalMoleFieldName_(propsDict_.lookup("totalMoleFieldName")),
totalMoleFieldName_(propsDict_.lookupOrDefault<word>("totalMoleFieldName","N")),
// needed to calculate the mixture diffusion coefficient
// dcoeff is dependent on molar fraction not mass fraction
N_(sm.mesh().lookupObject<volScalarField>(totalMoleFieldName_)),
@ -81,10 +81,6 @@ diffusionCoefficient::diffusionCoefficient
// X_(speciesNames_.size()),
diffusantGasNames_(propsDict_.lookup("diffusantGasNames")),
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;
for (int i = 0; i < diffusantGasNames_.size(); i++)

View File

@ -56,15 +56,15 @@ massTransferCoeff::massTransferCoeff
verbose_(propsDict_.lookupOrDefault<bool>("verbose",false)),
interpolation_(propsDict_.lookupOrDefault<bool>("interpolation",false)),
mesh_(sm.mesh()),
velFieldName_(propsDict_.lookup("velFieldName")),
velFieldName_(propsDict_.lookupOrDefault<word>("velFieldName","U")),
U_(mesh_.lookupObject<volVectorField>(velFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("voidfractionFieldName","voidfraction")),
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
densityFieldName_(propsDict_.lookupOrDefault<word>("densityFieldName","rho")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
partNuName_(propsDict_.lookup("partNu")),
partNuName_(propsDict_.lookupOrDefault<word>("partViscos","partNu")),
partNu_(NULL),
partReynolds_(propsDict_.lookup("partReynolds")),
partReynolds_(propsDict_.lookupOrDefault<word>("partReynolds","partRe")),
partRe_(NULL)
{}

View File

@ -86,20 +86,20 @@ species::species
mesh_,
dimensionedScalar("zero",dimMass/(dimVol*dimTime),0.0)
),
tempFieldName_(propsDict_.lookup("tempFieldName")),
tempFieldName_(propsDict_.lookupOrDefault<word>("tempFieldName","T")),
tempField_(sm.mesh().lookupObject<volScalarField> (tempFieldName_)),
partTempName_(propsDict_.lookup("partTempName")),
partTempName_(propsDict_.lookupOrDefault<word>("partTempName","partTemp")),
partTemp_(NULL),
densityFieldName_(propsDict_.lookup("densityFieldName")),
densityFieldName_(propsDict_.lookupOrDefault<word>("densityFieldName","rho")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
partRhoName_(propsDict_.lookup("partRhoName")),
partRhoName_(propsDict_.lookupOrDefault<word>("partRhoName","partRho")),
partRho_(NULL),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("voidfractionFieldName","voidfraction")),
voidfraction_(sm.mesh().lookupObject<volScalarField>(voidfractionFieldName_)),
// total mole field
totalMoleFieldName_(propsDict_.lookup("totalMoleFieldName")),
totalMoleFieldName_(propsDict_.lookupOrDefault<word>("totalMoleFieldName","N")),
N_(sm.mesh().lookupObject<volScalarField>(totalMoleFieldName_)),
partMoleName_(propsDict_.lookup("partMoleName")),
partMoleName_(propsDict_.lookupOrDefault<word>("partMoleName","partN")),
partN_(NULL),
loopCounter_(-1),
Nevery_(propsDict_.lookupOrDefault<label>("Nevery",1))
@ -224,7 +224,6 @@ void species::execute()
Yfluid_.setSize(speciesNames_.size());
scalar Nfluid(0);
// defining interpolators for T, rho, voidfraction, N
interpolationCellPoint <scalar> TInterpolator_(tempField_);
interpolationCellPoint <scalar> rhoInterpolator_(rho_);

View File

@ -105,26 +105,14 @@ reactionHeatProps
speciesProps
{
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;
// Nevery 1;
}
diffusionCoefficientsProps
{
verbose true;
ChemistryFile "$casePath/CFD/constant/foam.inp";
tempFieldName "T";
totalMoleFieldName "N";
pressureFieldName "p";
densityFieldName "rho";
diffusantGasNames ( CO
// H2
);
@ -132,10 +120,6 @@ diffusionCoefficientsProps
massTransferCoeffProps
{
velFieldName "U";
voidfractionFieldName "voidfraction";
partNu "partNu";
partReynolds "partRe";
verbose true;
}