CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Internal flow through valve (3D) (https://www.cfd-online.com/Forums/openfoam/218892-internal-flow-through-valve-3d.html)

Time4Tea July 8, 2019 11:36

Internal flow through valve (3D)
 
4 Attachment(s)
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

Reading fields:

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?


Thanks in advance :)
https://drive.google.com/open?id=0B4...NjY0gwQ29hZDVj

Tobi July 8, 2019 12:11

Hi,

I just read your error message and can give you the following info:

Code:

yourSolver -postProcess -time 25 -func yPlus

Time4Tea July 8, 2019 12:43

@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.

hxaxtma July 9, 2019 08:32

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

Time4Tea July 10, 2019 09:14

@hxaxtma: thanks for your helpful advice.

Time4Tea July 11, 2019 10:03

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.

misospider August 2, 2019 03:57

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


All times are GMT -4. The time now is 15:49.