Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add multicomponent equation of state
- Loading branch information
Showing
12 changed files
with
376 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
include/aspect/material_model/equation_of_state/multicomponent_incompressible.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/* | ||
Copyright (C) 2011 - 2019 by the authors of the ASPECT code. | ||
This file is part of ASPECT. | ||
ASPECT 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 2, or (at your option) | ||
any later version. | ||
ASPECT 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 ASPECT; see the file LICENSE. If not see | ||
<http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef _aspect_material_model_equation_of_state_multicomponent_incompressible_h | ||
#define _aspect_material_model_equation_of_state_multicomponent_incompressible_h | ||
|
||
#include <aspect/material_model/interface.h> | ||
#include <aspect/simulator_access.h> | ||
#include <aspect/material_model/equation_of_state/interface.h> | ||
|
||
|
||
namespace aspect | ||
{ | ||
namespace MaterialModel | ||
{ | ||
namespace EquationOfState | ||
{ | ||
using namespace dealii; | ||
|
||
/** | ||
* An incompressible equation of state that is intended for use with multiple compositional | ||
* fields. For each material property, the user supplies a comma delimited list of | ||
* length N+1, where N is the number of compositional fields used in the computation. | ||
* The first entry corresponds to the "background" (which is also why there are N+1 entries). | ||
* | ||
* If a single value is given, then all the compositional fields are given | ||
* that value. Other lengths of lists are not allowed. For a given | ||
* compositional field the material parameters are treated as constant, | ||
* except density, which varies linearly with temperature according to the equation: | ||
* | ||
* $\rho(p,T,\mathfrak c) = \left(1-\alpha_i (T-T_0)\right) \rho_0(\mathfrak c_i).$ | ||
* | ||
* There is no pressure-dependence of the density. | ||
*/ | ||
template <int dim> | ||
class MulticomponentIncompressible : public ::aspect::SimulatorAccess<dim> | ||
{ | ||
public: | ||
/** | ||
* A function that computes the output of the equation of state @p out | ||
* for all compositions, given the inputs in @p in and an index q that | ||
* determines which entry of the vector of inputs is used. | ||
*/ | ||
void evaluate(const MaterialModel::MaterialModelInputs<dim> &in, | ||
const unsigned int q, | ||
MaterialModel::EquationOfStateOutputs<dim> &out) const; | ||
|
||
/** | ||
* Return whether the model is compressible or not. Incompressibility | ||
* does not necessarily imply that the density is constant; rather, it | ||
* may still depend on temperature or pressure. In the current | ||
* context, compressibility means whether we should solve the continuity | ||
* equation as $\nabla \cdot (\rho \mathbf u)=0$ (compressible Stokes) | ||
* or as $\nabla \cdot \mathbf{u}=0$ (incompressible Stokes). | ||
*/ | ||
bool is_compressible () const; | ||
|
||
/** | ||
* Declare the parameters this class takes through input files. | ||
* The optional parameter @p n_compositions determines the maximum | ||
* number of compositions the equation of state is set up with, | ||
* in other words, how many compositional fields influence the | ||
* density. | ||
*/ | ||
static | ||
void | ||
declare_parameters (ParameterHandler &prm, | ||
const double default_thermal_expansion = 3.5e-5); | ||
|
||
/** | ||
* Read the parameters this class declares from the parameter file. | ||
* The optional parameter @p n_compositions determines the maximum | ||
* number of compositions the equation of state is set up with, | ||
* and should have the same value as the parameter with the same | ||
* name in the declare_parameters() function. | ||
*/ | ||
void | ||
parse_parameters (ParameterHandler &prm); | ||
|
||
|
||
private: | ||
// Vector of reference densities $\rho_0$ with one entry per composition, | ||
// used in the computation of the density. | ||
std::vector<double> densities; | ||
|
||
// The reference temperature $T_0$ used in the computation of the density. | ||
// All component use the same reference temperature. | ||
double reference_T; | ||
|
||
// Vector of constant thermal expansivities $\alpha$ with one entry per composition, | ||
// used in the computation of the density. | ||
std::vector<double> thermal_expansivities; | ||
|
||
// Vector of specific heat capacities with one entry per composition. | ||
std::vector<double> specific_heats; | ||
}; | ||
} | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.