Real SinglePhaseFluidProperties::c(Real p, Real T) const { mooseDeprecated(name(), ": c() is deprecated. Use c_from_p_T() instead"); return c_from_p_T(p, T); }
void IdealRealGasMixtureFluidProperties::c_from_p_T(Real p, Real T, const std::vector<Real> & x, Real & c, Real & dc_dp, Real & dc_dT, std::vector<Real> & dc_dx) const { Real p_perturbed, T_perturbed, c_perturbed; c = c_from_p_T(p, T, x); // For derived properties, we would need higher order derivatives; // therefore, numerical derivatives are used here p_perturbed = p * 1.e-6; c_perturbed = c_from_p_T(p_perturbed, T, x); dc_dp = (c_perturbed - c) / (p_perturbed - p); Real dT = 1.e-6; T_perturbed = T + dT; c_perturbed = c_from_p_T(p, T_perturbed, x); dc_dT = (c_perturbed - c) / (dT); dc_dx.resize(_n_secondary_vapors); for (unsigned int i = 0; i < _n_secondary_vapors; i++) { Real c_perturbed; std::vector<Real> x_perturbed(x); Real dx_i = 1e-6; for (unsigned int j = 0; j < _n_secondary_vapors; j++) { if (j != i) x_perturbed[j] = x[j] * (1.0 - (x[i] + dx_i)) / (1.0 - x[i]); // recalculate new mass fractions } x_perturbed[i] += dx_i; c_perturbed = c_from_p_T(p, T, x_perturbed); dc_dx[i] = ((c_perturbed - c) / dx_i); } }
Real SinglePhaseFluidProperties::c(Real pressure, Real temperature) const { return c_from_p_T(pressure, temperature); }