Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pt space pte solver #453

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c84dbe3
starting to add in stuff Daniel wrote, piecewise so I can check it al…
jonahm-LANL Jan 2, 2025
45e8458
add jacobian
jonahm-LANL Jan 3, 2025
6f5887b
PTE space PTE solver compiles at least
jonahm-LANL Jan 8, 2025
0fdb5db
add to simplest test but it fails lol
jonahm-LANL Jan 8, 2025
0d1e9b8
Merge branch 'jmm/pt-of-re-everywhere' into jmm/pt-space-pte-solver
jonahm-LANL Jan 8, 2025
693d837
tweak initial guess
jonahm-LANL Jan 8, 2025
65c8a44
Merge branch 'jmm/pt-of-re-everywhere' into jmm/pt-space-pte-solver
jonahm-LANL Jan 8, 2025
f0093d9
It seems to work, at least tentatively
jonahm-LANL Jan 8, 2025
eb632f4
docs
jonahm-LANL Jan 8, 2025
b612c66
changelog
jonahm-LANL Jan 8, 2025
a01642d
CC
jonahm-LANL Jan 8, 2025
52891f4
not the boolean I meant to express
jonahm-LANL Jan 8, 2025
83dbba5
unused var
jonahm-LANL Jan 8, 2025
9002ac4
oops... big typo
jonahm-LANL Jan 8, 2025
47445a4
Merge branch 'main' into jmm/pt-space-pte-solver
jonahm-LANL Jan 9, 2025
369dae4
max press AT temp
jonahm-LANL Jan 9, 2025
2d98b03
add OMP_PROC_BIND for unit testing
jonahm-LANL Jan 13, 2025
4d0ef18
split scratch
jonahm-LANL Jan 13, 2025
76c97d2
update test pte to split profiling
jonahm-LANL Jan 13, 2025
383486b
move OMP_PROC_BIND option to BUILD AND TEST
jonahm-LANL Jan 23, 2025
3ce2fda
move OMP_PROC_BIND option to BUILD AND TEST
jonahm-LANL Jan 23, 2025
b8c7a67
Add multi ideal gas PTE test that checks for agreement between PT spa…
jonahm-LANL Jan 23, 2025
107d971
Fix residual to correctly check for mass fraction weighted energy
jonahm-LANL Jan 23, 2025
e2318be
Merge branch 'main' into jmm/pt-space-pte-solver
jonahm-LANL Jan 23, 2025
4c7933a
remove databox dependency
jonahm-LANL Jan 23, 2025
03700d8
fix loops that cause warnings
jonahm-LANL Jan 23, 2025
03d122d
int to size_t
jonahm-LANL Jan 23, 2025
967889d
more size_t conversions
jonahm-LANL Jan 23, 2025
9fde279
no ports-of-call-array
jonahm-LANL Jan 23, 2025
8541df8
fix formatting and typos
jonahm-LANL Jan 23, 2025
977a441
put test pte ideal in generator expression
jonahm-LANL Jan 23, 2025
37c40f8
make sure solver sets pressure and temperature and then gets new micr…
jonahm-LANL Jan 24, 2025
7e50d95
control tolerances so densities match after fixing init issue
jonahm-LANL Jan 24, 2025
20977c3
test PTE infrastructure now supports arbitrary solver... though this …
jonahm-LANL Jan 24, 2025
09780ea
oops forgot to set nsuccess
jonahm-LANL Jan 24, 2025
23d0b4e
Works with multiple kind of EOS
jonahm-LANL Jan 26, 2025
9399573
update closure documentation with correct formulae
jonahm-LANL Jan 26, 2025
dedd291
Jacobian inversion analytic
jonahm-LANL Jan 26, 2025
a20c616
CC
jonahm-LANL Jan 26, 2025
d02454c
ok good enough
jonahm-LANL Jan 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitlab/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ cmake_test() {
(
source ${BUILD_ENV}
export CTEST_OUTPUT_ON_FAILURE=1
export OMP_PROC_BIND=false
if ${BUILD_WITH_CTEST}; then
ctest -V -S .gitlab/build_and_test.cmake,Test,$REPORT_ERRORS
else
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Current develop

### Added (new features/APIs/variables/...)
- [[PR453]](https://github.com/lanl/singularity-eos/pull/453) A PT space PTE solver
- [[PR444]](https://github.com/lanl/singularity-eos/pull/444) Add Z split modifier and electron ideal gas EOS

### Fixed (Repair bugs, etc)
Expand Down
49 changes: 49 additions & 0 deletions doc/sphinx/src/using-closures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,55 @@ choice of the second independent variable is discussed below and has
implications for both the number of additional unknowns and the stability of the
method.

.. _pressure-temperature-formulation:
The Pressure-Temperature Formulation
`````````````````````````````````````

An obvious choice is to treat the independent variables as pressure
and temperature. Then one has only two equations and two unknowns. The
residual contains only the volume fraction and energy summmation rules
described above. Taylor expanding these residuals about fixed
temeprature and pressure points leads to two residual equations of the
form

.. math::

1 - \sum_{i=0}^{N-1} f_i = (T^* - T) \sum_{i = 0}^{N-1} \left(\frac{\partial f_i}{\partial T}\right)_P + (P^* - P) \sum_{i = 0}^{N-1} \left(\frac{\partial f_i}{\partial P}\right)_T\\
u_{tot} - \sum_{i=0}^{N-1} u_i = (T^* - T) \sum_{i = 0}^{N-1} \left(\frac{\partial u_i}{\partial T}\right)_P + (P^* - P) \sum_{i = 0}^{N-1} \left(\frac{\partial u_i}{\partial P}\right)_T

However, derivatives in the volume fraction are not easily
accessible. To access them, we leverage the fact that

.. math::

\bar{\rho}_i = \rho_i f_i,

and thus

.. math::

d f_i = - \frac{1}{\rho_i^2} d f_i.

Thus the residual can be recast as

.. math::

f_\mathrm{tot} - \sum_{i=0}^{N-1} = (T^* - T) \sum_{i = 0}^{N-1} \frac{\bar{\rho}_i}{\rho_i^2} \left(\frac{\partial \rho_i}{\partial T}\right)_P + (P^* - P) \sum_{i = 0}^{N-1} \frac{\bar{\rho}_i}{\rho_i^2} \left(\frac{\partial \rho_i}{\partial P}\right)_T\\
u_\mathrm{tot} - u_i = (T^* - T) \sum_{i = 0}^{N-1} \left(\frac{\partial u_i}{\partial T}\right)_P + (P^* - P) \sum_{i = 0}^{N-1} \left(\frac{\partial u_i}{\partial P}\right)_T

where :math:`\rho_{\mathrm{tot}}` is the sum of densities over all
materials. These residual equations can then be cast as a matrix
equation to solve for pressure and temperature.

The primary advantage of the pressure-temperature space solver is that
it has only two independent variables and two unknowns, meaning the
cost scales only linearly with the number of materials, not
quadratically (or worse). The primary disadvantage, is that most
equations of state are not formulated in terms of pressure and
temperature, meaning additional inversions are required.

In the code, this method is referred to as ``PTESolverPT``.

.. _density-energy-formalism:
The Density-Energy Formulation
''''''''''''''''''''''''''''''
Expand Down
Loading
Loading