Reaktoro  v2.6.0
A unified framework for modeling chemically reactive systems
EquilibriumSpecs.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright © 2014-2022 Allan Leal
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // Reaktoro includes
21 #include <Reaktoro/Common/Matrix.hpp>
22 #include <Reaktoro/Common/Types.hpp>
23 #include <Reaktoro/Core/ChemicalFormula.hpp>
24 #include <Reaktoro/Core/ChemicalSystem.hpp>
25 
26 namespace Reaktoro {
27 
28 // Forward declarations
29 class ChemicalProps;
30 class ChemicalState;
31 
41 {
46  using ChemicalPotentialFn = Fn<real(ChemicalProps const& props, VectorXrConstRef const& p, VectorXrConstRef const& w)>;
47 
50 
53 
56 
59 };
60 
69 {
73  using ChemicalPotentialFn = Fn<real(ChemicalProps const& props, real const& pk)>;
74 
77 
80 
83 
86 };
87 
90 {
95  using Func1 = Fn<real(ChemicalProps const& props, VectorXrConstRef const& p, VectorXrConstRef const& w)>;
96 
100  using Func2 = Fn<real(ChemicalProps const& props, VectorXrConstRef const& w)>;
101 
104  using Func3 = Fn<real(ChemicalProps const& props)>;
105 
107  EquationConstraintFn() = default;
108 
110  EquationConstraintFn(Func1 const& f) : _fn(f) {}
111 
113  EquationConstraintFn(Func2 const& f) : _fn([=](ChemicalProps const& props, VectorXrConstRef const& p, VectorXrConstRef const& w) -> real { return f(props, w); }) {}
114 
116  EquationConstraintFn(Func3 const& f) : _fn([=](ChemicalProps const& props, VectorXrConstRef const& p, VectorXrConstRef const& w) -> real { return f(props); }) {}
117 
122  auto operator()(ChemicalProps const& props, VectorXrConstRef const& p, VectorXrConstRef const& w) const -> real { return _fn(props, p, w); }
123 
125  auto operator=(Func1 const& f) { return *this = EquationConstraintFn(f); }
126 
128  auto operator=(Func2 const& f) { return *this = EquationConstraintFn(f); }
129 
131  auto operator=(Func3 const& f) { return *this = EquationConstraintFn(f); }
132 
134  auto initialized() const { return static_cast<bool>(_fn); }
135 
137  operator bool() const { return initialized(); }
138 
141 };
142 
145 {
148 
151 };
152 
154 struct [[deprecated("ConstraintEquation has been renamed to EquationConstraint. Please make this change in your code.")]] ConstraintEquation : EquationConstraint
155 {};
156 
159 {
164  using Func = Fn<VectorXr(ChemicalProps const& props, VectorXrConstRef const& w, VectorXrConstRef const& p)>;
165 
168 
171 };
172 
177 {
180 
183 
186 };
187 
192 {
195 
198 
201 };
202 
291 {
292 public:
294  explicit EquilibriumSpecs(ChemicalSystem const& system);
295 
296  //=================================================================================================
297  //
298  // STATIC METHODS TO CREATE PREDEFINED CHEMICAL EQUILIBRIUM SPECIFICATIONS
299  //
300  //=================================================================================================
301 
303  static auto TP(ChemicalSystem const& system) -> EquilibriumSpecs;
304 
306  static auto HP(ChemicalSystem const& system) -> EquilibriumSpecs;
307 
309  static auto TV(ChemicalSystem const& system) -> EquilibriumSpecs;
310 
312  static auto UV(ChemicalSystem const& system) -> EquilibriumSpecs;
313 
315  static auto SP(ChemicalSystem const& system) -> EquilibriumSpecs;
316 
318  static auto SV(ChemicalSystem const& system) -> EquilibriumSpecs;
319 
320  //=================================================================================================
321  //
322  // METHODS TO SPECIFY THERMODYNAMIC CONSTRAINTS
323  //
324  //=================================================================================================
325 
332  auto temperature() -> void;
333 
340  auto pressure() -> void;
341 
347  auto volume() -> void;
348 
354  auto internalEnergy() -> void;
355 
361  auto enthalpy() -> void;
362 
368  auto gibbsEnergy() -> void;
369 
375  auto helmholtzEnergy() -> void;
376 
382  auto entropy() -> void;
383 
385  auto charge() -> void;
386 
389  auto elementAmount(StringOrIndex const& element) -> void;
390 
394  auto elementAmountInPhase(StringOrIndex const& element, StringOrIndex const& phase) -> void;
395 
398  auto elementMass(StringOrIndex const& element) -> void;
399 
403  auto elementMassInPhase(StringOrIndex const& element, StringOrIndex const& phase) -> void;
404 
407  auto phaseAmount(StringOrIndex const& phase) -> void;
408 
411  auto phaseMass(StringOrIndex const& phase) -> void;
412 
415  auto phaseVolume(StringOrIndex const& phase) -> void;
416 
417  //=================================================================================================
418  //
419  // METHODS TO SPECIFY UNKNOWN INPUT CONDITIONS
420  //
421  //=================================================================================================
422 
427  auto unknownTemperature() -> void;
428 
433  auto unknownPressure() -> void;
434 
435  //=================================================================================================
436  //
437  // METHODS TO SPECIFY CHEMICAL POTENTIAL CONSTRAINTS
438  //
439  //=================================================================================================
440 
451  auto chemicalPotential(String substance) -> void;
452 
466  auto lnActivity(Species const& species) -> void;
467 
474  auto lnActivity(String species) -> void;
475 
482  auto lgActivity(String species) -> void;
483 
490  auto activity(String species) -> void;
491 
504  auto fugacity(String gas) -> void;
505 
529  auto pH() -> void;
530 
539  auto pMg() -> void;
540 
549  auto pE() -> void;
550 
559  auto Eh() -> void;
560 
561  //=================================================================================================
562  //
563  // METHODS TO SPECIFY HOW THE CHEMICAL SYSTEM IS OPEN
564  //
565  //=================================================================================================
566 
595  auto openTo(ChemicalFormula const& substance) -> void;
596 
598  // auto openTo(ChemicalState const& state) -> void;
599 
601  // auto openTo(Material const& material) -> void;
602 
603  //=================================================================================================
604  //
605  // METHODS TO SPECIFY ADDITIONAL UNKNOWNS
606  //
607  //=================================================================================================
608 
610  auto addUnknownTitrantAmount(ChemicalFormula const& substance) -> void;
611 
613  auto addUnknownChemicalPotential(String const& species) -> void;
614 
616  auto addUnknownStandardChemicalPotential(String const& species) -> void;
617 
619  auto addUnknownActivity(String const& species) -> void;
620 
622  auto addUnknownActivityCoefficient(String const& species) -> void;
623 
624  //=================================================================================================
625  //
626  // METHODS TO GET THE NUMBER OF INTRODUCED CONSTRAINTS, INPUT VARIABLES, AND CONTROL VARIABLES
627  //
628  //=================================================================================================
629 
631  auto numInputs() const -> Index;
632 
634  auto numInputParams() const -> Index;
635 
637  auto numControlVariables() const -> Index;
638 
640  auto numControlVariablesP() const -> Index;
641 
643  auto numControlVariablesQ() const -> Index;
644 
646  auto numTitrants() const -> Index;
647 
649  auto numTitrantsExplicit() const -> Index;
650 
652  auto numTitrantsImplicit() const -> Index;
653 
655  auto numEquationConstraints() const -> Index;
656 
658  auto numReactivityConstraints() const -> Index;
659 
661  auto numConstraints() const -> Index;
662 
664  auto numConservativeComponents() const -> Index;
665 
666  //=================================================================================================
667  //
668  // METHODS TO GET THE NAMES OF INTRODUCED CONSTRAINTS, INPUT VARIABLES, AND CONTROL VARIABLES
669  //
670  //=================================================================================================
671 
673  auto namesInputs() const -> Strings;
674 
676  auto namesInputParams() const -> Strings;
677 
679  auto namesControlVariables() const -> Strings;
680 
682  auto namesControlVariablesP() const -> Strings;
683 
685  auto namesControlVariablesQ() const -> Strings;
686 
688  auto namesTitrants() const -> Strings;
689 
691  auto namesTitrantsExplicit() const -> Strings;
692 
694  auto namesTitrantsImplicit() const -> Strings;
695 
697  auto namesConstraints() const -> Strings;
698 
700  auto namesConservativeComponents() const -> Strings;
701 
702  //=================================================================================================
703  //
704  // METHODS TO ADD CONTROL VARIABLES, CONSTRAINTS, AND INPUT VARIABLES
705  //
706  //=================================================================================================
707 
709  auto addControlVariableQ(ControlVariableQ const& qvar) -> void;
710 
712  auto addControlVariableP(ControlVariableP const& pvar) -> void;
713 
715  auto addConstraint(EquationConstraint const& constraint) -> void;
716 
718  auto addConstraints(EquationConstraints const& constraints) -> void;
719 
721  auto addReactivityConstraint(ReactivityConstraint const& constraint) -> void;
722 
724  auto addReactivityConstraints(ReactivityConstraints const& constraints) -> void;
725 
727  auto addInput(String const& var) -> Index;
728 
730  auto addInput(Param const& param) -> Index;
731 
732  //=================================================================================================
733  //
734  // MISCELLANEOUS METHODS
735  //
736  //=================================================================================================
737 
739  auto system() const -> ChemicalSystem const&;
740 
742  auto inputs() const -> Strings const&;
743 
745  auto params() const -> Vec<Param> const&;
746 
748  auto indicesInputParams() const -> Vec<Index> const&;
749 
751  auto isTemperatureUnknown() const -> bool;
752 
754  auto isPressureUnknown() const -> bool;
755 
757  auto indexTemperatureAmongInputVariables() const -> Index;
758 
760  auto indexTemperatureAmongControlVariablesP() const -> Index;
761 
763  auto indexPressureAmongInputVariables() const -> Index;
764 
766  auto indexPressureAmongControlVariablesP() const -> Index;
767 
769  auto indexInputVariable(String const& name) const -> Index;
770 
772  auto indexControlVariableP(String const& name) const -> Index;
773 
775  auto indexControlVariableQ(String const& name) const -> Index;
776 
778  auto controlVariablesQ() const -> Vec<ControlVariableQ> const&;
779 
781  auto controlVariablesP() const -> Vec<ControlVariableP> const&;
782 
784  auto titrants() const -> Vec<ChemicalFormula>;
785 
787  auto titrantsExplicit() const -> Vec<ChemicalFormula>;
788 
790  auto titrantsImplicit() const -> Vec<ChemicalFormula>;
791 
793  auto equationConstraintsSingle() const -> Vec<EquationConstraint> const&;
794 
796  auto equationConstraintsSystem() const -> Vec<EquationConstraints> const&;
797 
799  auto reactivityConstraintsSingle() const -> Vec<ReactivityConstraint> const&;
800 
802  auto reactivityConstraintsSystem() const -> Vec<ReactivityConstraints> const&;
803 
804  //=================================================================================================
805  //
806  // METHODS THAT ASSEMBLE CONSTRAINTS AND MATRICES FOR CURRENT STATE OF EQUILIBRIUM SPECIFICATIONS
807  //
808  //=================================================================================================
809 
814  auto assembleEquationConstraints() const -> EquationConstraints;
815 
820  auto assembleReactivityConstraints() const -> ReactivityConstraints;
821 
823  auto assembleReactivityConstraintsMatrixKn() const -> MatrixXd;
824 
826  auto assembleReactivityConstraintsMatrixKp() const -> MatrixXd;
827 
830  auto assembleConservationMatrix() const -> MatrixXd;
831 
840  auto assembleConservationMatrixN() const -> MatrixXd;
841 
843  auto assembleConservationMatrixQ() const -> MatrixXd;
844 
846  auto assembleConservationMatrixP() const -> MatrixXd;
847 
848 private:
850  ChemicalSystem m_system;
851 
853  Strings m_inputs;
854 
856  Vec<Param> m_params;
857 
859  Vec<Index> m_params_idxs;
860 
862  Vec<ControlVariableQ> qvars;
863 
865  Vec<ControlVariableP> pvars;
866 
868  Vec<EquationConstraint> econstraints_single;
869 
871  Vec<EquationConstraints> econstraints_system;
872 
874  Strings econstraints_ids;
875 
877  Vec<ReactivityConstraint> rconstraints_single;
878 
880  Vec<ReactivityConstraints> rconstraints_system;
881 
883  Strings rconstraints_ids;
884 
885  // ----- AUXILIARY DATA MEMBERS ----- //
886 
888  Vec<ChemicalFormula> titrants_explicit;
889 
891  Vec<ChemicalFormula> titrants_implicit;
892 
894  Strings species_with_unknown_chemical_potentials;
895 
896 private:
899  auto throwErrorIfTitrantHasBeenRegistered(ChemicalFormula const& substance) const -> void;
900 };
901 
902 } // namespace Reaktoro
A type used to represent the chemical formula of a chemical species.
Definition: ChemicalFormula.hpp:27
The class that computes chemical properties of a chemical system.
Definition: ChemicalProps.hpp:34
The class used to represent a chemical system and its attributes and properties.
Definition: ChemicalSystem.hpp:70
The class used to define conditions to be satisfied at chemical equilibrium.
Definition: EquilibriumSpecs.hpp:291
auto addUnknownActivity(String const &species) -> void
Specify that the activity of a species is unknown at equilibrium and must be computed.
static auto SV(ChemicalSystem const &system) -> EquilibriumSpecs
Return specifications for a chemical equilbrium problem with given entropy (S) and volume (V).
auto entropy() -> void
Specify that the entropy of the system is given at chemical equilibrium.
auto elementMass(StringOrIndex const &element) -> void
Specify that the mass of an element is given at chemical equilibrium.
auto lnActivity(Species const &species) -> void
Specify that the ln activity of a species is given at chemical equilibrium.
auto helmholtzEnergy() -> void
Specify that the Helmholtz energy of the system is given at chemical equilibrium.
auto lnActivity(String species) -> void
Specify that the ln activity of a species is given at chemical equilibrium.
static auto HP(ChemicalSystem const &system) -> EquilibriumSpecs
Return specifications for a chemical equilbrium problem with given enthalpy (H) and pressure (P).
auto volume() -> void
Specify that the volume of the system is given at chemical equilibrium.
static auto UV(ChemicalSystem const &system) -> EquilibriumSpecs
Return specifications for a chemical equilbrium problem with given internal (U) energy and volume (V)...
auto elementMassInPhase(StringOrIndex const &element, StringOrIndex const &phase) -> void
Specify that the mass of an element in a phase is given at chemical equilibrium.
static auto TP(ChemicalSystem const &system) -> EquilibriumSpecs
Return specifications for a chemical equilbrium problem with given temperature (T) and pressure (P).
auto phaseAmount(StringOrIndex const &phase) -> void
Specify that the amount of a phase is given at chemical equilibrium.
static auto SP(ChemicalSystem const &system) -> EquilibriumSpecs
Return specifications for a chemical equilbrium problem with given entropy (S) and pressure (P).
auto chemicalPotential(String substance) -> void
Specify that the chemical potential of a substance is given at chemical equilibrium.
auto openTo(ChemicalFormula const &substance) -> void
Specify that the chemical system is open to a substance.
auto activity(String species) -> void
Specify that the activity of a species is given at chemical equilibrium.
auto phaseVolume(StringOrIndex const &phase) -> void
Specify that the volume of a phase is given at chemical equilibrium.
auto pH() -> void
Specify that the pH is given at chemical equilibrium.
auto pressure() -> void
Specify that the pressure of the system is given at chemical equilibrium.
auto fugacity(String gas) -> void
Specify that the fugacity of a gaseous species is given at chemical equilibrium.
auto unknownTemperature() -> void
Specify that the temperature of the system is unknown in the chemical equilibrium calculation.
auto unknownPressure() -> void
Specify that the pressure of the system is unknown in the chemical equilibrium calculation.
auto lgActivity(String species) -> void
Specify that the lg activity of a species is given at chemical equilibrium.
auto numInputs() const -> Index
Return the number of introduced input variables.
auto elementAmountInPhase(StringOrIndex const &element, StringOrIndex const &phase) -> void
Specify that the amount of an element in a phase is given at chemical equilibrium.
auto pE() -> void
Specify that pE is given at chemical equilibrium.
auto phaseMass(StringOrIndex const &phase) -> void
Specify that the mass of a phase is given at chemical equilibrium.
EquilibriumSpecs(ChemicalSystem const &system)
Construct an EquilibriumSpecs object.
static auto TV(ChemicalSystem const &system) -> EquilibriumSpecs
Return specifications for a chemical equilbrium problem with given temperature (T) and volume (V).
auto charge() -> void
Specify that the electric charge is given at chemical equilibrium.
auto addUnknownStandardChemicalPotential(String const &species) -> void
Specify that the standard chemical potential of a species is unknown at equilibrium and must be compu...
auto internalEnergy() -> void
Specify that the internal energy of the system is given at chemical equilibrium.
auto pMg() -> void
Specify that pMg is given at chemical equilibrium.
auto enthalpy() -> void
Specify that the enthalpy of the system is given at chemical equilibrium.
auto Eh() -> void
Specify that Eh is given at chemical equilibrium.
auto elementAmount(StringOrIndex const &element) -> void
Specify that the amount of an element is given at chemical equilibrium.
auto addUnknownChemicalPotential(String const &species) -> void
Specify that the chemical potential of a species is unknown at equilibrium and must be computed.
auto gibbsEnergy() -> void
Specify that the Gibbs energy of the system is given at chemical equilibrium.
auto addUnknownActivityCoefficient(String const &species) -> void
Specify that the activity coefficient of a species is unknown at equilibrium and must be computed.
auto addUnknownTitrantAmount(ChemicalFormula const &substance) -> void
Specify that the chemical system is open to a given chemical state. // TODO: Implement EquilibriumSpe...
auto temperature() -> void
Specify that the temperature of the system is given at chemical equilibrium.
A type used to represent the value of a parameter and its lower and upper bounds.
Definition: Param.hpp:32
A type used to represent a chemical species and its attributes.
Definition: Species.hpp:35
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:28
std::vector< T > Vec
Convenient alias for std::vector<T>.
Definition: Types.hpp:66
Eigen::Ref< const VectorXr > VectorXrConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:60
Eigen::MatrixXd MatrixXd
Convenient alias to Eigen type.
Definition: Matrix.hpp:137
std::string String
Convenient alias for std::string.
Definition: Types.hpp:52
std::size_t Index
Define a type that represents an index.
Definition: Index.hpp:26
autodiff::real real
The number type used throughout the library.
Definition: Real.hpp:26
std::vector< std::string > Strings
Convenient alias for std::vector<String>.
Definition: Types.hpp:55
Eigen::VectorXd VectorXd
Convenient alias to Eigen type.
Definition: Matrix.hpp:74
std::variant< Index, int, std::string > StringOrIndex
The type used to accept either a name or an index.
Definition: Types.hpp:58
autodiff::VectorXreal VectorXr
Convenient alias to Eigen type.
Definition: Matrix.hpp:58
std::function< F > Fn
Convenient alias for std::function<R(Args...)>.
Definition: Types.hpp:110
Used to define equation constraints in a chemical equilibrium problem.
Definition: EquilibriumSpecs.hpp:155
Used to define a p control variable in a chemical equilibrium problem.
Definition: EquilibriumSpecs.hpp:69
ChemicalFormula substance
The chemical formula of the substance associated to this p control variable (optional).
Definition: EquilibriumSpecs.hpp:79
Index ispecies
The index of the species whose chemical potential is unknown and defined in terms of this p control v...
Definition: EquilibriumSpecs.hpp:82
ChemicalPotentialFn fn
The function that introduces association between this p control variable and the chemical potential o...
Definition: EquilibriumSpecs.hpp:85
String name
The unique name for this p control variable (required).
Definition: EquilibriumSpecs.hpp:76
Fn< real(ChemicalProps const &props, real const &pk)> ChemicalPotentialFn
The signature of functions that evaluate the chemical potential of a species in terms of a p control ...
Definition: EquilibriumSpecs.hpp:73
Used to define a q control variable in a chemical equilibrium problem.
Definition: EquilibriumSpecs.hpp:41
Fn< real(ChemicalProps const &props, VectorXrConstRef const &p, VectorXrConstRef const &w)> ChemicalPotentialFn
The signature of functions that evaluate the prescribed chemical potential of a substance.
Definition: EquilibriumSpecs.hpp:46
ChemicalFormula substance
The chemical formula of the substance associated to this q control variable (required).
Definition: EquilibriumSpecs.hpp:52
String id
The unique identifier for the chemical potential constraint associated to this q control variable (re...
Definition: EquilibriumSpecs.hpp:55
ChemicalPotentialFn fn
The chemical potential function associated to this q control variable (required).
Definition: EquilibriumSpecs.hpp:58
String name
The unique name for this q control variable (required).
Definition: EquilibriumSpecs.hpp:49
Used to define the function that evaluates the residual of an equation constraint in a chemical equil...
Definition: EquilibriumSpecs.hpp:90
Fn< real(ChemicalProps const &props)> Func3
An alternative signature of functions that evaluate the residual of an equation constraint.
Definition: EquilibriumSpecs.hpp:104
EquationConstraintFn()=default
Construct a default EquationConstraintFn object.
auto operator=(Func1 const &f)
Assign an equilibrium constraint function with signature EquationConstraintFn::Func1 to this Equation...
Definition: EquilibriumSpecs.hpp:125
EquationConstraintFn(Func3 const &f)
Construct an EquationConstraintFn object with given equilibrium constraint function with signature Fu...
Definition: EquilibriumSpecs.hpp:116
auto operator=(Func3 const &f)
Assign an equilibrium constraint function with signature EquationConstraintFn::Func3 to this Equation...
Definition: EquilibriumSpecs.hpp:131
EquationConstraintFn(Func1 const &f)
Construct an EquationConstraintFn object with given equilibrium constraint function with signature Fu...
Definition: EquilibriumSpecs.hpp:110
EquationConstraintFn(Func2 const &f)
Construct an EquationConstraintFn object with given equilibrium constraint function with signature Fu...
Definition: EquilibriumSpecs.hpp:113
Func1 _fn
The function that evaluates the residual of the equation constraint.
Definition: EquilibriumSpecs.hpp:140
auto operator=(Func2 const &f)
Assign an equilibrium constraint function with signature EquationConstraintFn::Func2 to this Equation...
Definition: EquilibriumSpecs.hpp:128
auto initialized() const
Return true if this EquationConstraintFn object has been initialized with an equilibrium constraint f...
Definition: EquilibriumSpecs.hpp:134
auto operator()(ChemicalProps const &props, VectorXrConstRef const &p, VectorXrConstRef const &w) const -> real
Evaluate the residual of the equation constraint.
Definition: EquilibriumSpecs.hpp:122
Fn< real(ChemicalProps const &props, VectorXrConstRef const &p, VectorXrConstRef const &w)> Func1
The main signature of functions that evaluate the residual of an equation constraint.
Definition: EquilibriumSpecs.hpp:95
Fn< real(ChemicalProps const &props, VectorXrConstRef const &w)> Func2
An alternative signature of functions that evaluate the residual of an equation constraint.
Definition: EquilibriumSpecs.hpp:100
Used to define equation constraints in a chemical equilibrium problem.
Definition: EquilibriumSpecs.hpp:145
String id
The unique identifier for this equation constraint.
Definition: EquilibriumSpecs.hpp:147
EquationConstraintFn fn
The function defining the equation to be satisfied at chemical equilibrium.
Definition: EquilibriumSpecs.hpp:150
Used to define a system of equation constraints in a chemical equilibrium problem.
Definition: EquilibriumSpecs.hpp:159
Fn< VectorXr(ChemicalProps const &props, VectorXrConstRef const &w, VectorXrConstRef const &p)> Func
The signature of functions that evaluate the residual of the system of equation constraints.
Definition: EquilibriumSpecs.hpp:164
Strings ids
The unique identifier for each equation constraint.
Definition: EquilibriumSpecs.hpp:167
Func fn
The function defining the system of equations to be satisfied at chemical equilibrium.
Definition: EquilibriumSpecs.hpp:170
Used to define reactivity restrictions among species in the chemical equilibrium calculation.
Definition: EquilibriumSpecs.hpp:177
VectorXd Kn
The linear equation coefficients in the constraint corresponding to the species amounts variables n.
Definition: EquilibriumSpecs.hpp:182
String id
The unique identifier for this reactivity constraint.
Definition: EquilibriumSpecs.hpp:179
VectorXd Kp
The linear equation coefficients in the constraint corresponding to the introduced control variables ...
Definition: EquilibriumSpecs.hpp:185
Used to define a system of reactivity restrictions among species in the chemical equilibrium calculat...
Definition: EquilibriumSpecs.hpp:192
MatrixXd Kp
The coefficient matrix of the linear reactivity constraint equations corresponding to the introduced ...
Definition: EquilibriumSpecs.hpp:200
MatrixXd Kn
The coefficient matrix of the linear reactivity constraint equations corresponding to the species amo...
Definition: EquilibriumSpecs.hpp:197
Strings ids
The unique identifiers for each reactivity constraint.
Definition: EquilibriumSpecs.hpp:194