aragog.mesh
mesh
Mesh
FloatOrArray = float | npt.NDArray
module-attribute
logger = logging.getLogger(__name__)
module-attribute
AdamsWilliamsonEOS(settings, basic_radii)
Bases: EOS
Adams-Williamson equation of state (EOS).
EOS due to adiabatic self-compression from the definition of the adiabatic bulk modulus:
where \(\rho\) is density, \(K_S\) the adiabatic bulk modulus, and \(S\) is entropy.
Source code in aragog/mesh.py
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | |
basic_density
property
Density at basic nodes
basic_pressure
property
Pressure at basic nodes
staggered_effective_density
property
Effective density at staggered nodes
staggered_pressure
property
Pressure at staggered nodes
get_density(pressure)
Computes density from pressure:
where \(\rho\) is density, \(P\) is pressure, \(\rho_s\) is surface density, and \(K_S\) is adiabatic bulk modulus.
Args: pressure: Pressure
Returns: Density
Source code in aragog/mesh.py
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | |
get_density_from_radii(radii)
Computes density from radii:
$$ \rho(r) = \frac{\rho_s K_S}{K_S + \rho_s g (r-r_s)} $$ where \(\rho\) is density, \(r\) is radius, \(\rho_s\) is surface density, \(K_S\) is adiabatic bulk modulus, and \(r_s\) is surface radius.
Args: radii: Radii
Returns Density
Source code in aragog/mesh.py
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | |
get_effective_density(radii)
Computes effective density using density rho(r) integration over a spherical shell bounded by radii
Args: radii: Radii array
Returns: Effective Density array
Source code in aragog/mesh.py
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | |
get_mass_element(radii)
Computes the mass element:
where \(\delta m\) is the mass element, \(r\) is radius, and \(\rho\) is density.
Args: radii: Radii
Returns: The mass element at radii
Source code in aragog/mesh.py
589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | |
get_mass_within_radii(radii)
Computes mass within radii:
$$ m(r) = \int 4 \pi r^2 \rho dr $$ where \(m\) is mass, \(r\) is radius, and \(\rho\) is density.
The integral was evaluated using WolframAlpha.
Args: radii: Radii
Returns: Mass within radii
Source code in aragog/mesh.py
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 | |
get_mass_within_shell(radii)
Computes the mass within spherical shells bounded by radii.
Args: radii: Radii
Returns: Mass within the bounded spherical shells
Source code in aragog/mesh.py
663 664 665 666 667 668 669 670 671 672 673 674 675 676 | |
get_pressure_from_radii(radii)
Computes pressure from radii:
where \(r\) is radius, \(K_S\) is adiabatic bulk modulus, \(P\) is pressure, \(\rho_s\) is surface density, \(g\) is gravitational acceleration, and \(r_s\) is surface radius.
Args: radii: Radii
Returns: Pressure
Source code in aragog/mesh.py
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 | |
get_pressure_gradient(pressure)
Computes the pressure gradient:
where \(\rho\) is density, \(P\) is pressure, and \(g\) is gravitational acceleration.
Args: pressure: Pressure
Returns: Pressure gradient
Source code in aragog/mesh.py
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | |
get_radii_from_pressure(pressure)
Computes radii from pressure:
And apply the boundary condition \(P=0\) at \(r=r_s\) to get:
where \(r\) is radius, \(K_S\) is adiabatic bulk modulus, \(P\) is pressure, \(\rho_s\) is surface density, \(g\) is gravitational acceleration, and \(r_s\) is surface radius.
Args: pressure: Pressure
Returns: Radii
Source code in aragog/mesh.py
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 | |
set_staggered_pressure(staggered_radii)
Set staggered pressure based on staggered radii.
Source code in aragog/mesh.py
521 522 523 | |
EOS
FixedMesh(settings, radii, mass_radii, outer_boundary, inner_boundary)
dataclass
A fixed mesh
Args: settings: Mesh parameters radii: Radii of the mesh mass_radii: Mass coordinates of the mesh outer_boundary: Outer boundary for computing depth below the surface inner_boundary: Inner boundary for computing height above the base
Attributes: settings: Mesh parameters radii: Radii of the mesh mass_radii: Mass coordinates of the mesh outer_boundary: Outer boundary for computing depth below the surface inner_boundary: Inner boundary for computing height above the base area: Surface area delta_mesh: Delta radii in mass coordinates depth: Depth below the outer boundary height: Height above the inner boundary mixing_length: Mixing length mixing_length_squared: Mixing length squared mixing_length_cubed: Mixing length cubed number_of_nodes: Number of nodes volume: Volume of the spherical shells defined between neighbouring radii total_volume: Total volume
area
cached
property
Area
Mesh(parameters)
A staggered mesh.
The basic mesh is used for the flux calculations and the staggered mesh is used for the volume calculations.
Args: parameters: Parameters
Source code in aragog/mesh.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
dxidr
property
dxi/dr at basic nodes
d_dr_at_basic_nodes(staggered_quantity)
Determines d/dr at the basic nodes of a quantity defined at the staggered nodes.
Args: staggered_quantity: A quantity defined at the staggered nodes.
Returns: d/dr at the basic nodes
Source code in aragog/mesh.py
370 371 372 373 374 375 376 377 378 379 380 381 382 | |
get_basic_mass_coordinates_from_spatial_coordinates(basic_coordinates)
Computes the basic mass coordinates from basic spatial coordinates.
Args: Basic spatial coordinates
Returns: Basic mass coordinates
Source code in aragog/mesh.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | |
get_constant_spacing()
Constant radius spacing across the mantle
Returns: Radii with constant spacing as a column vector
Source code in aragog/mesh.py
320 321 322 323 324 325 326 327 328 329 330 331 | |
get_dxidr_basic()
Computes dxidr at basic nodes.
Source code in aragog/mesh.py
308 309 310 311 312 313 314 315 316 317 318 | |
get_planet_density(basic_coordinates)
Computes the planet density.
Args: Basic spatial coordinates
Returns: Planet effective density
Source code in aragog/mesh.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
get_staggered_spatial_coordinates_from_mass_coordinates(staggered_mass_coordinates)
Computes the staggered spatial coordinates from staggered mass coordinates.
Args: Staggered mass coordinates
Returns: Staggered spatial coordinates
Source code in aragog/mesh.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
quantity_at_basic_nodes(staggered_quantity)
Determines a quantity at the basic nodes that is defined at the staggered nodes.
Uses backward and forward differences at the inner and outer radius, respectively, to obtain the quantity values of the basic nodes at the innermost and outermost nodes. When using temperature boundary conditions, values at outer boundaries will be overwritten. When using flux boundary conditions, values at outer boundaries will be used to provide estimate of individual components of heat fluxes though the total heat flux is imposed.
Args: staggered_quantity: A quantity defined at the staggered nodes
Returns: The quantity at the basic nodes
Source code in aragog/mesh.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | |
quantity_at_staggered_nodes(basic_quantity)
Determines a quantity at the staggered nodes that is defined at the basic nodes.
Staggered nodes are always located at cell centers, whatever the mesh.
Args: basic_quantity: A quantity defined at the basic nodes
Returns: The quantity at the staggered nodes
Source code in aragog/mesh.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 | |
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 | |
UserDefinedEOS(settings, basic_radii)
Bases: EOS
User defined equation of state (EOS).
Pressure field and effective density field on staggered nodes provided by the user.
Source code in aragog/mesh.py
765 766 767 768 769 770 771 772 773 774 775 776 777 | |
basic_density
property
Effective density at basic nodes
basic_pressure
property
Pressure at basic nodes
staggered_effective_density
property
Effective density at staggered nodes
staggered_pressure
property
Pressure at staggered nodes
set_staggered_pressure(staggered_radii)
Set staggered pressure based on staggered radii.
Source code in aragog/mesh.py
799 800 801 | |
_MeshParameters(outer_radius, inner_radius, number_of_nodes, mixing_length_profile, core_density, eos_method=1, surface_density=4000, gravitational_acceleration=9.81, adiabatic_bulk_modulus=260000000000.0, mass_coordinates=False, eos_file='')
dataclass
Stores parameters in the mesh section in the configuration data.
scale_attributes(scalings)
Scales the attributes
Args: scalings: scalings
Source code in aragog/parser.py
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
is_monotonic_increasing(some_array)
Returns True if an array is monotonically increasing, otherwise returns False.
Source code in aragog/utilities.py
65 66 67 | |