Skip to content
Snippets Groups Projects
Commit eab7a639 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'feature/speedup-h2oair-viscosity' into 'master'

[h2oair] Use sqrt instead of pow to speedup viscosity evaluation

test_stokes2c with refined grid speeds up by 2.7%.

See merge request !192
parents c0494c0c 4eda84b7
No related branches found
No related tags found
1 merge request!192[h2oair] Use sqrt instead of pow to speedup viscosity evaluation
......@@ -493,11 +493,9 @@ public:
Scalar divisor = 0;
for (int j = 0; j < numComponents; ++j)
{
Scalar phiIJ = 1 + sqrt(mu[i]/mu[j]) * // 1 + (mu[i]/mu[j]^1/2
pow(M[j]/M[i], 1./4.0); // (M[i]/M[j])^1/4
phiIJ *= phiIJ;
phiIJ /= sqrt(8*(1 + M[i]/M[j]));
// 1 + (mu[i]/mu[j]^1/2 * (M[i]/M[j])^1/4)
Scalar phiIJ = 1 + sqrt(mu[i]/mu[j] * sqrt(M[j]/M[i]));
phiIJ = phiIJ * phiIJ / sqrt(8*(1 + M[i]/M[j]));
divisor += fluidState.moleFraction(phaseIdx, j)*phiIJ;
}
muResult += fluidState.moleFraction(phaseIdx, i)*mu[i] / divisor;
......
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