|
[Sponsors] |
Correct boundary conditions for p_rgh (special for vertical patches) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 20, 2018, 15:41 |
Correct boundary conditions for p_rgh (special for vertical patches)
|
#1 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi all,
as I made already a lot of tests regarding the correct boundary condition for the p_rgh field that is used in density based solvers, I want to know your experience and set-up of common problems. Let us consider the following example, cf. figure below (10 s). The conditions are as follows:
The boundary condition includes the height difference and density (temperature depended). The field is a default field with the value of 0. However, changing the field can be done by adding the hRef file into the constant/ folder. Code:
Info<< "\nReading hRef" << endl; uniformDimensionedScalarField hRef ( IOobject ( "hRef", runTime.constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE ), dimensionedScalar("hRef", dimLength, 0) ); The problem starts after activating the gravity because the p_rgh field is not identical to p anymore (before g was zero, thus the second term on the RHS of the equation was zero too). What happens:
As far as I know, there are a lot of people out doing heat transfer and similar problems, this problem should be a common one. Therefore, I am interested in your set-up. If someone wants to test the case, you can download it here: https://Holzmann-cfd.de/forums/buoyancyCase.tar.gz Applying two different boundary conditions for the outlet seems to work better. E.g., upper outlet fixedFluxPressure and lower outlet fixedValue. However, this should not be physical based on the missing information regarding . Thanks for taking your time.
__________________
Keep foaming, Tobias Holzmann Last edited by Tobi; October 20, 2018 at 19:30. Reason: Missing brackets inside the equation |
|
October 21, 2018, 19:24 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
I've faced similar boundary condition problems before, related to simulation of buoyant jets in 2 and 3d. Although these problems are not as confined as the one you describe, getting fluid to exit the domain as it should is still a matter of concern. Through many iterations of various conditions and openfoam versions, we've found a few things. Using the pressureInletOutletVelocity condition instead of the regular inletOutlet condition for velocity usually helps. That said, I tried it and still saw the backflow problem. Another nice tool is using a hydrostatic total pressure boundary condition for p_rgh. These boundary condition choices are most closely tied to the latest additions to fireFoam -- especially the hydrostatic total pressure. A hydrostatic background is precomputed and used in conjunction with the p_rgh bc to set the total pressure at the outlet. So, I converted your case to a fireFoam case and ran it successfully removing the backflow at the outlet. The case is attached. There are a few minor changes from your case : thermo is now hePsiThermo, the working fluid is (inert) N2. A link to the case is here : https://www.dropbox.com/s/0kg8tqj2b0..._C.tar.gz?dl=0. Let me know if it doesn't work. Thoughts?
Caelan |
|
November 6, 2018, 05:07 |
|
#3 |
New Member
Salar Tavakkol
Join Date: Jun 2018
Posts: 1
Rep Power: 0 |
Hi Tobias and Caelan
I have the same problem regarding unphysical gas velocity at outlet patch specially occurring when the gravity is along (parallel to) the patch and not perpendicular). here are some of the conditions:
I have tried to minimize the effect by trying different outlet pressure and velocity boundary conditions (B.C.s). best one (the image is taken from) has pressureInletOutletVelocity for outlet velocity and outletInlet for outlet pressure B.C. but the effect is still there and visible. At least the simulation is stable and runs without divergence. The same problem in DPM/MPPIC solvers (incompressible) with the same geometry exists but there the options for choosing the B.C. are limited so I could not manage to have a stable simulation at all (it starts diverging from the very beginning and crashes eventually), until I turn off the gravity for the gas phase. |
|
November 6, 2018, 11:36 |
|
#4 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
Fair warning -- I've never used those solvers. However, your outlet boundary conditions are immediately suspect. pressureInletOutletVelocity is generally fine for velocity. For pressure, you'll probably get better results with something else. I've previously mentioned success with prghTotalHydrostaticPressure. Additionally, I've recently had success with a waveTransmissive condition for pressure at the outlet (horzontal and vertcial patches).
Caelan |
|
October 3, 2019, 11:58 |
p and p_rgh for high pressure, high temperature cases with flow and heat transfer
|
#5 |
New Member
Join Date: Sep 2019
Posts: 5
Rep Power: 7 |
Hi,
I know this is an old thread. But, could anyone suggest me the possible boundary conditions for p and p_rgh that one can use when there is flow and heat transfer in a high pressure (~10bar) environment? I am currently trying to simulate the heat transfer in a cold circular cylinder (~300K) in a very hot flow (~1500K). I am using buoyantSimpleFoam as I am only looking at a steady case. But my simulation crashes with the following error (please see below). Code:
Time = 5 DILUPBiCGStab: Solving for h, Initial residual = 0.999811, Final residual = 0.00895307, No Iterations 94 #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::GAMGSolver::scale(Foam::Field<double>&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const at ??:? #4 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const at ??:? #5 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:? #6 Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:? #7 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/buoyantSimpleFoam" #8 Foam::fvMatrix<double>::solve() in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/buoyantSimpleFoam" #9 ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/buoyantSimpleFoam" #10 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #11 ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/buoyantSimpleFoam" Floating point exception (core dumped) I am very new to OpenFOAM and any suggestions are deeply appreciated. If anyone is interested, I can post my codes here. Thanks |
|
October 6, 2019, 09:40 |
|
#6 |
Member
Kirk Jarvis
Join Date: Mar 2009
Posts: 31
Rep Power: 17 |
I ran Tobias' case and reduced the size (in half) of the outlets with gravity on and fixedValue for p_rgh work fine along with calculated for p and pressureInletOutletVelocity for U. Tobias' case with gravity on the volume leaving the lower outlet is so high that the inlet flow was not high enough to keep the pressure up in the domain so it has to have inflow to satisfy the pressure condition on the top outlet. What are you using for your transportProperties?
I have attached the v1806 case similar to Tobias with smaller outlets. |
|
October 6, 2019, 10:13 |
|
#7 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
reducing the area of the outlets may help but if your physical domain does not allow to reduce the outlet in that case, what would you do? Okay, we could extend the geometry while reducing the extension but if this is always physical correct? Hmmm...
__________________
Keep foaming, Tobias Holzmann |
|
October 7, 2019, 00:05 |
|
#8 |
Member
Kirk Jarvis
Join Date: Mar 2009
Posts: 31
Rep Power: 17 |
Tobi,
You make a good point. I looked at it again with the outlets and inlets the same size and slowed the velocity to 0.1 m/s and the back flow in the upper outlet was much smaller and only lasted a couple early time steps, using following bc for the outlets: p_rgh - FixedValue p - calculated U - pressureInletOutletVelocity other changes from your case: in thermalphysicalProperities dpdt off; in fvSolution in PIMPLE added: pRefCell 1810; top cell of the outletBottom bc pRefValue 1e5; I can share the case if you would like to take a look. Thanks, Kirk |
|
November 26, 2019, 22:16 |
Backflow
|
#9 |
Senior Member
Join Date: Jul 2019
Posts: 148
Rep Power: 7 |
Hi,
I am working with twoLiquidMixingFoam solver and I am facing a problem of back flow at the outlets. I have a single inlet and two outlets. I am setting the outlets to Prgh to zero (i.e. reference pressure value) and using the pressureInletOutletVelocity for velocity. I have tried also to use totalPressure = 0 instead of Prgh = 0 and it did not work. I have also used the inletOutlet for the outlet velocity but with no success. I would appreciate your assistance. Please let me know if further information is needed. Thanks |
|
June 13, 2020, 10:14 |
|
#10 | |
Member
Himanshu
Join Date: Jan 2017
Posts: 34
Rep Power: 9 |
Quote:
The code you mentioned to change the h_ref. Do we have to paste the exact same code with changed H-ref value in trasportProperties file or do we have to change it in createFilelds.H file? |
||
June 13, 2020, 10:43 |
hRef file
|
#11 |
New Member
Jagan Mohan
Join Date: Dec 2019
Location: New York
Posts: 27
Rep Power: 7 |
You have to create a file with the name hRef in the constant folder and also add the reading module given by Tobi to createFields.H of the solver you are using. Inside hRef file, contents should be like.
FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object hRef; } hRef hRef [0 1 0 0 0 0 0] (Whatever value you want to impose); Could you try and see? Post the error message if it fails. Thank you, Jagan Mohan. |
|
June 13, 2020, 10:55 |
|
#12 |
Member
Himanshu
Join Date: Jan 2017
Posts: 34
Rep Power: 9 |
Thank You for the quick reply.
I will try and let you know. |
|
August 7, 2020, 23:55 |
prghPressure
|
#13 |
New Member
wangwenjun
Join Date: Oct 2019
Posts: 1
Rep Power: 0 |
Hello, I'm new to OpenFOAM and I met the same problem as you.I‘m using the interFoam solver to model a phenomenon of gas jet in liquid cross-flow. The outlet boundary condition is prghPressure. The problem is that the pressure on the surface of outlet gradually decreases along the direction of gravity and it is not correct. Do you know how to solve it ? thank you very much!
|
|
April 2, 2021, 13:06 |
problems with pressure
|
#14 |
New Member
David
Join Date: Jan 2021
Posts: 13
Rep Power: 5 |
Hi there,
I am stuck with my pressure BC. The flow at the outlet increases, because of this pressure difference. I am dealing with multiphase flow and density differences and have modelled a flume with an in- and outlet. boundaries U: inlet: fixedValue (0.1 0 0) outlet zeroGradient boundaries p : what should I use? |
|
April 2, 2021, 15:45 |
|
#15 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
p Inlet -> totalPressure
p Outlet -> fixedValue (or meanFixed or fixedMean - dont know how it is called right now). However, for multiphase you might use prghTotalPressure or anything related to the hydrostatic part.
__________________
Keep foaming, Tobias Holzmann |
|
April 3, 2021, 11:02 |
|
#16 |
New Member
David
Join Date: Jan 2021
Posts: 13
Rep Power: 5 |
Thank you for the very quick reply. I have tried this and when I use this I get a fatal error. The file you send in the original post does not work anymore.
I tried adding a hRef file to the constant folder, but it does not seem to find it. I have a p_rgh pressure file. This is the error I receive: --> FOAM FATAL ERROR: request for uniformDimensionedScalarField hRef from objectRegistry region0 failed available objects of type uniformDimensionedScalarField are 1(cumulativeContErr) From const Type& Foam:bjectRegistry::lookupObject(const Foam::word&, bool) const [with Type = Foam::UniformDimensionedField<double>] in file /home/pawan/OpenFOAM/OpenFOAM-v2006/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 463. FOAM aborting |
|
April 6, 2021, 08:10 |
|
#17 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Check out the *header* of your hRef file. It should look like that
Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class uniformDimensionedScalarField; location "constant"; object hRef; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 0 0 0 0 0]; value 0.244; // ************************************************************************* //
__________________
Keep foaming, Tobias Holzmann |
|
June 18, 2021, 06:12 |
|
#18 | |
New Member
pierre
Join Date: May 2021
Posts: 4
Rep Power: 5 |
Quote:
For compression by air-liquid injection at 3 bar without outlet into air at 0.64 bar. What do you suggest for the boundary conditions of: - P_inlet - P_wall - U_inlet - U_wall - P_rgh_inlet - P_rgh_walls Thanking you, Pierre |
||
October 14, 2023, 09:54 |
|
#19 |
New Member
Join Date: Sep 2021
Posts: 3
Rep Power: 5 |
Hello everyone,
This thread is old but my domain seems like the model of Tobi's. In my domain, at the bottom, the flow is from left to right while at the top, the flow is from right to left. Can you help me about boundary conditions especially for pressure boundary condition? The details of the model is explained in this thread: Correct boundary conditions for two inlets and two outlets I will be grateful if you help me. Thanks a lot. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation in semi-transparent media with surface-to-surface model? | mpeppels | CFX | 11 | August 22, 2019 08:30 |
Multiphase flow - incorrect velocity on inlet | Mike_Tom | CFX | 6 | September 29, 2016 02:27 |
Implementation of boundary conditions for FVM | Tom | Main CFD Forum | 7 | August 26, 2014 06:58 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |