Skip to content
Snippets Groups Projects
Commit 434d8673 authored by Ian Bell's avatar Ian Bell
Browse files

Make more of vdW hidden

parent 3362c84d
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,6 @@
class vdWEOS1 {
private:
double a, b;
public:
vdWEOS1(double a, double b) : a(a), b(b) {};
......@@ -32,24 +31,11 @@ class vdWEOS {
private:
std::valarray<NumType> ai, bi;
std::valarray<std::valarray<NumType>> k;
public:
vdWEOS(const std::valarray<NumType>& Tc_K, const std::valarray<NumType>& pc_Pa)
{
ai.resize(Tc_K.size());
bi.resize(Tc_K.size());
for (auto i = 0; i < Tc_K.size(); ++i) {
ai[i] = 27.0 / 64.0 * pow(R * Tc_K[i], 2) / pc_Pa[i];
bi[i] = 1.0 / 8.0 * R * Tc_K[i] / pc_Pa[i];
}
k = std::valarray<std::valarray<NumType>>(std::valarray<NumType>(0.0, Tc_K.size()), Tc_K.size());
};
const NumType R = get_R_gas<double>();
template<typename TType, typename IndexType>
template<typename TType, typename IndexType>
auto get_ai(TType T, IndexType i) const { return ai[i]; }
template<typename TType, typename IndexType>
template<typename TType, typename IndexType>
auto get_bi(TType T, IndexType i) const { return bi[i]; }
template<typename TType, typename CompType>
......@@ -74,6 +60,20 @@ public:
return b_;
}
public:
vdWEOS(const std::valarray<NumType>& Tc_K, const std::valarray<NumType>& pc_Pa)
{
ai.resize(Tc_K.size());
bi.resize(Tc_K.size());
for (auto i = 0; i < Tc_K.size(); ++i) {
ai[i] = 27.0 / 64.0 * pow(R * Tc_K[i], 2) / pc_Pa[i];
bi[i] = 1.0 / 8.0 * R * Tc_K[i] / pc_Pa[i];
}
k = std::valarray<std::valarray<NumType>>(std::valarray<NumType>(0.0, Tc_K.size()), Tc_K.size());
};
const NumType R = get_R_gas<double>();
template<typename TType, typename RhoType>
auto alphar(TType T,
const RhoType& rho,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment