20 #define propfuncAD(want, prop1, prop2) \ 21 virtual DualReal want##_from_##prop1##_##prop2( \ 22 const DualReal & p1, const DualReal & p2, const std::vector<DualReal> & x) const \ 24 Real p1_raw = p1.value(); \ 25 Real p2_raw = p2.value(); \ 26 std::vector<Real> x_raw(x.size(), 0); \ 27 for (unsigned int i = 0; i < x.size(); ++i) \ 28 x_raw[i] = x[i].value(); \ 33 std::vector<Real> dy_dx(x.size(), 0); \ 34 want##_from_##prop1##_##prop2(p1_raw, p2_raw, x_raw, y_raw, dy_dp1, dy_dp2, dy_dx); \ 36 DualReal result = y_raw; \ 37 result.derivatives() = p1.derivatives() * dy_dp1 + p2.derivatives() * dy_dp2; \ 38 for (unsigned int i = 0; i < x.size(); ++i) \ 39 result.derivatives() += x[i].derivatives() * dy_dx[i]; \ 43 virtual void want##_from_##prop1##_##prop2(const DualReal & prop1, \ 44 const DualReal & prop2, \ 45 std::vector<DualReal> & x, \ 47 DualReal & d##want##d1, \ 48 DualReal & d##want##d2, \ 49 std::vector<DualReal> & d##want##dx) const \ 52 name(), ": ", __PRETTY_FUNCTION__, " derivative derivatives not implemented."); \ 53 Real dummy, tmp1, tmp2; \ 54 std::vector<Real> x_raw(x.size(), 0); \ 55 std::vector<Real> tmp3(x.size(), 0); \ 56 for (unsigned int i = 0; i < x.size(); ++i) \ 57 x_raw[i] = x[i].value(); \ 58 val = want##_from_##prop1##_##prop2(prop1, prop2, x); \ 59 want##_from_##prop1##_##prop2(prop1.value(), prop2.value(), x_raw, dummy, tmp1, tmp2, tmp3); \ 62 for (unsigned int i = 0; i < x.size(); ++i) \ 63 d##want##dx[i] = tmp3[i]; \ 70 #define propfunc(want, prop1, prop2) \ 71 virtual Real want##_from_##prop1##_##prop2(Real, Real, const std::vector<Real> &) const \ 73 mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented."); \ 76 virtual void want##_from_##prop1##_##prop2(Real prop1, \ 78 const std::vector<Real> & x, \ 82 std::vector<Real> & d##want##dx) const \ 84 fluidPropError(name(), ": ", __PRETTY_FUNCTION__, " derivatives not implemented."); \ 87 std::fill(d##want##dx.begin(), d##want##dx.end(), 0.); \ 88 val = want##_from_##prop1##_##prop2(prop1, prop2, x); \ 91 propfuncAD(want, prop1, prop2) 109 #pragma GCC diagnostic push 110 #pragma GCC diagnostic ignored "-Woverloaded-virtual" 135 virtual unsigned int getNumberOfSecondaryVapors()
const = 0;
151 template <
typename... Args>
161 #pragma GCC diagnostic pop
Base class for fluid properties of vapor mixtures.
static const std::string cv
const bool _allow_imperfect_jacobians
Flag to set unimplemented Jacobian entries to zero.
e T T T T propfunc(e, p, rho)
VaporMixtureFluidProperties(const InputParameters ¶meters)
void fluidPropError(Args... args) const
void mooseWarning(Args &&... args) const
static const std::string cp
const std::vector< double > x
static InputParameters validParams()
static const std::string mu
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real primaryMassFraction(const std::vector< Real > &x) const
Computes the mass fraction of the primary vapor given mass fractions of the secondary vapors...
void mooseError(Args &&... args) const
virtual ~VaporMixtureFluidProperties()
const InputParameters & parameters() const
static const std::string k