ASPECT
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim > Class Template Reference
Inheritance diagram for aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >:
Inheritance graph
[legend]

Public Member Functions

void initialize ()
 
virtual unsigned int number_of_lookups () const
 
bool is_compressible () const
 
void evaluate (const MaterialModel::MaterialModelInputs< dim > &in, std::vector< MaterialModel::EquationOfStateOutputs< dim >> &eos_outputs) const
 
void fill_additional_outputs (const MaterialModel::MaterialModelInputs< dim > &in, const std::vector< std::vector< double >> &volume_fractions, MaterialModel::MaterialModelOutputs< dim > &out) const
 
void parse_parameters (ParameterHandler &prm)
 
void create_additional_named_outputs (MaterialModel::MaterialModelOutputs< dim > &out) const
 
const MaterialModel::MaterialUtilities::Lookup::MaterialLookupget_material_lookup (unsigned int lookup_index) const
 
- Public Member Functions inherited from aspect::SimulatorAccess< dim >
 SimulatorAccess ()
 
 SimulatorAccess (const Simulator< dim > &simulator_object)
 
virtual ~SimulatorAccess ()=default
 
virtual void initialize_simulator (const Simulator< dim > &simulator_object)
 
const Introspection< dim > & introspection () const
 
const Simulator< dim > & get_simulator () const
 
const Parameters< dim > & get_parameters () const
 
SimulatorSignals< dim > & get_signals () const
 
MPI_Comm get_mpi_communicator () const
 
TimerOutput & get_computing_timer () const
 
const ConditionalOStream & get_pcout () const
 
double get_time () const
 
double get_timestep () const
 
double get_old_timestep () const
 
unsigned int get_timestep_number () const
 
const TimeStepping::Manager< dim > & get_timestepping_manager () const
 
unsigned int get_nonlinear_iteration () const
 
const parallel::distributed::Triangulation< dim > & get_triangulation () const
 
double get_volume () const
 
const Mapping< dim > & get_mapping () const
 
std::string get_output_directory () const
 
bool include_adiabatic_heating () const
 
bool include_latent_heat () const
 
bool include_melt_transport () const
 
int get_stokes_velocity_degree () const
 
double get_adiabatic_surface_temperature () const
 
double get_surface_pressure () const
 
bool convert_output_to_years () const
 
unsigned int get_pre_refinement_step () const
 
unsigned int n_compositional_fields () const
 
double get_end_time () const
 
void get_refinement_criteria (Vector< float > &estimated_error_per_cell) const
 
void get_artificial_viscosity (Vector< float > &viscosity_per_cell, const bool skip_interior_cells=false) const
 
void get_artificial_viscosity_composition (Vector< float > &viscosity_per_cell, const unsigned int compositional_variable) const
 
const LinearAlgebra::BlockVectorget_current_linearization_point () const
 
const LinearAlgebra::BlockVectorget_solution () const
 
const LinearAlgebra::BlockVectorget_old_solution () const
 
const LinearAlgebra::BlockVectorget_old_old_solution () const
 
const LinearAlgebra::BlockVectorget_reaction_vector () const
 
const LinearAlgebra::BlockVectorget_mesh_velocity () const
 
const DoFHandler< dim > & get_dof_handler () const
 
const FiniteElement< dim > & get_fe () const
 
const LinearAlgebra::BlockSparseMatrixget_system_matrix () const
 
const LinearAlgebra::BlockSparseMatrixget_system_preconditioner_matrix () const
 
const MaterialModel::Interface< dim > & get_material_model () const
 
const GravityModel::Interface< dim > & get_gravity_model () const
 
const InitialTopographyModel::Interface< dim > & get_initial_topography_model () const
 
const GeometryModel::Interface< dim > & get_geometry_model () const
 
const AdiabaticConditions::Interface< dim > & get_adiabatic_conditions () const
 
bool has_boundary_temperature () const
 
const BoundaryTemperature::Manager< dim > & get_boundary_temperature_manager () const
 
const BoundaryHeatFlux::Interface< dim > & get_boundary_heat_flux () const
 
bool has_boundary_composition () const
 
const BoundaryComposition::Manager< dim > & get_boundary_composition_manager () const
 
const BoundaryTraction::Manager< dim > & get_boundary_traction_manager () const
 
std::shared_ptr< const InitialTemperature::Manager< dim > > get_initial_temperature_manager_pointer () const
 
const InitialTemperature::Manager< dim > & get_initial_temperature_manager () const
 
std::shared_ptr< const InitialComposition::Manager< dim > > get_initial_composition_manager_pointer () const
 
const InitialComposition::Manager< dim > & get_initial_composition_manager () const
 
const std::set< types::boundary_id > & get_fixed_temperature_boundary_indicators () const
 
const std::set< types::boundary_id > & get_fixed_heat_flux_boundary_indicators () const
 
const std::set< types::boundary_id > & get_fixed_composition_boundary_indicators () const
 
const std::set< types::boundary_id > & get_mesh_deformation_boundary_indicators () const
 
const BoundaryVelocity::Manager< dim > & get_boundary_velocity_manager () const
 
const HeatingModel::Manager< dim > & get_heating_model_manager () const
 
const MeshRefinement::Manager< dim > & get_mesh_refinement_manager () const
 
const MeltHandler< dim > & get_melt_handler () const
 
const VolumeOfFluidHandler< dim > & get_volume_of_fluid_handler () const
 
const NewtonHandler< dim > & get_newton_handler () const
 
const MeshDeformation::MeshDeformationHandler< dim > & get_mesh_deformation_handler () const
 
const LateralAveraging< dim > & get_lateral_averaging () const
 
const AffineConstraints< double > & get_current_constraints () const
 
bool simulator_is_past_initialization () const
 
double get_pressure_scaling () const
 
bool pressure_rhs_needs_compatibility_modification () const
 
bool model_has_prescribed_stokes_solution () const
 
TableHandler & get_statistics_object () const
 
const Postprocess::Manager< dim > & get_postprocess_manager () const
 
unsigned int n_particle_managers () const
 
const Particle::Manager< dim > & get_particle_manager (const unsigned int particle_manager_index) const
 
Particle::Manager< dim > & get_particle_manager (const unsigned int particle_manager_index)
 
bool is_stokes_matrix_free ()
 
const StokesMatrixFreeHandler< dim > & get_stokes_matrix_free () const
 
RotationProperties< dim > compute_net_angular_momentum (const bool use_constant_density, const LinearAlgebra::BlockVector &solution, const bool limit_to_top_faces=false) const
 

Static Public Member Functions

static void declare_parameters (ParameterHandler &prm)
 
- Static Public Member Functions inherited from aspect::SimulatorAccess< dim >
static void get_composition_values_at_q_point (const std::vector< std::vector< double >> &composition_values, const unsigned int q, std::vector< double > &composition_values_at_q_point)
 

Private Types

enum  formats { perplex, hefesto }
 

Private Member Functions

void evaluate_thermal_enthalpy_derivatives (const MaterialModel::MaterialModelInputs< dim > &in, std::vector< MaterialModel::EquationOfStateOutputs< dim >> &eos_outputs) const
 
std::array< std::pair< double, unsigned int >, 2 > enthalpy_derivatives (const typename Interface< dim >::MaterialModelInputs &in) const
 
void fill_seismic_velocities (const MaterialModel::MaterialModelInputs< dim > &in, const std::vector< double > &composite_densities, const std::vector< std::vector< double >> &volume_fractions, SeismicAdditionalOutputs< dim > *seismic_out) const
 
void fill_phase_volume_fractions (const MaterialModel::MaterialModelInputs< dim > &in, const std::vector< std::vector< double >> &volume_fractions, NamedAdditionalMaterialOutputs< dim > *phase_volume_fractions_out) const
 
void fill_dominant_phases (const MaterialModel::MaterialModelInputs< dim > &in, const std::vector< std::vector< double >> &volume_fractions, PhaseOutputs< dim > &dominant_phases_out) const
 

Private Attributes

unsigned int n_material_lookups
 
bool use_bilinear_interpolation
 
bool latent_heat
 
std::string data_directory
 
std::vector< std::string > material_file_names
 
std::vector< std::string > derivatives_file_names
 
unsigned int max_latent_heat_substeps
 
enum aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup::formats material_file_format
 
std::vector< std::unique_ptr< MaterialModel::MaterialUtilities::Lookup::MaterialLookup > > material_lookup
 
std::vector< std::string > unique_phase_names
 
std::vector< std::vector< unsigned int > > unique_phase_indices
 
std::vector< std::string > list_of_dominant_phases
 
std::vector< std::vector< unsigned int > > global_index_of_lookup_phase
 

Detailed Description

template<int dim>
class aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >

An equation of state class that reads thermodynamic properties from pressure-temperature tables in input files. These input files can be created using codes such as Perple_X or HeFESTo.

Definition at line 43 of file thermodynamic_table_lookup.h.

Member Enumeration Documentation

§ formats

The format of the provided material files. Currently we support the Perple_X and HeFESTo data formats.

Enumerator
perplex 
hefesto 

Definition at line 127 of file thermodynamic_table_lookup.h.

Member Function Documentation

§ initialize()

template<int dim>
void aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::initialize ( )

Initialization function. Loads the material data and sets up pointers.

§ number_of_lookups()

template<int dim>
virtual unsigned int aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::number_of_lookups ( ) const
virtual

Returns the number of lookups

§ is_compressible()

template<int dim>
bool aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::is_compressible ( ) 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).

§ evaluate()

template<int dim>
void aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::evaluate ( const MaterialModel::MaterialModelInputs< dim > &  in,
std::vector< MaterialModel::EquationOfStateOutputs< dim >> &  eos_outputs 
) const

Function to compute the thermodynamic properties in out given the inputs in in over all evaluation points. This function also fills the mass_fraction and volume_fraction vectors.

§ fill_additional_outputs()

template<int dim>
void aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::fill_additional_outputs ( const MaterialModel::MaterialModelInputs< dim > &  in,
const std::vector< std::vector< double >> &  volume_fractions,
MaterialModel::MaterialModelOutputs< dim > &  out 
) const

Function to fill the seismic velocity and phase volume additional outputs

§ declare_parameters()

template<int dim>
static void aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::declare_parameters ( ParameterHandler &  prm)
static

Declare the parameters this class takes through input files.

§ parse_parameters()

template<int dim>
void aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::parse_parameters ( ParameterHandler &  prm)

Read the parameters this class declares from the parameter file.

§ create_additional_named_outputs()

template<int dim>
void aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::create_additional_named_outputs ( MaterialModel::MaterialModelOutputs< dim > &  out) const

§ get_material_lookup()

template<int dim>
const MaterialModel::MaterialUtilities::Lookup::MaterialLookup& aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::get_material_lookup ( unsigned int  lookup_index) const

§ evaluate_thermal_enthalpy_derivatives()

template<int dim>
void aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::evaluate_thermal_enthalpy_derivatives ( const MaterialModel::MaterialModelInputs< dim > &  in,
std::vector< MaterialModel::EquationOfStateOutputs< dim >> &  eos_outputs 
) const
private

Compute the specific heat and thermal expansivity using the pressure and temperature derivatives of the specific enthalpy. This evaluation incorporates the effects of latent heat production.

§ enthalpy_derivatives()

template<int dim>
std::array<std::pair<double, unsigned int>,2> aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::enthalpy_derivatives ( const typename Interface< dim >::MaterialModelInputs in) const
private

Returns the cell-wise averaged enthalpy derivatives for the evaluate function and postprocessors. The function returns two pairs, the first one represents the temperature derivative, the second one the pressure derivative. The first member of each pair is the derivative, the second one the number of vertex combinations the function could use to compute the derivative. The second member is useful to handle the case no suitable combination of vertices could be found (e.g. if the temperature and pressure on all vertices of the current cell is identical.

§ fill_seismic_velocities()

template<int dim>
void aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::fill_seismic_velocities ( const MaterialModel::MaterialModelInputs< dim > &  in,
const std::vector< double > &  composite_densities,
const std::vector< std::vector< double >> &  volume_fractions,
SeismicAdditionalOutputs< dim > *  seismic_out 
) const
private

§ fill_phase_volume_fractions()

template<int dim>
void aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::fill_phase_volume_fractions ( const MaterialModel::MaterialModelInputs< dim > &  in,
const std::vector< std::vector< double >> &  volume_fractions,
NamedAdditionalMaterialOutputs< dim > *  phase_volume_fractions_out 
) const
private

This function uses the MaterialModelInputs &in to fill the output_values of the phase_volume_fractions_out output object with the volume fractions of each of the unique phases at each of the evaluation points. These volume fractions are obtained from the Perple_X- or HeFESTo-derived pressure-temperature lookup tables. The filled output_values object is a vector of vector<double>; the outer vector is expected to have a size that equals the number of unique phases, the inner vector is expected to have a size that equals the number of evaluation points.

§ fill_dominant_phases()

template<int dim>
void aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::fill_dominant_phases ( const MaterialModel::MaterialModelInputs< dim > &  in,
const std::vector< std::vector< double >> &  volume_fractions,
PhaseOutputs< dim > &  dominant_phases_out 
) const
private

This function uses the MaterialModelInputs &in to fill the output_values of the dominant_phases_out output object with the index of the dominant phase at each of the evaluation points. The phases are obtained from the Perple_X- or HeFESTo-derived pressure-temperature lookup tables. The filled output_values object is a vector of vector<unsigned int>; the outer vector is expected to have a size of 1, the inner vector is expected to have a size that equals the number of evaluation points.

Member Data Documentation

§ n_material_lookups

template<int dim>
unsigned int aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::n_material_lookups
private

Definition at line 106 of file thermodynamic_table_lookup.h.

§ use_bilinear_interpolation

template<int dim>
bool aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::use_bilinear_interpolation
private

Definition at line 107 of file thermodynamic_table_lookup.h.

§ latent_heat

template<int dim>
bool aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::latent_heat
private

Definition at line 108 of file thermodynamic_table_lookup.h.

§ data_directory

template<int dim>
std::string aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::data_directory
private

Information about the location of data files.

Definition at line 113 of file thermodynamic_table_lookup.h.

§ material_file_names

template<int dim>
std::vector<std::string> aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::material_file_names
private

Definition at line 114 of file thermodynamic_table_lookup.h.

§ derivatives_file_names

template<int dim>
std::vector<std::string> aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::derivatives_file_names
private

Definition at line 115 of file thermodynamic_table_lookup.h.

§ max_latent_heat_substeps

template<int dim>
unsigned int aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::max_latent_heat_substeps
private

The maximum number of substeps over the temperature pressure range to calculate the averaged enthalpy gradient over a cell

Definition at line 121 of file thermodynamic_table_lookup.h.

§ material_file_format

§ material_lookup

template<int dim>
std::vector<std::unique_ptr<MaterialModel::MaterialUtilities::Lookup::MaterialLookup> > aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::material_lookup
private

List of pointers to objects that read and process data we get from material data files. There is one pointer/object per lookup file.

Definition at line 137 of file thermodynamic_table_lookup.h.

§ unique_phase_names

template<int dim>
std::vector<std::string> aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::unique_phase_names
private

Vector of strings containing the names of the unique phases in all the material lookups.

Definition at line 142 of file thermodynamic_table_lookup.h.

§ unique_phase_indices

template<int dim>
std::vector<std::vector<unsigned int> > aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::unique_phase_indices
private

Vector of vector of unsigned ints which constitutes mappings between lookup phase name vectors and unique_phase_names. The element unique_phase_indices[i][j] contains the index of phase name j from lookup i as it is found in unique_phase_names.

Definition at line 150 of file thermodynamic_table_lookup.h.

§ list_of_dominant_phases

template<int dim>
std::vector<std::string> aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::list_of_dominant_phases
private

Vector of strings containing the names of the dominant phases in all the material lookups. In case the lookup table contains one string with the dominant phase rather than separate columns with volume fraction for each phase, this vector will be used instead of the unique_phase_names vector above.

Definition at line 158 of file thermodynamic_table_lookup.h.

§ global_index_of_lookup_phase

template<int dim>
std::vector<std::vector<unsigned int> > aspect::MaterialModel::EquationOfState::ThermodynamicTableLookup< dim >::global_index_of_lookup_phase
private

Each lookup table reads in their own dominant phases and assigns indices based on all phases in that particular lookup. Since a model can have more than one lookup, it might have more phases than present in each lookup. We want to output unique/consistent indices for each phase, so we have to convert the indices of a phase in the individual lookup to the index in the global list of phases. This vector of vectors of unsigned int stores the global index for each lookup (so there are as many inner vectors as lookups, and each one stores the indices for an individual lookup, to be filled in the initialize function).

In case the lookup table contains one string with the dominant phase rather than separate columns with volume fraction for each phase, this vector will be used instead of the unique_phase_indices vector above.

Definition at line 174 of file thermodynamic_table_lookup.h.


The documentation for this class was generated from the following file: