|
[Sponsors] |
[swak4Foam] Trouble setting groovyBC interFoam Inlet BC |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 30, 2012, 15:37 |
Trouble setting groovyBC interFoam Inlet BC
|
#1 |
Senior Member
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16 |
Hello,
As indicated in the post title, I am trying to use groovyBC to set the inlet boundary condition for a interFoam simulation. I am using OpenFOAM 2.1.0 running on kubuntu 11.10. The attached picture (colored as p_rgh) shows a 2D view of the problem which is flow in a channel over a spillway. The inlet is on the right, the outlet is on the left, top is atmosphere, bottom is wall, and front and back are symmetry plane. Historically I have split my inlet patch into 2 separate patches, one for air and one for water. I was hoping that I would be able to use groovyBC to accomplish the same thing with one patch so that I can change the inlet water level without changing my mesh. Anyway, the simulation seems to run ok, and the water surface looks ok (although I haven't compared to physical model data yet), but the pressure at the inlet seems to be funky. You can see in the picture that the p_rgh is 0 at the inlet, and p (not shown) has a significant negative pressure at the inlet. This seems incorrect to me. Can anyone provide any insight regarding what is happening? Are my boundary conditions (below) specified incorrectly? p_rgh: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; boundaryField { top { type totalPressure; p0 uniform 0; U U; phi phi; rho rho; psi none; gamma 1; value uniform 0; } bottom { type buoyantPressure; value uniform 0; } inlet { type buoyantPressure; value uniform 0; } outlet { type totalPressure; p0 uniform 0; U U; phi phi; rho rho; psi none; gamma 1; value uniform 0; } walls { type symmetryPlane; } wes { type buoyantPressure; value uniform 0; } } // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object alpha1; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { top { type inletOutlet; inletValue uniform 0; value uniform 0; } bottom { type zeroGradient; } inlet { type groovyBC; valueExpression "1"; fractionExpression "(pos().z<28) ? 1 : 0"; value uniform 1; } outlet { type inletOutlet; inletValue uniform 0; value uniform 0; } walls { type symmetryPlane; } wes { type zeroGradient; } } // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { top { type pressureInletOutletVelocity; value uniform (0 0 0); } bottom { type slip; } inlet { type groovyBC; valueExpression "(pos().z<28) ? vector(1.981,0,0) : vector(0,0,0)"; value uniform (0 0 0); } outlet { type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0); } walls { type symmetryPlane; } wes { type slip; } } // ************************************************************************* // |
|
June 30, 2012, 17:52 |
|
#3 |
Senior Member
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16 |
Hi nimasam,
Thanks for your input. Yes, I have tried with zeroGradient for pressure at inlet. it yields very similar results. The weird thing is that my boundary conditions are the same as another case where I don't see those weird pressure results. Not sure where to go from here... MD And checkMesh says all is good... Last edited by mgdenno; June 30, 2012 at 17:53. Reason: checkMesh comment |
|
July 1, 2012, 05:49 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Last thing: have a look at p and p_rgh directly (with "less" or a text editor) and see what OF has written in "values" (at the end of the day these are the only values that really count). It is my suspicion that there are no values present on the inlet in p_rgh and paraview therefor assumes them to be 0 (as the reader doesn't know about the real physical meaning of the bCs) |
||
July 1, 2012, 09:16 |
|
#5 |
Senior Member
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16 |
Bernhard,
Thanks so much for your suggestion. You are absolutely correct. The values I was seeing were only paraviews interpretation of the data. The real cell values are much more believable. I have to admit, now that you say this, I recall seeing another recent post regarding a different "problem" where you made the same suggestion to another user. At the time I though, "yeah that makes lots of sense", then when it came to my own case I pushed forward with the interpolated values thinking I had a problem (blinders on). Thanks for all the work you do on OF and the time you spend answering questions on the forums, and of couse thanks again for your help on my problem. MD |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
interFoam vs. simpleFoam channel flow comparison | DanM | OpenFOAM Running, Solving & CFD | 12 | January 31, 2020 16:26 |
interFoam (HELYX-OS) pressure boundary conditions | SFr | OpenFOAM Running, Solving & CFD | 8 | June 23, 2016 17:36 |
problem with inlet BC setting | Tanjina | Fluent Multiphase | 4 | July 1, 2013 14:06 |
[swak4Foam] Scale discrete inlet velocity profile with groovyBC | cboss | OpenFOAM Community Contributions | 1 | June 20, 2010 14:02 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 05:41 |