[cig-commits] [commit] master: Documentation dump (eb7167b)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon May 19 15:13:33 PDT 2014
Repository : https://github.com/geodynamics/aspect
On branch : master
Link : https://github.com/geodynamics/aspect/compare/ed4caebc0ab942d8c7bc1a6a3ba70e37f93accde...dbe66e1b6d25d5ff21653c48f14f343e10ae69f4
>---------------------------------------------------------------
commit eb7167bd7d3fceaa704a6a9a98a8195cb813ea5f
Author: ian-r-rose <ian.r.rose at gmail.com>
Date: Mon May 19 13:18:45 2014 -0500
Documentation dump
>---------------------------------------------------------------
eb7167bd7d3fceaa704a6a9a98a8195cb813ea5f
include/aspect/material_model/multicomponent.h | 40 ++++++++++++++++++++++++--
source/material_model/multicomponent.cc | 32 ++++++++++++++-------
2 files changed, 60 insertions(+), 12 deletions(-)
diff --git a/include/aspect/material_model/multicomponent.h b/include/aspect/material_model/multicomponent.h
index c7b70d9..1189c42 100644
--- a/include/aspect/material_model/multicomponent.h
+++ b/include/aspect/material_model/multicomponent.h
@@ -111,7 +111,7 @@ namespace aspect
thermal_conductivity_depends_on (const NonlinearDependence::Dependence dependence) const;
/**
- * returns false
+ * This model is not compressible, so this returns false.
*/
virtual bool is_compressible () const;
/**
@@ -154,11 +154,28 @@ namespace aspect
*/
private:
+ /**
+ * From a list of compositional fields of length N, we come up with an N+1
+ * length list that which also includes the fraction of ``background mantle''.
+ * This list should sum to one, and is interpreted as volume fractions. If
+ * the sum of the compositional_fields is greater than one, we assume that there
+ * is no background mantle (i.e., that field value is zero). Otherwise, the
+ * difference between the sum of the compositional fields and 1.0 is assumed to
+ * be the amount of background mantle.
+ */
void compute_volume_fractions( const std::vector<double> &compositional_fields,
std::vector<double> &fractions) const;
-
+ /**
+ * Reference temperature for thermal expansion. All components use the same reference_T.
+ */
double reference_T;
+ /**
+ * Enumeration for selecting which viscosity averaging scheme to use. Select
+ * between Harmonic, Arithmetic, Geometric, and MaximumComposition. The
+ * max composition scheme simply uses the viscosity of whichever field has
+ * the highes volume fraction.
+ */
enum {
Harmonic,
Arithmetic,
@@ -166,10 +183,29 @@ namespace aspect
MaximumComposition
} ViscosityAveraging;
+ /**
+ * Vector for field densities.
+ */
std::vector<double> densities;
+
+ /**
+ * Vector for field viscosities.
+ */
std::vector<double> viscosities;
+
+ /**
+ * Vector for field thermal expnsivities.
+ */
std::vector<double> thermal_expansivities;
+
+ /**
+ * Vector for field thermal conductivities.
+ */
std::vector<double> thermal_conductivities;
+
+ /**
+ * Vector for field specific heats.
+ */
std::vector<double> specific_heats;
};
diff --git a/source/material_model/multicomponent.cc b/source/material_model/multicomponent.cc
index 395695d..6536402 100644
--- a/source/material_model/multicomponent.cc
+++ b/source/material_model/multicomponent.cc
@@ -52,13 +52,13 @@ namespace aspect
if(sum_composition >= 1.0)
{
- fractions[0] = 0.0; //background
+ fractions[0] = 0.0; //background mantle
for ( unsigned int i=1; i <= x_comp.size(); ++i)
fractions[i] = x_comp[i-1]/sum_composition;
}
else
{
- fractions[0] = 1.0 - sum_composition;
+ fractions[0] = 1.0 - sum_composition; //background mantle
for ( unsigned int i=1; i <= x_comp.size(); ++i)
fractions[i] = x_comp[i-1];
}
@@ -120,7 +120,7 @@ namespace aspect
Multicomponent<dim>::
reference_viscosity () const
{
- return viscosities[0];
+ return viscosities[0]; //background
}
template <int dim>
@@ -128,7 +128,7 @@ namespace aspect
Multicomponent<dim>::
reference_density () const
{
- return densities[0];
+ return densities[0]; //background
}
template <int dim>
@@ -136,7 +136,7 @@ namespace aspect
Multicomponent<dim>::
reference_thermal_expansion_coefficient () const
{
- return thermal_expansivities[0];
+ return thermal_expansivities[0]; //background
}
template <int dim>
@@ -149,6 +149,7 @@ namespace aspect
{
double cp = 0.0;
+ //Arithmetic averaging of specific heats
std::vector<double> volume_fractions(this->n_compositional_fields() + 1);
compute_volume_fractions( composition, volume_fractions);
for(unsigned int i=0; i< volume_fractions.size(); ++i)
@@ -162,7 +163,7 @@ namespace aspect
Multicomponent<dim>::
reference_cp () const
{
- return specific_heats[0];
+ return specific_heats[0]; //background
}
template <int dim>
@@ -175,6 +176,10 @@ namespace aspect
{
double k = 0.0;
+ //Arithmetic averaging of thermal conductivities
+ //This may not be strictly the most reasonable thing,
+ //but for most Earth materials we hope that they do
+ //not vary so much that it is a big problem.
std::vector<double> volume_fractions(this->n_compositional_fields() + 1);
compute_volume_fractions( composition, volume_fractions);
for(unsigned int i=0; i< volume_fractions.size(); ++i)
@@ -188,7 +193,7 @@ namespace aspect
Multicomponent<dim>::
reference_thermal_diffusivity () const
{
- return thermal_conductivities[0] /( densities[0]* specific_heats[0] );
+ return thermal_conductivities[0] /( densities[0]* specific_heats[0] ); //background
}
template <int dim>
@@ -201,6 +206,7 @@ namespace aspect
{
double rho = 0.0;
+ //Arithmetic averaging of densities
std::vector<double> volume_fractions(this->n_compositional_fields() + 1);
compute_volume_fractions( composition, volume_fractions);
for(unsigned int i=0; i< volume_fractions.size(); ++i)
@@ -225,6 +231,7 @@ namespace aspect
{
double alpha = 0.0;
+ //Arithmetic averaging of thermal expansivities
std::vector<double> volume_fractions(this->n_compositional_fields() + 1);
compute_volume_fractions( composition, volume_fractions);
for(unsigned int i=0; i< volume_fractions.size(); ++i)
@@ -242,7 +249,7 @@ namespace aspect
const std::vector<double> &, /*composition*/
const Point<dim> &) const
{
- return 0.0;
+ return 0.0; //incompressible
}
template <int dim>
@@ -262,7 +269,6 @@ namespace aspect
Multicomponent<dim>::
density_depends_on (const NonlinearDependence::Dependence dependence) const
{
- // to see the dependencies
if (((dependence & NonlinearDependence::temperature) != NonlinearDependence::none))
return true;
else if (((dependence & NonlinearDependence::compositional_fields) != NonlinearDependence::none))
@@ -452,6 +458,12 @@ namespace aspect
{
ASPECT_REGISTER_MATERIAL_MODEL(Multicomponent,
"multicomponent",
- "'Multicomponent model'.")
+ "'Multicomponent model'. This model is for use with an arbitrary number of"
+ "compositional fields, where each field may have completely different material"
+ "parameters. Within each field, however, the material behaviour is very simple,"
+ "with constant material coefficients. When more than one field is present, the"
+ "material properties are averaged arithmetically. An exception is the viscosity,"
+ "where the averaging should make more of a difference. For this, the user selects"
+ "between arithmetic, harmonic, geometric, or maximum composition averaging.")
}
}
More information about the CIG-COMMITS
mailing list