aragog.phase
phase
A phase defines the equation of state (EOS) and transport properties.
FloatOrArray = float | npt.NDArray
module-attribute
logger = logging.getLogger(__name__)
module-attribute
CompositePhaseEvaluator(parameters)
Bases: PhaseEvaluatorABC
Evaluates the EOS and transport properties of a composite phase.
This combines the single phase evaluators for the liquid and solid regions with the mixed phase evaluator for the mixed phase region. This ensure that the phase properties are computed correctly for all temperatures and pressures.
Args: parameters: Parameters
Source code in aragog/phase.py
521 522 523 524 525 526 527 528 529 | |
delta_specific_volume()
Difference of specific volume between melt and solid
Source code in aragog/phase.py
638 639 640 641 | |
heat_capacity()
Heat capacity
Source code in aragog/phase.py
592 593 594 595 | |
latent_heat()
Latent heat of fusion
Source code in aragog/phase.py
608 609 610 611 | |
melt_fraction()
Melt fraction
Source code in aragog/phase.py
603 604 605 606 | |
relative_velocity()
Relative velocity between melt and solid
Source code in aragog/phase.py
633 634 635 636 | |
set_pressure(pressure)
Sets pressure and updates quantities that only depend on pressure
Source code in aragog/phase.py
538 539 540 541 542 543 544 | |
thermal_conductivity()
Thermal conductivity
Source code in aragog/phase.py
619 620 621 622 | |
thermal_expansivity()
Thermal expansivity
Source code in aragog/phase.py
624 625 626 627 | |
viscosity()
Viscosity
Source code in aragog/phase.py
629 630 631 | |
ConstantProperty(name, *, value)
dataclass
Bases: PropertyProtocol
A property with a constant value
Args: name: Name of the property value: The constant value
Attributes: name: Name of the property value: The constant value ndim: Number of dimensions, which is equal to zero for a constant property
LookupProperty1D(name, *, value)
dataclass
Bases: PropertyProtocol
A property from a 1-D lookup
Args: name: Name of the property value: A 2-D array, with x values in the first column and y values in the second column.
Attributes: name: Name of the property value: A 2-D array ndim: Number of dimensions, which is equal to one for a 1-D lookup
gradient(pressure)
Computes the gradient
Source code in aragog/phase.py
114 115 116 | |
LookupProperty2D(name, *, value)
dataclass
Bases: PropertyProtocol
A property from a 2-D lookup
Args: name: Name of the property value: The 2-D array
Attributes: name: Name of the property value: The 2-D array ndim: Number of dimensions, which is equal to two for a 2-D lookup
prepare_data_for_spline(data)
Ensure your data is on a regular grid for RectBivariateSpline
Source code in aragog/phase.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
MixedPhaseEvaluator(parameters)
Bases: PhaseEvaluatorABC
Evaluates the EOS and transport properties of a mixed phase.
This only computes quantities within the mixed phase region between the solidus and the liquidus. Computing quantities outside of this region will give incorrect results.
Args: parameters: Parameters
Attributes: settings: Mixed phase parameters
Source code in aragog/phase.py
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | |
dTdPs()
TODO: Update reference to sphinx: Solomatov (2007), Treatise on Geophysics, Eq. 3.2
Source code in aragog/interfaces.py
107 108 109 110 111 112 113 | |
delta_specific_volume()
Difference of specific volume between melt and solid
Source code in aragog/phase.py
447 448 449 450 | |
heat_capacity()
Heat capacity of the mixed phase :cite:p:{Equation 4,}SOLO07
Source code in aragog/phase.py
372 373 374 375 | |
latent_heat()
Latent heat of fusion
Source code in aragog/phase.py
400 401 402 403 | |
liquidus()
Liquidus
Source code in aragog/phase.py
377 378 379 380 381 382 | |
liquidus_gradient()
Liquidus gradient
Source code in aragog/phase.py
384 385 386 | |
melt_fraction()
Melt fraction of the mixed phase
The melt fraction is always between zero and one.
Source code in aragog/phase.py
392 393 394 395 396 397 398 | |
melt_fraction_no_clip()
Melt fraction without clipping
Source code in aragog/phase.py
388 389 390 | |
porosity()
Porosity of the mixed phase, that is the volume fraction occupied by the melt
Source code in aragog/phase.py
405 406 407 | |
relative_velocity()
Relative velocity between melt and solid
Source code in aragog/phase.py
432 433 434 435 | |
set_pressure(pressure)
Sets pressure and updates quantities that only depend on pressure
Source code in aragog/phase.py
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | |
set_temperature(temperature)
Sets the temperature.
Source code in aragog/interfaces.py
91 92 93 94 | |
solidus()
Solidus
Source code in aragog/phase.py
409 410 411 412 413 414 | |
solidus_gradient()
Solidus gradient
Source code in aragog/phase.py
416 417 418 | |
MixedPhaseEvaluatorProtocol
Parameters(*, boundary_conditions, energy, initial_condition, mesh, phase_solid, phase_liquid, phase_mixed, radionuclides, scalings, solver)
dataclass
Assembles all the parameters.
The parameters in each section are scaled here to ensure that all the parameters are scaled (non-dimensionalised) consistently with each other.
from_file(*filenames)
classmethod
Parses the parameters in a configuration file(s)
Args: *filenames: Filenames of the configuration data
Source code in aragog/parser.py
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | |
radionuclide_sections(parser)
staticmethod
Section names relating to radionuclides
Sections relating to radionuclides must have the prefix radionuclide_
Source code in aragog/parser.py
499 500 501 502 503 504 505 506 507 508 509 | |
PhaseEvaluatorABC
Bases: ABC
Phase evaluator ABC
dTdPs()
TODO: Update reference to sphinx: Solomatov (2007), Treatise on Geophysics, Eq. 3.2
Source code in aragog/interfaces.py
107 108 109 110 111 112 113 | |
set_pressure(pressure)
Sets the pressure.
Source code in aragog/interfaces.py
96 97 98 99 | |
set_temperature(temperature)
Sets the temperature.
Source code in aragog/interfaces.py
91 92 93 94 | |
update()
Updates quantities to avoid repeat, possibly expensive, calculations.
Source code in aragog/interfaces.py
101 102 | |
PhaseEvaluatorCollection(parameters)
dataclass
A collection of phase evaluators
Creates the phase evaluators and selects the active phase based on configuration data.
Args: parameters: Parameters
Attributes: liquid: Liquid evaluator solid: Solid evaluator mixed: Mixed evaluator composite: Composite evaluator active: The active evaluator, which is defined by configuration data
PhaseEvaluatorProtocol
PropertyProtocol
SinglePhaseEvaluator(settings, gravitational_acceleration)
Bases: PhaseEvaluatorABC
Contains the objects to evaluate the EOS and transport properties of a phase.
Args: settings: Phase parameters gravitational_acceleration: PropertyProtocol
Source code in aragog/phase.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
dTdPs()
TODO: Update reference to sphinx: Solomatov (2007), Treatise on Geophysics, Eq. 3.2
Source code in aragog/interfaces.py
107 108 109 110 111 112 113 | |
set_pressure(pressure)
Sets the pressure.
Source code in aragog/interfaces.py
96 97 98 99 | |
set_temperature(temperature)
Sets the temperature.
Source code in aragog/interfaces.py
91 92 93 94 | |
update()
Updates quantities to avoid repeat, possibly expensive, calculations.
Source code in aragog/interfaces.py
101 102 | |
_PhaseMixedParameters(latent_heat_of_fusion, rheological_transition_melt_fraction, rheological_transition_width, solidus, liquidus, phase, phase_transition_width, grain_size)
dataclass
Stores settings in the phase_mixed section in the configuration data.
scale_attributes(scalings)
Scales the attributes
Args: scalings: scalings
Source code in aragog/parser.py
323 324 325 326 327 328 329 330 331 | |
_PhaseParameters(density, heat_capacity, melt_fraction, thermal_conductivity, thermal_expansivity, viscosity)
dataclass
Stores settings in a phase section in the configuration data.
This is used to store settings from phase_liquid and phase_solid.
scale_attributes(scalings)
Scales the attributes if they are numbers.
Args: scalings: scalings
Source code in aragog/parser.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | |
combine_properties(weight, property1, property2)
Linear weighting of two quantities.
Args: weight: The weight to apply to property1 property1: The value of the first property property2: The value of the second property
Returns: The combined (weighted) property
Source code in aragog/utilities.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
is_file(value)
Checks if value is a file.
Args: value: Object to be checked
Returns: True if the value is a file, otherwise False
Source code in aragog/utilities.py
50 51 52 53 54 55 56 57 58 59 60 61 62 | |
is_number(value)
Checks if value is a number.
Args: value: Object to be checked
Returns: True if the value is a number, otherwise False
Source code in aragog/utilities.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
setup_gravitational_acceleration(parameters)
Sets up the gravitational acceleration property.
Args: parameters: Parameters
Returns: gravitational_acceleration: PropertyProtocol
Source code in aragog/phase.py
754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 | |
tanh_weight(value, threshold, width)
Computes the tanh weight for viscosity profile and smoothing.
Args: value: Value threshold: Threshold value width: Width of smoothing
Returns: weight
Source code in aragog/utilities.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |