Structure model
structure_model
Main function to solve the coupled ODEs for the structure model.
coupled_odes(radius, y, cmb_mass, core_mantle_mass, layer_mixtures, interpolation_cache, material_dictionaries, temperature, solidus_func, liquidus_func, mushy_zone_factors=None, condensed_rho_min=CONDENSED_RHO_MIN_DEFAULT, condensed_rho_scale=CONDENSED_RHO_SCALE_DEFAULT, binodal_T_scale=BINODAL_T_SCALE_DEFAULT, volatile_profile=None, icb_mass=0.0)
Calculate derivatives of mass, gravity, and pressure w.r.t. radius.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
float
|
Current radius [m]. |
required |
y
|
array - like
|
State vector [mass, gravity, pressure]. |
required |
cmb_mass
|
float
|
Core-mantle boundary mass [kg]. |
required |
core_mantle_mass
|
float
|
Core + mantle mass [kg]. |
required |
layer_mixtures
|
dict
|
Per-layer LayerMixture objects. |
required |
interpolation_cache
|
dict
|
Cache for interpolation functions. |
required |
material_dictionaries
|
dict
|
EOS registry dict keyed by EOS identifier string. |
required |
temperature
|
float
|
Temperature at current radius [K]. |
required |
solidus_func
|
callable or None
|
Solidus melting curve interpolation function. |
required |
liquidus_func
|
callable or None
|
Liquidus melting curve interpolation function. |
required |
mushy_zone_factors
|
dict or float or None
|
Per-EOS mushy zone factors. Dict keyed by EOS name, a single float (applied to all), or None (default 1.0 for all). |
None
|
condensed_rho_min
|
float
|
Sigmoid center for phase-aware suppression (kg/m^3). |
CONDENSED_RHO_MIN_DEFAULT
|
condensed_rho_scale
|
float
|
Sigmoid width for phase-aware suppression (kg/m^3). |
CONDENSED_RHO_SCALE_DEFAULT
|
binodal_T_scale
|
float
|
Binodal sigmoid width in K for H2 miscibility suppression. |
BINODAL_T_SCALE_DEFAULT
|
volatile_profile
|
VolatileProfile or None
|
Phi-aware mantle profile from the partition-law hook. Applied only to the mantle layer; the core and ice layers ignore it. |
None
|
icb_mass
|
float
|
Inner-core mass [kg] of a two-layer core (see :func: |
0.0
|
Returns:
| Type | Description |
|---|---|
list
|
Derivatives [dM/dr, dg/dr, dP/dr]. |
Source code in src/zalmoxis/structure_model.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 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 271 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 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
solve_structure(layer_mixtures, cmb_mass, core_mantle_mass, radii, adaptive_radial_fraction, relative_tolerance, absolute_tolerance, maximum_step, material_dictionaries, interpolation_cache, y0, solidus_func, liquidus_func, temperature_function=None, mushy_zone_factors=None, condensed_rho_min=CONDENSED_RHO_MIN_DEFAULT, condensed_rho_scale=CONDENSED_RHO_SCALE_DEFAULT, binodal_T_scale=BINODAL_T_SCALE_DEFAULT, use_jax=False, temperature_arrays=None, volatile_profile=None, surface_pressure=0.0, icb_mass=0.0, core_temperature_arrays=None)
Solve the coupled ODEs for the planetary structure model.
Handles the special case for temperature-dependent EOS where the radial grid is split into two parts for better handling of large step sizes towards the surface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer_mixtures
|
dict
|
Per-layer LayerMixture objects, e.g.
|
required |
cmb_mass
|
float
|
Mass at the core-mantle boundary [kg]. |
required |
core_mantle_mass
|
float
|
Core + mantle mass [kg]. |
required |
radii
|
ndarray
|
Radial grid points [m]. |
required |
adaptive_radial_fraction
|
float
|
Fraction of radial domain for adaptive-to-fixed step transition. |
required |
relative_tolerance
|
float
|
Relative tolerance for solve_ivp. |
required |
absolute_tolerance
|
float
|
Absolute tolerance for solve_ivp. |
required |
maximum_step
|
float
|
Maximum integration step size [m]. |
required |
material_dictionaries
|
dict
|
EOS registry dict keyed by EOS identifier string. |
required |
interpolation_cache
|
dict
|
Cache for interpolation functions. |
required |
y0
|
array - like
|
Initial conditions [mass, gravity, pressure] at center. |
required |
solidus_func
|
callable or None
|
Solidus melting curve interpolation function. |
required |
liquidus_func
|
callable or None
|
Liquidus melting curve interpolation function. |
required |
temperature_function
|
callable or None
|
Function returning temperature [K]. Signature: |
None
|
temperature_arrays
|
tuple[ndarray, ndarray] or None
|
Optional |
None
|
core_temperature_arrays
|
tuple[ndarray, ndarray] or None
|
Checked core temperature table |
None
|
mushy_zone_factors
|
dict or float or None
|
Per-EOS mushy zone factors. Dict keyed by EOS name, a single float (applied to all), or None (default 1.0 for all). |
None
|
condensed_rho_min
|
float
|
Sigmoid center for phase-aware suppression (kg/m^3). |
CONDENSED_RHO_MIN_DEFAULT
|
condensed_rho_scale
|
float
|
Sigmoid width for phase-aware suppression (kg/m^3). |
CONDENSED_RHO_SCALE_DEFAULT
|
binodal_T_scale
|
float
|
Binodal sigmoid width in K for H2 miscibility suppression. |
BINODAL_T_SCALE_DEFAULT
|
surface_pressure
|
float
|
Target surface pressure [Pa], passed to |
0.0
|
icb_mass
|
float
|
Inner-core mass [kg] of a two-layer core; 0 gives none. |
0.0
|
Returns:
| Type | Description |
|---|---|
tuple
|
(mass_enclosed, gravity, pressure) arrays at each radial grid point.
Past a stop in the integration they are padded by |
Notes
A non-finite density at P > 0 fails the solve where the integrator samples
it (NaN derivatives stop the integration) or, in zalmoxis.solver, where
a grid node lies in it; a region thinner than the steps and between nodes
can pass unseen. A stop at P <= max(SURFACE_STOP_P_FRACTION * P_c,
surface_pressure) is padded as the surface. After
MAX_NONFINITE_RHS non-finite right-hand sides in one solve_ivp call every
further one is NaN, so a solve that creeps along the edge of a failed
region ends.
Source code in src/zalmoxis/structure_model.py
342 343 344 345 346 347 348 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 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 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 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 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 662 663 664 | |