feos-org / feos-core Goto Github PK
View Code? Open in Web Editor NEWCore traits and functionalities for the `feos` project.
License: Other
Core traits and functionalities for the `feos` project.
License: Other
In critical_point_binary
, verbosity
of VLEOptions
is not used - neither in the final computation nor in the Brent optimization. We could add the option into the strut that implements ArgminOp
. E.g.:
struct CritOp<U: EosUnit, E: EquationOfState> {
eos: Rc<E>,
tp: TPSpec<U>,
opts: VLEOptions,
}
impl<U: EosUnit, E: EquationOfState> CritOp<U, E> {
fn new(eos: &Rc<E>, tp: TPSpec<U>, opts: VLEOptions) -> Self {
Self {
eos: eos.clone(),
tp,
opts
}
}
}
yielding
pub(crate) fn critical_point_binary(
eos: &Rc<E>,
tp: TPSpec<U>,
options: VLEOptions,
) -> EosResult<Self>
where
QuantityScalar<U>: std::fmt::Display,
{
let solver = Brent::new(1e-10, 1.0 - 1e-10, options.tol.unwrap_or(TOL_CRIT_POINT));
let cost = CritOp::new(eos, tp, options.clone());
let x = Executor::new(cost, solver, 0.5)
.max_iters(options.max_iter.unwrap_or(MAX_ITER_CRIT_POINT) as u64)
.run()?
.state
.best_param;
let moles = arr1(&[x, 1.0 - x]) * U::reference_moles();
State::critical_point(eos, Some(&moles), None, options)
}
For a mixture:
cpm = State.critical_point(dft)
returns the error message: RuntimeError: Equation of state is initialized for 2 components while the input specifies 1 components.
The error can be prevented by specifying moles
as
cpm = State.critical_point(dft, moles=np.array([1.5, 1.5])*MOL)
A nicer error message could state that specification of moles
is required.
Issue to collect typos in docs.
Parameter.records
methodMissing text_signature
, typos, etc.
PengRobinsonParameters
contains a field joback_records
that is never read.
For some equations of state, the initial temperatures are problematic. E.g. for model fluids such as LJ fluids with somewhat sensible parameters critical points can be around 100 Kelvin. For pure substances this is not as much of a problem, since we can provide initial estimates. For binary mixtures, this is not possible. We should either make initial guesses more robust or provide ways to allow initial estimates as input.
In some cases, it would be convenient to directly access (mass) specific densities from a PhaseDiagramPure
. Maybe as a getter?
The name of the VLEOptions
struct is a relic from when PhaseEquilibrium
was still named VLEState
. It is appropriate to give it a clearer name, e.g. SolverOptions
and use it in from_json
as option type.
The cubic
module and PengRobinson
equation of state lack docstrings.
Also, to be consistent with other records, PengRobinsonRecord
should have a new
constructor.
PyO3 0.16.0 provides new features that can be useful for our crate. In particular the added support for simple enums like Contributions
and Verbosity
can be exploited.
In this example, the state is calculated using N=1 and the given volume instead of calculating the moles from a density iteration.
T = 25*CELSIUS
V = (100*ANGSTROM)**3
p = BAR
z = 3e-4
State(func, T, pressure=p, molefracs=np.array([1-z,z]), volume=V).pressure()
>>> 3.9624kPa
Currently LaTeX is not rendered properly on docs.rs. Missing entry in Cargo.toml?
We should add more information to the README. Although the primary use case for all FeOs crates (from an users standpoint) will be the python package (feos
) it might be helpful to have an example on how to use this crate in rust.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.