Collections
The current EquationOfStateOfSolidsParameters are
julia> using TypeTreejulia> tt(EquationsOfStateOfSolids.EquationOfStateOfSolidsParameters)ERROR: UndefVarError: EquationsOfStateOfSolids not defined
Here the leaves of the type tree are concrete types and can be constructed.
Usage
Construct a EquationOfStateOfSolidsParameters instance
We will use BirchMurnaghan3rd as an example.
A BirchMurnaghan3rd can be constructed from scratch, as shown above. It can also be constructed from an existing BirchMurnaghan3rd, with Setfield.jl @set! macro:
julia> using Setfieldjulia> eos = Murnaghan1st(1, 2, 3.0)ERROR: UndefVarError: Murnaghan1st not definedjulia> @set! eos.v0 = 4ERROR: UndefVarError: eos not definedjulia> eosERROR: UndefVarError: eos not defined
To modify multiple fields (say, :v0, :b′0, :b″0, :e0) at a time, use @batchlens from Kaleido.jl:
julia> using Setfield, Kaleidojulia> lens = @batchlens(begin _.v0 _.b′0 _.b″0 _.e0 end)IndexBatchLens(:v0, :b′0, :b″0, :e0)julia> eos = BirchMurnaghan4th(1, 2.0, 3, 4)ERROR: UndefVarError: BirchMurnaghan4th not definedjulia> set(eos, lens, (5, 6, 7, 8))ERROR: UndefVarError: eos not defined
Users can access BirchMurnaghan3rd's elements by "dot notation":
julia> eos = BirchMurnaghan3rd(1, 2, 3, 4.0)ERROR: UndefVarError: BirchMurnaghan3rd not definedjulia> eos.v0ERROR: UndefVarError: eos not defined
Evaluate energy
The $E(V)$ relation of equations of state are listed as below:
Murnaghan:BirchMurnaghan2nd:\[\]
BirchMurnaghan3rd:\[E(V) = E_{0}+\frac{9}{16} V_{0} B_{0} \frac{\left(x^{2 / 3}-1\right)^{2}}{x^{7 / 3}}\left\{x^{1 / 3}\left(B_{0}^{\prime}-4\right)-x\left(B_{0}^{\prime}-6\right)\right\}.\]
where $x = V / V_0$, and $f = \frac{ 1 }{ 2 } \bigg[ \bigg( \frac{ V_0 }{ V } \bigg)^{2/3} - 1 \bigg]$.
BirchMurnaghan4th:\[E(V) = E_{0}+\frac{3}{8} V_{0} B_{0} f^{2}\left[\left(9 H-63 B_{0}^{\prime}+143\right) f^{2}+12\left(B_{0}^{\prime}-4\right) f+12\right].\]
where $H = B_0 B_0'' + (B_0')^2$.
PoirierTarantola2nd:\[E(V) = E_{0}+\frac{1}{2} B_{0} V_{0} \ln ^{2} x.\]
PoirierTarantola3rd:\[E(V) = E_{0}+\frac{1}{6} B_{0} V_{0} \ln ^{2} x\left[\left(B_{0}^{\prime}+2\right) \ln x+3\right].\]
PoirierTarantola4th:\[E(V) = E_{0}+\frac{1}{24} B_{0} V_{0} \ln ^{2} x\left\{\left(H+3 B_{0}^{\prime}+3\right) \ln ^{2} x\right. \left.+4\left(B_{0}^{\prime}+2\right) \ln x+12\right\}.\]
where $H = B_0 B_0'' + (B_0')^2$.
Vinet:\[E(V) = E_{0}+\frac{9}{16} V_{0} B_{0} \frac{\left(x^{2 / 3}-1\right)^{2}}{x^{7 / 3}}\left\{x^{1 / 3}\left(B_{0}^{\prime}-4\right)-x\left(B_{0}^{\prime}-6\right)\right\}.\]
AntonSchmidt:\[E(V)=\frac{\beta V_{0}}{n+1}\left(\frac{V}{V_{0}}\right)^{n+1}\left[\ln \left(\frac{V}{V_{0}}\right)-\frac{1}{n+1}\right]+E_{\infty}.\]
Evaluate pressure
The $P(V)$ relation of equations of state are listed as below:
Murnaghan:\[1\]
BirchMurnaghan2nd:\[P(V) = \frac{3}{2} B_{0}\left(x^{-7 / 3}-x^{-5 / 3}\right).\]
BirchMurnaghan3rd:\[P(V) = \frac{3}{8} B_{0} \frac{x^{2 / 3}-1}{x^{10 / 3}}\left\{3 B_{0}^{\prime} x-16 x-3 x^{1 / 3}\left(B_{0}^{\prime}-4\right)\right\}.\]
BirchMurnaghan4th:\[P(V) = \frac{1}{2} B_{0}(2 f+1)^{5 / 2}\left\{\left(9 H-63 B_{0}^{\prime}+143\right) f^{2}\right.\left.+9\left(B_{0}^{\prime}-4\right) f+6\right\}.\]
PoirierTarantola2nd:\[P(V) = -\frac{B_{0}}{x} \ln x.\]
PoirierTarantola3rd:\[P(V) = -\frac{B_{0} \ln x}{2 x}\left[\left(B_{0}^{\prime}+2\right) \ln x+2\right].\]
PoirierTarantola4th:\[P(V) = -\frac{B_{0} \ln x}{6 x}\left\{\left(H+3 B_{0}^{\prime}+3\right) \ln ^{2} x+3\left(B_{0}^{\prime}+6\right) \ln x+6\right\}.\]
Vinet:\[P(V) = 3 B_{0} \frac{1-\eta}{\eta^{2}} \exp \left\{-\frac{3}{2}\left(B_{0}^{\prime}-1\right)(\eta-1)\right\}.\]
AntonSchmidt:\[P(V) = -\beta\left(\frac{V}{V_{0}}\right)^{n} \ln \left(\frac{V}{V_{0}}\right).\]
Evaluate bulk modulus
The $B(V)$ relation of equations of state are listed as below:
BirchMurnaghan2nd:\[B(V) = B_{0}(7 f+1)(2 f+1)^{5 / 2}.\]
BirchMurnaghan3rd:\[B(V) = B_{0}(2 f+1)^{5 / 2} \left\{ 1 + (3B_{0}^{\prime} - 5) f + \frac{ 27 }{ 2 }(B_{0}^{\prime} - 4) f^2 \right\}\]
BirchMurnaghan4th:\[B(V) = \frac{1}{6} B_{0}(2 f+1)^{5 / 2}\left\{\left(99 H-693 B_{0}^{\prime}+1573\right) f^{3}\right.\left.+\left(27 H-108 B_{0}^{\prime}+105\right) f^{2}+6\left(3 B_{0}^{\prime}-5\right) f+6\right\}.\]
PoirierTarantola2nd:\[B(V) = \frac{B_{0}}{x}(1-\ln x).\]
PoirierTarantola3rd:\[B(V) = -\frac{B_{0}}{2 x}\left[\left(B_{0}^{\prime}+2\right) \ln x(\ln x-1)-2\right].\]
PoirierTarantola4th:\[B(V) = -\frac{B_{0}}{6 x}\left\{\left(H+3 B_{0}^{\prime}+3\right) \ln ^{3} x-3\left(H+2 B_{0}^{\prime}+1\right) \ln ^{2} x\right.\left.-6\left(B_{0}^{\prime}+1\right) \ln x-6\right\}.\]
Vinet:\[B(V) = -\frac{B_{0}}{2 \eta^{2}}\left[3 \eta(\eta-1)\left(B_{0}^{\prime}-1\right)+2(\eta-2)\right]\times \exp \left\{-\frac{3}{2}\left(B_{0}^{\prime}-1\right)(\eta-1)\right\}.\]
AntonSchmidt:\[B(V) = \beta\left(\frac{V}{V_{0}}\right)^{n}\left[1+n \ln \frac{V}{V_{0}}\right].\]
Public interfaces
EquationsOfStateOfSolids.Murnaghan1st — TypeMurnaghan1st(v0, b0, b′0, e0=zero(v0 * b0))Create a Murnaghan first order equation of state.
The energy and pressure equations are:
\[\begin{align*} E(V) &= E_0+B_0 V_0\left[\frac{1}{B_0'\left(B_0'-1\right)}\left(\frac{V}{V_0}\right)^{1-B_0'}+\frac{V}{B_0' V_0}-\frac{1}{B_0'-1}\right]\\ P(V) &= \frac{B_0}{B_0'}\left[\left(\frac{V_0}{V}\right)^{B_0'}-1\right] \end{align*}\]
Arguments
v0: the volume of solid at zero pressure.b0: the bulk modulus of solid at zero pressure.b′0: the first-order pressure-derivative bulk modulus of solid at zero pressure.e0: the energy of solid at zero pressure.
EquationsOfStateOfSolids.BirchMurnaghan — TypeBirchMurnaghan(args...)Construct a BirchMurnaghan based on the length of arguments, where e0 must be provided.
See also: BirchMurnaghan2nd, BirchMurnaghan3rd, BirchMurnaghan4th
EquationsOfStateOfSolids.BirchMurnaghan2nd — TypeBirchMurnaghan2nd(v0, b0, e0=zero(v0 * b0))Create a Birch–Murnaghan second order equation of state.
The energy, pressure, and bulk modulus equations are:
\[\begin{align*} E(V) &= E_0 + \frac{9}{8} B_0 V_0 \left(\left( V / V_0 \right)^{-2 / 3}-1\right)^{2}\\ P(V) &= \frac{3}{2} B_{0}\left(x^{-7 / 3}-x^{-5 / 3}\right)\\ B(V) &= B_0(7f+1)(2f+1)^{5 / 2} \end{align*}\]
where $x = V / V_0$, and $f = \frac{ 1 }{ 2 } \bigg[ \Big( \frac{ V_0 }{ V } \Big)^{2/3} - 1 \bigg]$.
Arguments
v0: the volume of solid at zero pressure.b0: the bulk modulus of solid at zero pressure.e0: the energy of solid at zero pressure.
EquationsOfStateOfSolids.BirchMurnaghan3rd — TypeBirchMurnaghan3rd(v0, b0, b′0, e0=zero(v0 * b0))Create a Birch–Murnaghan third order equation of state.
This equation of state can have units. The units are specified in Unitful.jl's @u_str style.
Arguments
v0: the volume of solid at zero pressure.b0: the bulk modulus of solid at zero pressure.b′0: the first-order pressure-derivative bulk modulus of solid at zero pressure.e0: the energy of solid at zero pressure.
The third-order equation (Equation (22)) becomes identical to the second-order equation when $b′0 = 4$ (not $0$!).
EquationsOfStateOfSolids.BirchMurnaghan4th — TypeBirchMurnaghan4th(v0, b0, b′0, b″0, e0=zero(v0 * b0))Create a Birch–Murnaghan fourth order equation of state.
This equation of state can have units. The units are specified in Unitful.jl's @u_str style.
Arguments
v0: the volume of solid at zero pressure.b0: the bulk modulus of solid at zero pressure.b′0: the first-order pressure-derivative bulk modulus of solid at zero pressure.b″0: the second-order pressure-derivative bulk modulus of solid at zero pressure.e0: the energy of solid at zero pressure.
The fourth-order equation becomes identical to the third-order equation when
\[B''_0 = -\frac{ 1 }{ 9B_0 } (9B'_0^2 - 63B'_0 + 143).\]
EquationsOfStateOfSolids.PoirierTarantola — TypePoirierTarantola(args...)Construct a PoirierTarantola based on the length of arguments, where e0 must be provided.
See also: PoirierTarantola2nd, PoirierTarantola3rd, PoirierTarantola4th
EquationsOfStateOfSolids.PoirierTarantola2nd — TypePoirierTarantola2nd(v0, b0, e0=zero(v0 * b0))Create a Poirier–Tarantola second order equation of state.
This equation of state can have units. The units are specified in Unitful.jl's @u_str style.
Arguments
v0: the volume of solid at zero pressure.b0: the bulk modulus of solid at zero pressure.e0: the energy of solid at zero pressure.
EquationsOfStateOfSolids.PoirierTarantola3rd — TypePoirierTarantola3rd(v0, b0, b′0, e0=zero(v0 * b0))Create a Poirier–Tarantola third order equation of state.
This equation of state can have units. The units are specified in Unitful.jl's @u_str style.
Arguments
v0: the volume of solid at zero pressure.b0: the bulk modulus of solid at zero pressure.b′0: the first-order pressure-derivative bulk modulus of solid at zero pressure.e0: the energy of solid at zero pressure.
EquationsOfStateOfSolids.Vinet — TypeVinet(v0, b0, b′0, e0=zero(v0 * b0))Create a Vinet equation of state.
This equation of state can have units. The units are specified in Unitful.jl's @u_str style.
Arguments
v0: the volume of solid at zero pressure.b0: the bulk modulus of solid at zero pressure.b′0: the first-order pressure-derivative bulk modulus of solid at zero pressure.e0: the energy of solid at zero pressure.
EquationsOfStateOfSolids.EnergyEquation — TypeEnergyEquation{T} <: EquationOfStateOfSolids{T}
EnergyEquation(parameters::Parameters)Construct an equation of state which evaluates the energy of the given parameters.
EquationsOfStateOfSolids.PressureEquation — TypePressureEquation{T} <: EquationOfStateOfSolids{T}
PressureEquation(parameters::Parameters)Construct an equation of state which evaluates the pressure of the given parameters.
EquationsOfStateOfSolids.BulkModulusEquation — TypeBulkModulusEquation{T} <: EquationOfStateOfSolids{T}
BulkModulusEquation(parameters::Parameters)Construct an equation of state which evaluates the bulk modulus of the given parameters.
EquationsOfStateOfSolids.orderof — Functionorderof(x::FiniteStrainParameters)Return the order of a FiniteStrainParameters.
Examples
julia> orderof(BirchMurnaghan(40, 0.5, 4, 0)) == 3
trueBase.real — Functionreal(p::Parameters)Construct a real Parameters from the real parts of the elements of p.
Base.isreal — Functionisreal(p::Parameters)Test whether all p's elements are numerically equal to some real number.
Base.float — Functionfloat(p::Parameters)Convert all elements of a Parameters to floating point data types.
Unitful.ustrip — Functionustrip(p::Parameters)Strip units from a Parameters.