|
[Sponsors] |
pisoFoam, fully developed pipe flow using cyclic BC's |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 29, 2018, 08:44 |
pisoFoam, fully developed pipe flow using cyclic BC's
|
#1 |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
Dear Foamers,
I would like to study the influence fully developed flow in tubes with a helix structure. I am particulary interested in the influence of the structure on the pressure drop. My Re=5300 and I am using kOmegaSST as a turbulence model. I started three months ago using simpleFoam, cyclicAMI boundary conditions and fvOptions to specify the mass flow. I did not get good mesh independent solution for my tube with a helix structure so I went back to a simple tube using a structured mesh. But instead of using simpleFoam I decided to use pisoFoam and solve in time. Again I wanted to using periodic boundary conditions to reduce my spatial domain. I noticed that both cyclic and cyclicAMI boundary conditions gave me severe osciliations for the pressure term. To overcome this problem I tried to using the mappedPatch boundary condition, mapping my outlet at z=0.01 to my inlet at z=0. So far I succesfully modelled hagen poiseuille flow, but now I turned on the turbulence and I do not know how to set the boundary conditions for k, omega and nut: BC's I use for velocity U and pressure, which I know they are correct while they show the correct Hagen-poiseuille velocity profile: HTML Code:
FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 1); boundaryField { INLET { type mapped; value uniform (0 0 1); interpolationScheme cell; setAverage true; average (0 0 1); } WALL { type fixedValue; value uniform (0 0 0); } OUTLET { type zeroGradient; } } HTML Code:
FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { INLET { type zeroGradient; } WALL { type zeroGradient; } OUTLET { type fixedValue; value uniform 0; } } HTML Code:
FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0.0045; boundaryField { INLET { type mapped; value uniform 0.0045; interpolationScheme cell; setAverage false; average 0.0045; } OUTLET { type zeroGradient; } WALL { type fixedValue; value uniform 0; } } HTML Code:
FoamFile { version 2.0; format ascii; class volScalarField; object omega; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 -1 0 0 0 0]; internalField uniform 333.2391; boundaryField { OUTLET { type zeroGradient; // inletValue $internalField; //value $internalField; } WALL { type fixedValue; value uniform 1.3441e+7; } INLET { type mapped; value uniform 333.2391; interpolationScheme cell; setAverage false; average 333.2391; // value $internalField; } } HTML Code:
FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { INLET { type zeroGradient; } OUTLET { type zeroGradient; } WALL { type fixedValue; value uniform 0; } } I just basically do not know how to correctly set k, omega and nut. I only want to map the outlet conditions to my inlet. For velocity I specify an average bulk velocity of 1m/s. Kind regards, Thijs |
|
January 29, 2018, 11:20 |
|
#2 |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
or should I use directMappedPatch instead of mapped?
|
|
January 29, 2018, 11:37 |
|
#3 |
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10 |
||
January 29, 2018, 11:41 |
|
#4 | |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
Quote:
What I mean with coordinate z is the offset I would like to map to my inlet. I use openFOAM 5.0 on bash ubuntu on windows. My inlet plane is located at z = 0 and my outlet plane is located at z= 0.01 HTML Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 3 ( INLET { type mappedPatch; offset (0 0 0.01); sampleRegion region0; sampleMode nearestCell; samplePatch none; nFaces 1805; startFace 535895; //neighbourPatch OUTLET; //transform translational; //separationVector (0 0 0.01); } WALL { type wall; inGroups 1(wall); nFaces 7600; startFace 537700; } OUTLET { type patch; nFaces 1805; startFace 545300; //neighbourPatch INLET; //transform translational; //separationVector (0 0 -0.01); } ) |
||
January 29, 2018, 11:49 |
|
#5 |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
I also found this old thread: simpleFoam + cyclic pipe = unstable?
But the proposed boundary conditions for 0/k 0/omega and 0/nut do not seem to work. As I understand I start with an initial length of pipe. Then in the next time iteration the outlet is mapped to the inlet. For laminar the setup with 0/U and 0/p work while I find the hagen poiseuille velocity profile. My understanding is that in the next time iteration the k, omega and nut values should be mapped to my inlet, but how do I specify a value at the outlet I do not know how it will evolve? |
|
January 29, 2018, 13:50 |
|
#6 |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
||
January 30, 2018, 00:51 |
|
#7 |
New Member
Yuncheng Xu (Cloud)
Join Date: May 2011
Location: State College, PA
Posts: 20
Rep Power: 15 |
Here are some problems on your BCs
Hope it can help you |
|
January 30, 2018, 04:36 |
|
#8 | |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
Quote:
For my nut value at the wall, I used this formula by Menter: "Standard" Menter SST Two-Equation Model (SST) https://turbmodels.larc.nasa.gov/sst.html Omega_wall = 10 *( (6 *nu)/(B1 *yplus^2)) my viscosity nu = 1.0034e-06 m^2/s B1 is a model constant = 0.075 I created a boundary layer with a y+ =~ 1 so my first cell height is 7,36e-06meter |
||
January 30, 2018, 04:43 |
|
#9 | |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
Quote:
[IMG]<a href="https://ibb.co/b1hoW6"><img src="https://preview.ibb.co/iTEfdm/piso_no_conv.jpg" alt="piso_no_conv" border="0"></a>[/IMG] For my nut value at the wall, I used this formula by Menter: Omega_wall = 10 *( (6 *nu)/(B1 *yplus^2)) my viscosity nu = 1.0034e-06 m^2/s B1 is a model constant = 0.075 I created a boundary layer with a y+ =~ 1 so my first cell height is 7,36e-06meter |
||
January 30, 2018, 08:15 |
|
#10 | |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
Quote:
Apparently the laminar case converge to the right solution even with the fluctuations in the pressure residual. The calculated dp/dx source term slowly converges to the analytic solution. The required analytic value for my case is: 0.2286 and I found 0.231091 after 1.024 seconds, but I suspect it will converge better to the analytic value with a finer mesh or a longer runtime, so that is what I will try now. |
||
February 5, 2018, 09:28 |
|
#11 |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
pisoFoam for the laminar case converges to the correct pressure gradient for a pipe of Ø5,3mm using cyclic bc's. However when I turn on RANS kOmegaSST I get a velocity profile which has the correct shape, but maybe the wrong max. velocity, and I do not get a correct pressure gradient. I can calculated the pressure gradient with the moody diagram and the correct is: dp/dx=3.5 If I read the moody-diagram for a Re=5282 the friction coefficient Fd should be approx. 0.037. This is also the friction coefficient is used in my calculation of the first layer height, using the blasius fanning coefficient : f= 0.0791/(Re^0.25) and Fd = 4*f
My dp/dx is 4.37 which differs too much. So I expect my boundary conditions for the turbulence are not correct. I use a lowRe with a y+ = 1. k HTML Code:
FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0.0045; boundaryField { INLET { type cyclicAMI; } OUTLET { type cyclicAMI; } WALL { type fixedValue; value uniform 0; } } HTML Code:
FoamFile { version 2.0; format ascii; class volScalarField; object omega; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 -1 0 0 0 0]; internalField uniform 333.2391; boundaryField { INLET { type cyclicAMI; } WALL { type fixedValue; value uniform 1.3441e+7; } OUTLET { type cyclicAMI; } } HTML Code:
FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { INLET { type cyclicAMI; } OUTLET { type cyclicAMI; } WALL { type fixedValue; value uniform 0; } } HTML Code:
FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { INLET { type cyclicAMI; } WALL { type zeroGradient; } OUTLET { type cyclicAMI; } } HTML Code:
FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 1); boundaryField { INLET { type cyclicAMI; } WALL { type fixedValue; value uniform (0 0 0); } OUTLET { type cyclicAMI; } I also tried using a lowRe wallfunction for nut --> nutLowReWallFunction but I did not give a better result. The dp/dx remained 4.37 The pressure gradient according to moody can be calculated as: delta P = Fd*{(rho*Vavg^2*L)/(2*D)} such that the pressure gradient is calculated as: deltaP/(rho*L) =dp/dx= (Fd *Vavg^2 )/ (2*D) Does someone has a better suggestion? I found this validation case online: https://www.simscale.com/docs/conten...tPipeFlow.html but could not figure out how they set the boundary condition for nut |
|
February 5, 2018, 10:22 |
|
#12 |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
Could aspect ratio be the problem. I have a y+ = 1 so my first cell layer height is 7,36e-6meter. My spacing in axial direction (z-direction) is 1e-4. But then again why I do checkMesh, openFoam tells everything is OK!
HTML Code:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 5.x-197d9d3bf20a Exec : checkMesh Date : Feb 05 2018 Time : 15:22:03 Host : "LAPTOP-38GBMABK" PID : 5239 I/O : uncollated Case : /mnt/c/Users/thijs/Documents/openFoam_cases/restart/struct_piso/turb/tsu6_res/piso_struct_lvl_1_cyclicAMI nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create polyMesh for time = 0 Time = 0 Mesh stats points: 186244 faces: 547105 internal faces: 535895 cells: 180500 faces per cell: 6 boundary patches: 3 point zones: 0 face zones: 0 cell zones: 0 Overall number of cells of each type: hexahedra: 180500 prisms: 0 wedges: 0 pyramids: 0 tet wedges: 0 tetrahedra: 0 polyhedra: 0 Checking topology... Boundary definition OK. Cell to face addressing OK. Point usage OK. Upper triangular ordering OK. Face vertices OK. Number of regions: 1 (OK). Checking patch topology for multiply connected surfaces... Patch Faces Points Surface topology INLET 1805 1844 ok (non-closed singly connected) WALL 7600 7676 ok (non-closed singly connected) OUTLET 1805 1844 ok (non-closed singly connected) Checking geometry... Overall domain bounding box (-0.00265 -0.00265 0.01) (0.00265 0.00265001 0.02) Mesh has 3 geometric (non-empty/wedge) directions (1 1 1) Mesh has 3 solution (non-empty) directions (1 1 1) Boundary openness (1.45266e-17 -4.96472e-17 2.58155e-16) OK. Max cell openness = 7.75827e-16 OK. Max aspect ratio = 15.3833 OK. Minimum face area = 6.50758e-10. Maximum face area = 3.38236e-08. Face area magnitudes OK. Min volume = 1.41389e-13. Max volume = 3.38236e-12. Total volume = 2.20368e-07. Cell volumes OK. Mesh non-orthogonality Max: 7.36316 average: 2.0249 Non-orthogonality check OK. Face pyramids OK. Max skewness = 0.358788 OK. Coupled point location match (average 0) OK. Mesh OK. End |
|
February 5, 2018, 13:04 |
|
#13 |
New Member
Yuncheng Xu (Cloud)
Join Date: May 2011
Location: State College, PA
Posts: 20
Rep Power: 15 |
Just a few suggestions. You need to use wall functions for k and omega too. They do matter. Don’t need to use lowRe for nut. Try spalding or normal wall function for nut. Y+ should be fine, but it will be better to put it in log law sublayer.
|
|
February 6, 2018, 09:38 |
|
#14 | |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
Quote:
k: type kqRWallFunction; value uniform 1e-12; omega: type omegaWallFunction; value uniform 100; nut: type nutkWallFunction; value uniform 0; and my calculate dp/dx term by openFoam reduced to: 3.62 , which is way more close to the analytic solution of 3.5 from the moody diagram. However I observe the following problem for my velocity profile. I do not see noSlip condition at the wall. It says approx. 0,6m/s Is this the consequence of using wallfunctions or am I doing something wrong? Kind regards, Thijs |
||
February 6, 2018, 11:18 |
|
#15 |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
The velocity profile I obtaine :S
|
|
February 6, 2018, 14:36 |
|
#16 |
New Member
Yuncheng Xu (Cloud)
Join Date: May 2011
Location: State College, PA
Posts: 20
Rep Power: 15 |
Hi Thijs, I am not sure what caused the ‘no-slip’, but you may check the U value at wall boundary in the latest time directory. See if it is uniform fixed value of (0 0 0). In my experience and based on the codes, these wall functions won’t change velocity on the boundaries. It may be caused by interpolation issue in visualization. Why not try paraview to visualize? |
|
February 13, 2018, 04:13 |
|
#17 |
New Member
Thijs
Join Date: Nov 2017
Posts: 29
Rep Power: 9 |
I have a question regarding grid refinement and the y+ value. Currently I am using a y+ =~ 1 and during grid refinement of h=sqrt(2) in all direction I am also refining y+ such that I get a smaller y+=~0.707 .
But is this the correct procedure in order to study mesh independence. While I observe that my dp/dx term grows with smaller y+ value. And when I was taking my y+ value constant during refinement (y+ =~1) I observed better mesh independence. Kind regards, Thijs |
|
February 21, 2018, 23:07 |
|
#18 | |
New Member
Yuncheng Xu (Cloud)
Join Date: May 2011
Location: State College, PA
Posts: 20
Rep Power: 15 |
Quote:
Basically, pressure gradient is due to wall shear stress, which is very sensitive to the first grid height or y+. So your observation makes sense to me. If you do care about pressure gradient, y+ shall be a very important variable in the grid dependence analysis. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
fully developed region in pipe | akbar.mech | FLUENT | 2 | August 30, 2016 04:08 |
3D pipe flow - Using UDF's to define fully developed turbulent flow on the inlet | Taz-CFD | CFD Freelancers | 1 | February 21, 2016 12:12 |
UDF for 3D turbulent fully developed flow | howhs | Fluent UDF and Scheme Programming | 0 | August 1, 2013 12:47 |
Fully Developed Flow at an Inlet | Ed Mueller | CFX | 5 | January 13, 2009 12:50 |
2D representation of pipe for fully developed flow | Nathan | FLUENT | 3 | November 22, 2008 11:01 |