Comments (1)
Hi, thank you for the feedback on the notebooks.
- The difference between the value printed within the Python function and the result of
state.helmholtz_energy
is that the first one is the residual Helmholtz energy (that can be computed from an eos like PR) whereas feos adds an ideal gas contribution. You can call
state.helmholtz_energy(Contributions.ResidualNvt) / (KB * 300*KELVIN)
to verify that the output is indeed the same
data type : <class 'float'>
temperature: 300.0
volume : 40744.0
moles : [1.0]
density : 2.4543491066169253e-05
A/kT : [5.06008546]
5.060085461999782
- For the chemical potential, again the contributions are important. If you want to manually evaluate the fugacity coefficient
lnphi = state.chemical_potential(Contributions.ResidualNvt)/RGAS/T - np.log(Z)
will give you the correct result.
ln_phi
and ln_phi_pure
give the same result but only for stable liquid phases, e.g.,
N=300*MOL
V=24.537*LITER
T=300*KELVIN
state = State(eos, temperature=T, volume=V, total_moles=N)
state.ln_phi_pure(), state.ln_phi()
(array([3.0549047]), array([3.0549047]))
The point of the ln_phi_pure()
function is basically to help with the calculation of activity coefficients. We should reflect that more clearly in the name actually.
- The data type of the state that is passed changes depending on the derivative that is being calculated. For a simple evaluation of the Helmholtz energy it is a state with floats, for first derivatives (e.g., pressure) it is a state with dual numbers. To include units together with the data types for automatic differentiation would be extremely cumbersome. The units are chosen to feel natural when implementing molecular (SAFT-type) equations of state. For the implementation of cubics it is indeed somewhat unergonomic. Just to stress the point: for the implementation of models (basically a one time task) the model needs to be expressed in reduced (molecular) units. While using the model everything is expressed very explicitly and comfortably in SI units.
regarding your suggestions:
- We have either awkardly small inputs (volumes in ANGSTROM, total_moles in # of molecules rather than moles) or awkwardly large outputs in the example print statements in the Helmholtz energy. In this notebook, the focus is on how the data type in the Helmholtz energy function depends on the derivative, therefore, the focus was to have a nice output.
- Yes, I guess I addressed that already. To make the example more readable, it would indeed be helpful to give the variables more meaningful names.
from feos.
Related Issues (20)
- Helping bubble points and dew points at given pressure to converge HOT 2
- PC-SAFT extensions on README
- How to obtain the pressure of dispersive term and that of repulsive term HOT 3
- Can I use feos to plot pressure-density diagram of binary mixture? HOT 5
- `Parameter::from_multiple_json` fails when components exist in multiple files
- Adjust Joback parameters to work with new ideal gas treatment
- Improve `Estimator` and `DataSet` objects
- Polarizable models? HOT 2
- Question regarding the calculation of the ideal gas molar entropy HOT 2
- cutoff_radius limit not necessary in structured (periodic) porous media? HOT 1
- Output the fraction of non-bonded association sites HOT 2
- PC-SAFT vapor-liquid DFT solver HOT 4
- How to calculate the thermal conductivity of mixtures HOT 2
- association scheme variables Na, Nb, Nc HOT 3
- More derivatives at the same time HOT 37
- Some jupyter notebooks throwing error HOT 2
- Feedback for users regarding the availability of binary interaction parameters
- question about polar term in Heterosegmented gc-PCP-SAFT HOT 2
- Make critical point calculation more robust HOT 3
- Fix unit bug in `quantum_d` Python getter of `SaftVRQMieParameter` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feos.