Permalink
Browse files

Added Compact splitting for unsteady solvers

  • Loading branch information...
1 parent 916d73b commit b9f1290184cb885c6f1972eaa499e1120146168d @acuoci committed Dec 15, 2016
View
@@ -1,8 +1,8 @@
#OpenFOAM VERSION (22, 23, 24, 30)
-export OPENFOAM_VERSION='-DOPENFOAM_VERSION=30'
+export OPENFOAM_VERSION='-DOPENFOAM_VERSION=24'
#Compulsory path
-export EIGEN_LIBRARY_PATH=/software/chimica2/libraries/eigen/eigen-3.3-dev
+export EIGEN_LIBRARY_PATH=/software/chimica2/libraries/eigen/eigen-3.3.1
export BOOST_LIBRARY_PATH=/software/chimica2/libraries/boost/boost-1.60.0-gcc-4.8.2
export RAPIDXML_LIBRARY_PATH=/software/chimica2/libraries/rapidxml/rapidxml-1.13
View
@@ -2,7 +2,7 @@
export OPENFOAM_VERSION='-DOPENFOAM_VERSION=30'
#Compulsory path
-export EIGEN_LIBRARY_PATH=/software/chimica2/libraries/eigen/eigen-3.3-dev
+export EIGEN_LIBRARY_PATH=/software/chimica2/libraries/eigen/eigen-3.3.1
export BOOST_LIBRARY_PATH=/software/chimica2/libraries/boost/boost-1.60.0-gcc-4.8.2
export RAPIDXML_LIBRARY_PATH=/software/chimica2/libraries/rapidxml/rapidxml-1.13
View
@@ -1,8 +1,8 @@
#OpenFOAM VERSION (22, 23, 24, 30)
-export OPENFOAM_VERSION='-DOPENFOAM_VERSION=30'
+export OPENFOAM_VERSION='-DOPENFOAM_VERSION=24'
#Compulsory path
-export EIGEN_LIBRARY_PATH=/software/chimica2/libraries/eigen/eigen-3.3-dev
+export EIGEN_LIBRARY_PATH=/software/chimica2/libraries/eigen/eigen-3.3.1
export BOOST_LIBRARY_PATH=/software/chimica2/libraries/boost/boost-1.60.0-gcc-4.8.2
export RAPIDXML_LIBRARY_PATH=/software/chimica2/libraries/rapidxml/rapidxml-1.13
@@ -43,6 +43,8 @@ PhysicalModel
zMixEquation on;
tauEquation on;
zMixDmixSpecies N2;
+
+ minTemperature4Chemistry 0;
}
Output
@@ -28,7 +28,7 @@ SteadyState
propertiesUpdate 10;
implicitSourceTerm true;
orderSpecies "sweep";
- exceptionalSpecies (none );
+ exceptionalSpecies ( none );
}
PhysicalModel
@@ -53,6 +53,8 @@ PhysicalModel
zMixEquation on;
tauEquation on;
zMixDmixSpecies N2;
+
+ minTemperature4Chemistry 0;
}
Radiation
@@ -43,6 +43,8 @@ PhysicalModel
zMixEquation on;
tauEquation on;
zMixDmixSpecies N2;
+
+ minTemperature4Chemistry 0;
}
Radiation
@@ -53,6 +53,8 @@ PhysicalModel
zMixEquation on;
tauEquation on;
zMixDmixSpecies N2;
+
+ minTemperature4Chemistry 0;
}
Radiation
@@ -43,6 +43,8 @@ PhysicalModel
zMixEquation on;
tauEquation on;
zMixDmixSpecies N2;
+
+ minTemperature4Chemistry 0;
}
Output
@@ -53,6 +53,8 @@ PhysicalModel
zMixEquation on;
tauEquation on;
zMixDmixSpecies N2;
+
+ minTemperature4Chemistry 0;
}
Output
@@ -53,6 +53,8 @@ PhysicalModel
zMixEquation on;
tauEquation on;
zMixDmixSpecies N2;
+
+ minTemperature4Chemistry 0;
}
Output
@@ -88,6 +88,10 @@
{
#include "Policy_ReactionTransport.H"
}
+ else if (strangAlgorithm == STRANG_COMPACT)
+ {
+ #include "Policy_Compact.H"
+ }
}
else
{
@@ -98,7 +102,11 @@
else if (strangAlgorithm == STRANG_MOMENTUM_REACTION_TRANSPORT)
{
#include "Policy_MomentumReactionTransport.H"
- }
+ }
+ else if (strangAlgorithm == STRANG_COMPACT)
+ {
+ #include "Policy_MomentumCompact.H"
+ }
}
// Passive scalars
@@ -88,6 +88,10 @@
{
#include "Policy_ReactionTransport.H"
}
+ else if (strangAlgorithm == STRANG_COMPACT)
+ {
+ #include "Policy_Compact.H"
+ }
}
else
{
@@ -98,6 +102,10 @@
else if (strangAlgorithm == STRANG_MOMENTUM_REACTION_TRANSPORT)
{
#include "Policy_MomentumReactionTransport.H"
+ }
+ else if (strangAlgorithm == STRANG_COMPACT)
+ {
+ #include "Policy_MomentumCompact.H"
}
}
@@ -84,6 +84,10 @@
{
#include "Policy_ReactionTransport.H"
}
+ else if (strangAlgorithm == STRANG_COMPACT)
+ {
+ #include "Policy_Compact.H"
+ }
}
else
{
@@ -94,6 +98,10 @@
else if (strangAlgorithm == STRANG_MOMENTUM_REACTION_TRANSPORT)
{
#include "Policy_MomentumReactionTransport.H"
+ }
+ else if (strangAlgorithm == STRANG_COMPACT)
+ {
+ #include "Policy_MomentumCompact.H"
}
}
@@ -102,6 +102,10 @@
{
#include "Policy_ReactionTransport.H"
}
+ else if (strangAlgorithm == STRANG_COMPACT)
+ {
+ #include "Policy_Compact.H"
+ }
}
else
{
@@ -112,6 +116,10 @@
else if (strangAlgorithm == STRANG_MOMENTUM_REACTION_TRANSPORT)
{
#include "Policy_MomentumReactionTransport.H"
+ }
+ else if (strangAlgorithm == STRANG_COMPACT)
+ {
+ #include "Policy_MomentumCompact.H"
}
}
@@ -46,6 +46,7 @@ PtrList<volScalarField> X(thermodynamicsMapXML->NumberOfSpecies());
PtrList<volScalarField> Dmix(thermodynamicsMapXML->NumberOfSpecies());
PtrList<volScalarField> CpSpecies(thermodynamicsMapXML->NumberOfSpecies());
PtrList<volScalarField> FormationRates(outputFormationRatesIndices.size());
+PtrList<volScalarField> RR(thermodynamicsMapXML->NumberOfSpecies());
#if STEADYSTATE == 1
PtrList<volScalarField> sourceImplicit(thermodynamicsMapXML->NumberOfSpecies()+1);
@@ -152,6 +153,26 @@ for(int i=0;i<thermodynamicsMapXML->NumberOfSpecies();i++)
dimensionSet(0, 0, 0, 0, 0)
)
);
+
+ #if STEADYSTATE == 0
+ RR.set
+ (
+ i,
+ new volScalarField
+ (
+ IOobject
+ (
+ "thermo_RR_"+ thermodynamicsMapXML->NamesOfSpecies()[i],
+ mesh.time().timeName(),
+ mesh,
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ mesh,
+ dimensionedScalar("RR", dimensionSet(1, -3, -1, 0, 0), 0.0)
+ )
+ );
+ #endif
}
// check if field exists and can be read
@@ -211,6 +232,25 @@ for(int i=0;i<thermodynamicsMapXML->NumberOfSpecies();i++)
}
}
+#if STEADYSTATE == 0
+
+Info<< "Creating field RT\n" << endl;
+volScalarField RT
+(
+ IOobject
+ (
+ "RT",
+ runTime.timeName(),
+ mesh,
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ mesh,
+ dimensionedScalar("RT", dimensionSet(1, -1, -3, 0, 0), 0.0)
+);
+
+#endif
+
#if STEADYSTATE == 1
for (int i=0;i<thermodynamicsMapXML->NumberOfSpecies();i++)
@@ -90,7 +90,7 @@ const dictionary& kineticsDictionary = solverOptions.subDict("Kinetics");
scalar massFractionsTol = 1e-10;
//- Internal models
-enum { STRANG_MOMENTUM_TRANSPORT_REACTION, STRANG_MOMENTUM_REACTION_TRANSPORT} strangAlgorithm;
+enum { STRANG_MOMENTUM_TRANSPORT_REACTION, STRANG_MOMENTUM_REACTION_TRANSPORT, STRANG_COMPACT } strangAlgorithm;
enum { DIFFUSIVITY_MODEL_MULTICOMPONENT, DIFFUSIVITY_MODEL_LEWIS_NUMBERS} diffusivityModel;
// Physical model
@@ -122,7 +122,7 @@ const dictionary& physicalModelDictionary = solverOptions.subDict("PhysicalModel
homogeneousReactions = Switch(physicalModelDictionary.lookup(word("homogeneousReactions")));
includeDpDt = Switch(physicalModelDictionary.lookup(word("includeDpDt")));
iMassDiffusionInEnergyEquation = Switch(physicalModelDictionary.lookup(word("massDiffusionInEnergyEquation")));
- //direct_integration_minimum_temperature_for_chemistry = readScalar(physicalModelDictionary.lookup("minTemperature4Chemistry"));
+ direct_integration_minimum_temperature_for_chemistry = readScalar(physicalModelDictionary.lookup("minTemperature4Chemistry"));
// Thermophoretic effect
thermophoreticEffect = Switch(physicalModelDictionary.lookup(word("thermophoreticEffect")));
@@ -142,9 +142,10 @@ const dictionary& physicalModelDictionary = solverOptions.subDict("PhysicalModel
word strang(physicalModelDictionary.lookup("strangAlgorithm"));
if (strang == "MomentumTransportReaction") strangAlgorithm = STRANG_MOMENTUM_TRANSPORT_REACTION;
else if (strang == "MomentumReactionTransport") strangAlgorithm = STRANG_MOMENTUM_REACTION_TRANSPORT;
+ else if (strang == "Compact") strangAlgorithm = STRANG_COMPACT;
else
{
- Info << "Wrong strangAlgorithm option: MomentumTransportReaction || MomentumReactionTransport" << endl;
+ Info << "Wrong strangAlgorithm option: MomentumTransportReaction || MomentumReactionTransport || Compact" << endl;
abort();
}
}
@@ -104,6 +104,8 @@ private:
OpenSMOKE::DRG* drg_;
bool drgAnalysis_;
+
+ bool debug_;
};
unsigned int BatchReactorHomogeneousConstantPressure::NumberOfEquations() const
@@ -133,6 +135,7 @@ BatchReactorHomogeneousConstantPressure::BatchReactorHomogeneousConstantPressure
energyEquation_ = true;
isat_ = false;
drgAnalysis_ = false;
+ debug_ = false;
}
void BatchReactorHomogeneousConstantPressure::SetReactor( const double P0 )
@@ -203,7 +206,7 @@ int BatchReactorHomogeneousConstantPressure::Equations(const double t, const Ope
kineticsMap_.KineticConstants();
kineticsMap_.ReactionRates(c_);
kineticsMap_.FormationRates(&R_);
-
+
// Species equations
for (unsigned int i=1;i<=NC_;++i)
dy[i] = thermodynamicsMap_.MW()[i]*R_[i]/rho_;
@@ -223,6 +226,29 @@ int BatchReactorHomogeneousConstantPressure::Equations(const double t, const Ope
// ISAT Equation
if (isat_ == true)
dy[NC_+2] = 0.;
+
+ if (debug_ == true)
+ {
+ Info << " * T: " << T_ << endl;
+ Info << " * P: " << P0_ << endl;
+ for(unsigned int i=0;i<NC_;i++)
+ Info << " * " << thermodynamicsMap_.NamesOfSpecies()[i] << ": " << omega_[i+1] << endl;
+
+ Info << " * cTot: " << cTot_ << endl;
+ Info << " * xsum: " << x_.SumElements() << endl;
+ Info << " * MW: " << MW_ << endl;
+
+ double sum = 0.;
+ for(unsigned int i=0;i<NC_;i++)
+ {
+ Info << " * " << thermodynamicsMap_.NamesOfSpecies()[i] << ": " << thermodynamicsMap_.MW()[i+1]*R_[i+1] << endl;
+ sum += thermodynamicsMap_.MW()[i+1]*R_[i+1];
+ }
+ Info << " * sum: " << sum << endl;
+
+ Info << " * Cp: " << CpMixMass_ << endl;
+ Info << " * QR: " << QR_ << endl;
+ }
}
else
{
@@ -0,0 +1,43 @@
+/*-----------------------------------------------------------------------*\
+| |
+| ╔═══╦═╗╔═╦═══╦╗╔═╦═══╗ |
+| ║╔═╗║║╚╝║║╔═╗║║║╔╣╔══╝ |
+| ╔╗╔══╦╗╔╦╦═╗╔══╦═╣╚══╣╔╗╔╗║║ ║║╚╝╝║╚══╗ |
+| ║║║╔╗║╚╝╠╣╔╗╣╔╗║╔╩══╗║║║║║║║ ║║╔╗║║╔══╝ |
+| ║╚╣╔╗║║║║║║║║╔╗║║║╚═╝║║║║║║╚═╝║║║╚╣╚══╗ |
+| ╚═╩╝╚╩╩╩╩╩╝╚╩╝╚╩╝╚═══╩╝╚╝╚╩═══╩╝╚═╩═══╝ |
+| |
+| |
+| Authors: A. Cuoci |
+| |
+| Contacts: Alberto Cuoci |
+| email: alberto.cuoci@polimi.it |
+| Department of Chemistry, Materials and Chemical Engineering |
+| Politecnico di Milano |
+| P.zza Leonardo da Vinci 32, 20133 Milano (Italy) |
+| |
+|-------------------------------------------------------------------------|
+| |
+| This file is part of laminarSMOKE solver. |
+| |
+| License |
+| |
+| Copyright(C) 2016, 2015, 2014 A. Cuoci |
+| laminarSMOKE 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. |
+| |
+| laminarSMOKE 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 laminarSMOKE. If not, see <http://www.gnu.org/licenses/>. |
+| |
+\*-----------------------------------------------------------------------*/
+
+{
+ #include "Policy_ReactionTransport.H"
+}
Oops, something went wrong.

0 comments on commit b9f1290

Please sign in to comment.