# Velocity Loss in simpleFoam, Turbulent Flow

 Register Blogs Members List Search Today's Posts Mark Forums Read

January 16, 2018, 04:05
rhoSimpleFoam_Temperature
#21
New Member

Soheil
Join Date: Mar 2014
Location: Helsinki
Posts: 21
Rep Power: 8
Hello again,

I am working on the same geometry, this time in a compressible form and rhoSimpleFoam solver. All I want to see is a regular change in Temperature contours. Temperature changes very well at the top. But it does not change at the bottom.
My professor did the same simulation with Fluent and she got the result (picture attached)..Wants me to generate the same results with openfoam. She added UDF for T…something like: T=295+0.05z.
But I can’t implement that in OpenFoam.

First question; is there any way to apply a boundary condition as an equation in OpenFOAM? In a way that temperature changes according to the Z direction (height of the domain).

Another question is..How we can implement something like the equation below in OpenFoam: U_BL=0.2/0.4*log(z/0.163). It is for Fluent UDF.

I would be thankful for any help and suggestion guys. (Files and pictures are attached).
Attached Images
 Residuals.png (161.4 KB, 3 views) boundaryC.png (181.9 KB, 2 views) Fluent.jpg (52.0 KB, 3 views) T_OpenFoam.png (66.5 KB, 1 views)
Attached Files
 compressbileSimulation.zip (12.4 KB, 0 views)

 January 16, 2018, 09:57 #22 Member   Anders Utnes Join Date: May 2017 Location: Norway Posts: 34 Rep Power: 5 Ouch. Im sorry, but I dont know if any of the "standard" boundary conditions will be off much use to you here. There are possibilities, however. You could program, or find someone that allready have programmed, a special boundary condition function that solves this. I know that I've once seen something similar done for a parabolic velocity inlet (in order to get a laminar flow in to a channel). Searching for that might help you on your way. A second option is to define the boundary condition as a fixed list. This would manually give a specific value for each cell on the boundary. Then you could simply pre-calcualte the value for the function at each cell. This ofcoarse is practically impossible on a large mesh, unless you write some program to do it for you. It will also be horribly problematic to update if conditions change. I fear I can't be of more help here. soheil_r7 likes this. Last edited by Alasir; January 16, 2018 at 10:58.

 January 16, 2018, 10:51 #23 Senior Member   Taher Chegini Join Date: Nov 2014 Location: Houston, Texas Posts: 127 Rep Power: 8 It sure is possible. There are couple of approaches, the most flexible one using coded. Here what I did to achieve a parabolic boundary condition for velocity: Code: ```inlet { type codedFixedValue; value uniform (0 0 0); redirectType parabolaProfile; code #{ const fvPatch& boundaryPatch = patch(); const vectorField& Cf = boundaryPatch.Cf(); vectorField& field = *this; scalar uave = 10; scalar h = 5e-3; scalar vel; forAll(Cf, faceI) { vel = 6 * uave / (h*h) * (h * Cf[faceI].y() - Cf[faceI].y() * Cf[faceI].y()); field[faceI] = vector(vel, 0, 0); } #}; }``` You can use the same idea for any other field. Another approach would be use a non-uniform list. You can take a look at this thread. soheil_r7 likes this.

 Tags simplefoam, velocity