Skip to content
Snippets Groups Projects
Commit c31a254c authored by Gabi Seitz's avatar Gabi Seitz Committed by Timo Koch
Browse files

[steamn2.hh] fix bug in the viscosity calculation

and correct reference solution
parent 7885aa47
No related branches found
No related tags found
1 merge request!1009Cleanup/1pncmin test
......@@ -319,10 +319,14 @@ public:
N2::molarMass()
};
Scalar x[numComponents] = {
fluidState.moleFraction(phaseIdx, H2OIdx),
fluidState.moleFraction(phaseIdx, N2Idx)
};
Scalar sumx = 0.0;
for (int compIdx = 0; compIdx < 2; ++compIdx)
sumx += fluidState.moleFraction(phaseIdx, compIdx);
sumx = std::max(1e-10, sumx);
for (int i = 0; i < numComponents; ++i) {
......@@ -331,9 +335,9 @@ public:
Scalar phiIJ = 1 + sqrt(mu[i]/mu[j]) * pow(M[j]/M[i], 1/4.0);
phiIJ *= phiIJ;
phiIJ /= sqrt(8*(1 + M[i]/M[j]));
divisor += fluidState.moleFraction(phaseIdx, j)/sumx * phiIJ;
divisor += x[j]/sumx * phiIJ;
}
muResult += fluidState.moleFraction(phaseIdx, i)/sumx * mu[i] / divisor;
muResult += x[i]/sumx * mu[i] / divisor;
}
return muResult;
}
......
......@@ -10,7 +10,7 @@
0.981775 0.981775 0.981775 0.981775 0.981775 0.981775
</DataArray>
<DataArray type="Float32" Name="mu" NumberOfComponents="1" format="ascii">
2.37923e-05 2.37923e-05 2.37923e-05 2.37923e-05 2.37923e-05 2.37923e-05
2.44123e-05 2.44123e-05 2.44123e-05 2.44123e-05 2.44123e-05 2.44123e-05
</DataArray>
<DataArray type="Float32" Name="delp" NumberOfComponents="1" format="ascii">
100000 100000 100000 100000 100000 100000
......
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