[cig-commits] r1300 - in trunk/aspect: include/aspect/material_model source/material_model
bangerth at dealii.org
bangerth at dealii.org
Sun Oct 21 09:39:44 PDT 2012
Author: bangerth
Date: 2012-10-21 10:39:43 -0600 (Sun, 21 Oct 2012)
New Revision: 1300
Modified:
trunk/aspect/include/aspect/material_model/simple.h
trunk/aspect/source/material_model/simple.cc
Log:
Make compositional dependency of density a run-time parameter.
Modified: trunk/aspect/include/aspect/material_model/simple.h
===================================================================
--- trunk/aspect/include/aspect/material_model/simple.h 2012-10-19 22:08:29 UTC (rev 1299)
+++ trunk/aspect/include/aspect/material_model/simple.h 2012-10-21 16:39:43 UTC (rev 1300)
@@ -189,6 +189,8 @@
* The thermal conductivity.
*/
double k_value;
+
+ double compositional_delta_rho;
};
}
Modified: trunk/aspect/source/material_model/simple.cc
===================================================================
--- trunk/aspect/source/material_model/simple.cc 2012-10-19 22:08:29 UTC (rev 1299)
+++ trunk/aspect/source/material_model/simple.cc 2012-10-21 16:39:43 UTC (rev 1300)
@@ -121,12 +121,13 @@
const std::vector<double> &compositional_fields, /*composition*/
const Point<dim> &) const
{
- return (this->n_compositional_fields()>0
- ?
- 100.0 * compositional_fields[0] + reference_rho *
- (1 - thermal_alpha * (temperature - reference_T))
- :
- reference_rho * (1 - thermal_alpha * (temperature - reference_T)));
+ return (reference_rho * (1 - thermal_alpha * (temperature - reference_T))
+ +
+ (this->n_compositional_fields()>0
+ ?
+ compositional_delta_rho * compositional_fields[0]
+ :
+ 0));
}
@@ -237,6 +238,17 @@
Patterns::Double (0),
"The value of the thermal expansion coefficient $\\beta$. "
"Units: $1/K$.");
+ prm.declare_entry ("Density differential for compositional field 1", "0",
+ Patterns::Double(),
+ "If compositional fields are used, then one would frequently want "
+ "to make the density depend on these fields. In this simple material "
+ "model, we make the following assumptions: if no compositional fields "
+ "are used in the current simulation, then the density is simply the usual "
+ "one with its linear dependence on the temperature. If there are compositional "
+ "fields, then the density only depends on the first one in such a way that "
+ "the density has an additional term of the kind $+\\Delta \\rho \\; c_1(\\mathbf x)$. "
+ "This parameter describes the value of $\\Delta \\rho$. Units: $kg/m^3/\\textrm{unit "
+ "change in composition}.");
}
prm.leave_subsection();
}
@@ -260,6 +272,7 @@
k_value = prm.get_double ("Thermal conductivity");
reference_specific_heat = prm.get_double ("Reference specific heat");
thermal_alpha = prm.get_double ("Thermal expansion coefficient");
+ compositional_delta_rho = prm.get_double ("Density differential for compositional field 1");
}
prm.leave_subsection();
}
More information about the CIG-COMMITS
mailing list