关于openfoam中计算气体密度的疑问
-
@脉动通风 是的。
$$\rho = \frac {1} {RT} p= \psi p$$
$$ \psi = \frac {1} {RT}=\frac {1} {\frac{RR}{M} T}$$
在perfectGasI.H文件中可以看到:
$$ \psi = \frac {1} {RT}$$template<class Specie> inline Foam::scalar Foam::perfectGas<Specie>::psi(scalar p, scalar T) const { return 1.0/(this->R()*T); }
this->R()可以在speciesI.H文件里看到:(从这里可以看出来RR除以摩尔质量)
$$ R = \frac{RR}{M} $$inline scalar specie::R() const { return RR/molWeight_; }
这个RR在thermodynamicConstants.C文件中:
// Note: the 1e3 converts from /mol to /kmol for consistency with the // SI choice of kg rather than g for mass. // This is not appropriate for USCS and will be changed to an entry in // the DimensionedConstants dictionary in etc/controlDict const scalar RR = 1e3*physicoChemical::R.value();
physicoChemical::R.value()就是通用气体常数8.314。因为molWeight单位是kg/kmol,RR要乘以1000.
-
@wangfei9088 非常感谢大佬的指点!! 完美解决了这个问题