[cig-commits] commit 1991 by bangerth to /var/svn/dealii/aspect
dealii.demon at gmail.com
dealii.demon at gmail.com
Fri Oct 25 05:48:51 PDT 2013
Revision 1991
If cantera is not available, do not instantiate the plugin.
U trunk/aspire/source/material_model/cantera.cc
http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=1991&peg=1991
Diff:
Modified: trunk/aspire/source/material_model/cantera.cc
===================================================================
--- trunk/aspire/source/material_model/cantera.cc 2013-10-21 18:55:09 UTC (rev 1990)
+++ trunk/aspire/source/material_model/cantera.cc 2013-10-25 12:48:13 UTC (rev 1991)
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2011, 2012 by the authors of the ASPECT code.
+ Copyright (C) 2011, 2012, 2013 by the authors of the ASPECT code.
This file is part of ASPECT.
@@ -37,15 +37,15 @@
delete net;
delete transport;
}
-
+
template <int dim>
void
Cantera<dim>::evaluate (const MaterialModelInputs &in, MaterialModelOutputs &out) const
{
Assert (in.composition[0].size () >= 1, ExcMessage ("Need compositional field!"));
-
+
const unsigned int n_species = ideal_gas_mix->nSpecies ();
-
+
for (unsigned int q = 0; q < out.viscosities.size (); ++q)
{
ideal_gas_mix->setState_TPY (in.temperature[q], reference_pressure, &in.composition[q][0]);
@@ -58,15 +58,15 @@
out.viscosities[q] = transport->viscosity ();
}
}
-
+
template <int dim>
void
Cantera<dim>::react (const MaterialModelInputs &in, MaterialModelOutputs &out) const
{
Assert (in.composition[0].size () >= 1, ExcMessage ("Need compositional field!"));
-
+
const unsigned int n_species = ideal_gas_mix->nSpecies ();
-
+
for (unsigned int q = 0; q < out.viscosities.size (); ++q)
{
ideal_gas_mix->setState_TPY (in.temperature[q], reference_pressure, &in.composition[q][0]);
@@ -74,13 +74,13 @@
ideal_gas_mix->getEnthalpy_RT (enthalpy_RT);
ideal_gas_mix->getNetProductionRates (net);
out.thermal_sources[q] = 0.0;
-
+
for (unsigned int i = 0; i < n_species; ++i)
{
out.compositional_sources[q][i] = in.time_step * molar_mass[i] * net[i] / out.densities[q];
out.thermal_sources[q] += out.compositional_sources[q][i];
}
-
+
out.thermal_sources[q] *= -1.0 * ideal_gas_mix->enthalpy_mass () / ideal_gas_mix->entropy_mass ();
}
}
@@ -139,7 +139,7 @@
{
if ((dependence == NonlinearDependence::temperature) || (dependence == NonlinearDependence::pressure) || (dependence == NonlinearDependence::compositional_fields))
return true;
-
+
else
return false;
}
@@ -151,7 +151,7 @@
{
if ((dependence == NonlinearDependence::temperature) || (dependence == NonlinearDependence::pressure) || (dependence == NonlinearDependence::compositional_fields))
return true;
-
+
else
return false;
}
@@ -162,7 +162,7 @@
{
if ((dependence == NonlinearDependence::temperature) || (dependence == NonlinearDependence::pressure) || (dependence == NonlinearDependence::compositional_fields))
return true;
-
+
else
return false;
}
@@ -173,7 +173,7 @@
{
if ((dependence == NonlinearDependence::temperature) || (dependence == NonlinearDependence::pressure) || (dependence == NonlinearDependence::compositional_fields))
return true;
-
+
else
return false;
}
@@ -184,7 +184,7 @@
{
if ((dependence == NonlinearDependence::temperature) || (dependence == NonlinearDependence::pressure) || (dependence == NonlinearDependence::compositional_fields))
return true;
-
+
else
return false;
}
@@ -230,14 +230,14 @@
reference_thermal_alpha = prm.get_double ("Reference thermal expansion coefficient");
reference_thermal_conductivity = prm.get_double ("Reference thermal conductivity");
ideal_gas_mix = new ::Cantera::IdealGasMix (prm.get ("XML file"));
-
+
const unsigned int n_species = ideal_gas_mix->nSpecies ();
-
+
composition_names.resize (n_species);
-
+
for (unsigned int i = 0; i < n_species; ++i)
composition_names[i] = ideal_gas_mix->speciesName (i);
-
+
enthalpy_RT = new double[n_species];
molar_mass.resize (n_species);
ideal_gas_mix->getMolecularWeights (molar_mass);
@@ -248,20 +248,19 @@
}
prm.leave_subsection ();
}
-
+
template <int dim>
void
Cantera<dim>::get_composition_names (std::vector<std::string>& names) const
{
AssertDimension (names.size (), composition_names.size ());
-
+
for (unsigned int i = 0; i < composition_names.size (); ++i)
names[i] = composition_names[i];
}
}
}
-#endif
// explicit instantiations
namespace aspect
@@ -274,3 +273,5 @@
}
}
+#endif
+
More information about the CIG-COMMITS
mailing list