CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Wrong Solution for sensibleEnthalpy (https://www.cfd-online.com/Forums/openfoam-solving/245680-wrong-solution-sensibleenthalpy.html)

Hanno66 October 19, 2022 09:13

Wrong Solution for sensibleEnthalpy
 
Hello,

I'm using OpenFoamv7.
While trying rhoCentralFoam at the shock Tube, I realised that the Solution is different from the analytic Solution. I tracked the misstake to the thermophysicalproperties.
When using sensibleEntahlpy for the energy the Soultion seems to be wrong, while using sensibleInternalEnergy results in the correct Solution.

Now I'm searching for the reason, because I will have to use sensibleEnthalpy for a individual Solver (the reason I'm using OpenFoam v7).

Anyone has an answer to my Problem?

Bloerb October 19, 2022 09:49

The difference should likely result from your definition of cv / cp. Aside from that, they should be equal. There are numerical advantages, but the formal definition is identical, so if one has a significantly higher residual that should give it away. If one of them did not converge.


Hence check cv/cp and the residuals.

Hanno66 October 20, 2022 11:49

I double checked the values for cp and cv and everything seems to be ok....

Bloerb October 20, 2022 13:44

Are they the same or different? You might want to use the same value for both

Hanno66 October 21, 2022 04:57

They are different. Why should using the same value for both result in a correct Solution? They are different by definiton?

Bloerb October 21, 2022 06:51

That is the question I am asking....make sure you use the correct values here for the medium, pressure etc you are solving for! With incompressible flow you should have cp=cv...if your medium does not behave like an ideal gas you might want to make sure to double check your thermodynamics. They are only different if some of the energy used to heat up the fluid goes towards thermal expansion...this might not be the case numerically and hence the difference.

Hanno66 December 3, 2022 06:31

Sorry for the late Reply...
I tried it with cp=cv and I got the right Solution. But I still don't get why.
I use a compressible Solver (rhoCentralFoam) with air, so cv and cp can't be the same. Why is the Solution still correct?

Bloerb December 5, 2022 04:32

Full Energy equation formulated with internal energy:
0=\nabla\cdot\left(\left(e+\frac{1}{2}\mathbf{v}\cdot\mathbf{v}\right)\rho\mathbf{v}\right)-\nabla\cdot\left(\frac{\lambda}{c_v}\nabla   e\right)-\rho\mathbf{g}\cdot\mathbf{v}+\nabla\cdot\left(\mathbf{v}p\right)
Full Energy equation formulated with Enthalpy:
0=\nabla\cdot\left(\left(h+\frac{1}{2}\mathbf{v}\cdot\mathbf{v}\right)\rho\mathbf{v}\right)-\nabla\cdot\left(\frac{\lambda}{c_p}\nabla  h\right)-\rho\mathbf{g}\cdot\mathbf{v}


You can transform both formulations into each other. In other words they are identical. If you ignore the different variable names h or e, you can see that the only difference is the pressure work term div(pv). That describes the work needed to change the volume. Let's assume this to be zero. I.e an incompressible fluid. You'd get different solutions if you had a difference between cp and cv in that case. One would need to consider h=cp T and e = cv T and still you wouldn't have the same solution.



So it does not matter if you are using a compressible solver. If there is no compression because your flow is to slow you'll get a wrong solution.
The reason being that your equation of state assumption is not valid.



You assume that there is compression when there is likely none.

Hanno66 December 12, 2022 10:54

I'm looking at a shock tube with a 20 bar and a 1 bar side so there should be a compression involved...


All times are GMT -4. The time now is 14:48.