I'm trying to change the linear property estimation in interFoam solver to an exponential averaging by modifying the existing equation
Code:
𝜇 = 𝛾𝜇𝑙 + (1 − 𝛾)𝜇𝑔
to the equation in the attached image, where C is a constant of 25.
I've modified the lines of code impacting the property estimation in three separate files (incompressibleTwoPhaseMixture.C, createFields.H, and alphaEqnSubCycle.H). I've attached the files here. The syntax I've used in alphaEqnSubCycle.H is shown below.
Code:
Original Code which has been commented out:
//rho == alpha1*rho1 + alpha2*rho2;
Custom code:
rho == rho2 + (rho1 - rho2)*(Foam::exp(scalar(25)*limitedAlpha1)-scalar(1))/Foam::exp(scalar(25));
Now the issue I'm facing is while post processing is that I'm finding the variation of the property along the interface is not linear and somewhat exponential, but the values at the points are not as expected if I directly apply my equation using the computed alpha values. Can someone please shed some light on this?
Note: I used plot over line function on paraview and saved the data in csv format and removed the multiple entries for 0 & 1 volume fraction, to get below table.
HTML Code:
Output from Openfoam Expected rho Values Based on Function
alpha.water rho
0.24673 15.789 1.225006846
0.48029 37.635 1.227355937
0.69946 249.01 1.789643492
0.91413 519.61 122.15227
0.9696 772.34 485.154527
0.99854 1022.1 998.9116916
0.99996 1035 1034.965742
1 1036 1036