# Internal flow through valve (3D)

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

July 8, 2019, 10:36
Internal flow through valve (3D)
#1
Senior Member

Lee Strobel
Join Date: Jun 2016
Posts: 122
Rep Power: 7
Hi. I've just attempted my first 'serious' simulation in OpenFOAM and thought I would post some images, with some questions and comments that I have.

The model is a 3D half-symmetric model of a control valve. I have done a lot of simulations of these in FLUENT over the past couple of years, so I am comparing the results in Foam to what I usually get in FLUENT. The flow is incompressible water, with a lot of separation and mixing, so I have used the simpleFoam solver with k-epsilon turbulence model. You can see from the images that I created a polyhedral mesh in FLUENT and then imported it to OF. It has 10 inflation layers. For boundary conditions, I used totalPressure at the inlet of 517 kPa and static pressure at the outlet of 345 kPa. I used the nutkWallFunction on the walls.

I had a little bit of trouble at first with the field initialization. Normally in FLUENT I would use the hybrid initialization method, which actually solves some simplified equations to give an initial flow field. However, it seems that OF doesn't have this? Anyway, I eventually had some success with setting the initial velocity everywhere to 0 and initializing the pressure everywhere to the outlet pressure.

In terms of the solution, it converged quite nicely and seemed to settle to a very similar overall volumetric flow rate that I had achieved in FLUENT. However, the k and epsilon values in some areas seemed very high (as can be seen in the contour plots - max. k ~50, max. epsilon ~400,000), which I didn't get in FLUENT. However, these high values didn't seem to be having a huge effect on the overall volumetric flow result and also the turbulence equations seemed quite stable. The residuals for the turbulence equations were quite low (< 10^-4).

So, it seems that the solution was converged with those high k, epsilon values. In that case, I would think the problem must be an inaccuracy in the model equations that I am using - perhaps the wall function or the yplus values are not appropriate?

I tried to check the wall yplus; however, I got the following error

Code:
```/*---------------------------------------------------------------------------*\
=========                 |
\\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
\\    /   O peration     | Website:  https://openfoam.org
\\  /    A nd           | Version:  6
\\/     M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 6
Exec   : postProcess -time 25 -func yPlus
Date   : Jul 07 2019
Time   : 06:54:13
Host   : ***
PID    : ***
I/O    : uncollated
Case   : ***
nProcs : 1
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 25

Time = 25

Executing functionObjects

--> FOAM FATAL ERROR:
Unable to find turbulence model in the database

From function bool Foam::functionObjects::yPlus::execute()
in file yPlus/yPlus.C at line 185.

FOAM exiting```
Does anyone know how I can resolve this?

Another couple of questions that I have:

1) Is there any equivalent in OF to the pressure-based coupled solver in FLUENT? I often use that for these types of internal flow problems and find that it tends to converge faster than the segregated algorithms.

2) I really like Paraview! It seems better for postprocessing than either the built-in capabilities in FLUENT or CFD-Post. Does anyone know if it is possible to export FLUENT data into Paraview?

Attached Images
 41k_mesh_poly.jpg (83.4 KB, 32 views) 41k_vel_contours.jpeg (43.5 KB, 27 views) 41k_k_contours.jpeg (36.7 KB, 24 views) 41k_eps_contours.jpeg (42.9 KB, 21 views)

 July 8, 2019, 11:11 #2 Super Moderator     Tobias Holzmann Join Date: Oct 2010 Location: Augsburg Posts: 2,587 Blog Entries: 6 Rep Power: 46 Hi, I just read your error message and can give you the following info: Code: `yourSolver -postProcess -time 25 -func yPlus` Time4Tea likes this. __________________ Keep foaming, Tobias Holzmann

 July 8, 2019, 11:43 #3 Senior Member   Lee Strobel Join Date: Jun 2016 Posts: 122 Rep Power: 7 @Tobi: ah, thanks! That worked. It seems curious that it is necessary to invoke the solver though. I would have thought the postprocessing would be done on the result data files, independent of whatever solver was used to generate them.

July 9, 2019, 07:32
#4
Senior Member

Join Date: Jan 2014
Posts: 177
Rep Power: 9
Quote:
 It seems curious that it is necessary to invoke the solver though.
yPlus needs the value of viscosity which is retrieved by invoking solver. Same for wallShearstress.

Quote:
 Is there any equivalent in OF to the pressure-based coupled solver in FLUENT?
Have a look at foam-extended

Quote:
 it is possible to export FLUENT data into Paraview
If Fluent can export the data in Ensight format you can open the data in paraview

 July 10, 2019, 08:14 #5 Senior Member   Lee Strobel Join Date: Jun 2016 Posts: 122 Rep Power: 7 @hxaxtma: thanks for your helpful advice.

 July 11, 2019, 09:03 #6 Senior Member   Lee Strobel Join Date: Jun 2016 Posts: 122 Rep Power: 7 So, does anyone have any idea what might be causing the unrealistic k/epsilon numbers? For the wall boundary conditions, I am using nutkWallFunction in the 0/nut file; kqRWallFunction in the 0/k file; and epsilonWallFunction in the 0/epsilon file. I also tried running the same case with the kOmegaSST turbulence model, thinking it should be less sensitive to wall y+ than k-epsilon; however, the k/omega solutions explode within a few iterations. There, I again used nutkWallFunction in 0/nut; kqRWallFunction in 0/k; and omegaWallFunction in 0/omega.

 August 2, 2019, 02:57 #7 New Member   WJ Join Date: Feb 2016 Location: MyHome Posts: 11 Rep Power: 7 As k-epsilon works kwSST doesn't work, I think there could be two main possible reasons. 1. Mesh (especially for boundary layer) 2. BCs Because kepsilon model is assuming fully developed flow, usually y+ range is 30-100. kwSST usually requires y+ range from 5 to 30. So, kwSST is more sensitive to boundary layer mesh. And I wonder what initial GUESS values for k ,e and w you used. It is better to use values from calculator, which are available on this site. https://www.cfd-online.com/Wiki/Turb...ary_conditions https://www.cfd-online.com/Tools/turbulence.php