Solver for internal thermodynamic states

Refining the internal state of thermodynamic models

simu.core.solver.thermostate.refine_initial_state(
frame: ThermoFrame,
parameters: NestedMap[Quantity],
initial_state: InitialState,
estimate: Sequence[float],
) Sequence[float]

The strategy for initialising thermodynamic models relies on the demand that all models can provide an estimate of their initial state based on temperature, pressure, and molar quantities, such that a Newton-Raphson solver, respecting the model’s domain boundaries, will find a refinement to exactly meet the specified \(T, p, \vec n\) specifications.

This function implements the specialised version of the solver, refining the initial estimate into a converged result.

Parameters:
  • frame – The thermodynamic model

  • parameters – The current set of thermodynamic parameters

  • initial_state – The desired initial state in terms of \(T, p, \vec n\)

  • estimate – The estimate of the internal state vector.

Returns:

The refined internal state vector

This function is not to be called for Gibbs models, as the internal state is trivially defined in \(T, p, \vec n\) . The most common application is to refine Helmholtz models on \(T, V, \vec n\). Though the non-trivial part is in that case reduced to finding \(p(V) - p_\mathrm{init} = 0\), the implementation is kept general in order to allow for arbitrary internal state definitions.