Swak4Foam/GroovyBC for total pressure in simpleFoam
Hi to everyone,
I am trying to set up a case where I define the total pressure at the inlet and the static pressure at the outlet of the computational domain. I am working with the simpleFoam solver and since it does not support total pressure BCs I am trying to implement the condition using Groovy BC.
So, since simpleFoam works using kinematic pressure (p/rho) instead of the actual pressure, the formula for the kinematic total pressure is:
ptot = p + 1/2 * |u|^2 (all p refer to kinematic pressures)
thus I have to set on the boundary the value of p = ptot - 1/2* |u|^2. I tried to do so in the following way, but it does not work:
(the following is the relevant entry in the p file of the '0' folder for simpleFoam)
How should I define the velocity vector, in order to get the average velocity magnitude on the face, so that I can use it for the calculation?
Thanks in advance.
It seems that the problem I have is more complicated...
I tried to replace the condition at inlet with something much simpler, but it does not work either.
The new boundary condition I use is (as before this is from the p entry in the 0 folder):
value uniform 6722.237;
This condition of course is the trivial fixed value. However, upon execution, after the first iteration, the value of pressure at the boundary is 0, which obviously is not what is defined in the groovyBC...
Regarding the compilation of the swak4Foam package, I did not get any errors (apart from the issue with the python configuration, but I am not interested in python integration right now) and I have all the relevant libraries generated.
Of course I have the required libraries included in the controlDict file:
A final note: I am using OpenFoam 2.2.x and for swak4Foam I use the version from Bruno (post#8 - http://www.cfd-online.com/Forums/ope...tml#post434217, as suggested by the relevant page in the wiki http://openfoamwiki.net/index.php/Contrib/swak4Foam).
Any ideas on that?
Ok, after some searching I have found the solution of the problems. First of all when closing the variables section there should be a semicolon.
For the pressure/total pressure boundary conditions it seems that it is more stable to dynamically alter the velocity on the boundary according to the local pressure, instead of pressure itself; the reason is that when fixing pressure at the inlet, there might be development of unphysical recirculation which destabilize the solution. By altering the velocity (and keeping zero gradient for pressure) at inlet the solution is much stabler.
For fixing pressure, by dynamically altering the velocity the condition is:
Hope it will be useful for others...
The idea to average on the face was to enhance stability. I could (or anyone else interested) try the per face calculation, instead of the per patch averaging and see what I get, but the results I got were really satisfactory. I will keep it in mind for any future calculations.
So thank you for your comment and also I would like to particularly thank you for your contribution as a whole (I refer to swak4Foam).
For usage of storedVariables see the incomplete reference guide and examples
|All times are GMT -4. The time now is 01:47.|