|
[Sponsors] |
how to set up Hydrostatic pressure distribution in interFoam? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 12, 2017, 10:01 |
|
#21 |
Member
|
Hi there Max,
seems to me that you may have solved a problem around specifying outlet phase (water) levels that I have been wrestling with for months (and months). Is there any chance you could provide a copy of the modified .H & .C files (and any other modified files) plus some detail about the new BC that you have created and a generic copy respective controlDict files for implementation? Any assistance / guidance on this would be greatly appreciated and would end months of turmoil. (For information I am using OpenFOAM 4.1 and foam-extend-4.0) All the best - JFM |
|
May 15, 2017, 04:53 |
|
#22 |
New Member
Max
Join Date: May 2011
Location: Nuremberg
Posts: 17
Rep Power: 15 |
Hey,
I named the bc "totalPressureFreeSurfaceP_rgh" since it is only useful for calculations with p_rgh as bc. Save the unziped directory in your OpenFOAM directory ("user-OFversion"). Change directory to totalPressureFreeSurfaceP_rgh and run <wmake libso> command. There should be a totalPressureFreeSurfaceP_rgh.dep file now. In controlDict add "libiwwnBCs.so" at libs (...); and thats it. In the header of the .H file you will find an example how to use the bc in your 0/p_rgh file. I am not sure if it works with OF 4.1. Max totalPressureFreeSurfaceP_rgh.zip |
|
August 24, 2018, 04:28 |
use hRef
|
#23 |
New Member
Kate Bradbrook
Join Date: Nov 2015
Posts: 12
Rep Power: 11 |
Hi. To set free surface elevation at outlet in interfoam, I simply create file hRef in Constant directory and set value to my free-surface elevation at outlet. BC for pgrh is then fixedValue of 0. All other variables zeroGradient at outlet. This avoids having to translate mesh.
hRef: /*--------------------------------*- 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 17.87; // ************************************************** *********************** // |
|
January 31, 2020, 16:36 |
|
#24 |
Senior Member
Join Date: Jul 2019
Posts: 148
Rep Power: 7 |
Hi,
I am simulating 2D vertical channel flow (flow between two plates). Fluid 1 is initially filling the channel and Fluid 2 is injected to the domain from below. I am getting some troubles at the outlet; the fluids exist just from some portion of the outlet (not the whole patch). The boundary conditions I use at the outlet are: U -> pressureInletOutletVelocity P_rgh -> totalPressure with p0 = 0 phase -> inletOutlet I would be grateful for any advice. Please let me know if further information is required. Thanks. |
|
January 19, 2024, 11:07 |
|
#25 |
New Member
Joana
Join Date: Jul 2021
Posts: 2
Rep Power: 0 |
Hello!
I am modeling a rectangular open channel (from an experimental study) with OpenFOAM v11, which uses incompressibleVOF solver instead of interFoam. I started from the tutorial waterChannel and I changed the geometry and the b.c. The ideia is to give the inflow discharge (0.219 m3/s) and fix the water level at the outlet. The horizontal smooth channel has 41 m long, 2 m wide, and 1 m high. The water level downstream is 0.3 m. I tried to follow the ideas mentioned in this thread. I created two patches: the lower one for water, and the upper one for air. For alpha.water I used the same b.c. in the inlet and the outlet: fixedValue 1 in the lower patch, and 0 in the upper patch. For p_rgh, I used fixedFluxPressure in the inlet and, fixedValue in the outlet - for the patch with air I defined 0, for the patch with water I defined 2943 = rho*g*h = 1000*9.81*0.3. The bottom of the channel corresponds to z=0m. For U, I used inletOutlet at both outlet patches. Code:
alpha inletWater { type fixedValue; value uniform 1; } inletAir { type fixedValue; value uniform 0; } outletWater { type fixedValue; value uniform 1; } outletAir { type fixedValue; value uniform 0; } p_rgh inletWater { type fixedFluxPressure; value uniform 0; } inletAir { type fixedFluxPressure; value uniform 0; } outletWater { type fixedValue; value uniform 2943; } outletAir { type fixedValue; value uniform 0; } U inletWater { type flowRateInletVelocity; volumetricFlowRate constant 0.219; } inletAir { type fixedValue; value uniform (0.0 0 0); } outletWater { type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0); } outletAir { type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0); } So, I also tried, unsuccessfully, to use zeroGradient in alpha.water and p_rgh in the patch for air in the outlet. I also tried, again unsuccessfully, to set at the outlet p_rgh as a fixedValue of 0 in both patches, maintaining alpha.water 1 for water and 0 for air, and translating the mesh, such that z=0 coincided with the free surface. The simulations eventually stop, with high values of Co nº and fluxes and alpha negative! Does anyone see a problem with what I did? Or does anyone have used another way to fix the water level at the outlet? I'm sorry for the long text! Thank you very much in advance for any assistance. |
|
May 6, 2024, 22:10 |
not working for me
|
#26 | |
New Member
Steven Pells
Join Date: Apr 2024
Posts: 6
Rep Power: 2 |
Quote:
its a while since this post, Im using v2312, using interFoam, I followed the above, but running setFields doesnt populate the 0/p_rgh file - it only gets populated when I run (or try to run) the simulation. And then the p_rgh file gets populated with cell values, but it doesnt honour the 'calculated' bc. Not sure if this is because OF has changed since then ? |
||
May 7, 2024, 00:28 |
|
#27 | |
New Member
Steven Pells
Join Date: Apr 2024
Posts: 6
Rep Power: 2 |
Quote:
this works for me, but how would you set a different hRef if you also wanted to define a constant water level at the inflow boundary? |
||
May 7, 2024, 01:39 |
|
#28 | |
New Member
Steven Pells
Join Date: Apr 2024
Posts: 6
Rep Power: 2 |
Quote:
Ok so if I do: outlet { type calculated; value uniform 0; } then I can follow the method and fix the boundary after setFields. However, Im finding the solution pretty unstable. |
||
May 7, 2024, 03:43 |
|
#29 | |
New Member
Steven Pells
Join Date: Apr 2024
Posts: 6
Rep Power: 2 |
Quote:
I know its been a long time, but this bc fails wmake because writeEntryIfDifferent doesnt seem to get recognised anymore. so this section doesnt work: void Foam::totalPressureFreeSurfaceP_rghFvPatchScalarFi eld::write(Ostream& os) const { fvPatchScalarField::write(os); writeEntryIfDifferent<word>(os, "U", "U", UName_); writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; zFS_.writeEntry("zFS", os); p0_.writeEntry("p0", os); } is there a work around? Im kinda new to OF, surprised its so difficult to write a successful constant head boundary!! |
||
October 2, 2024, 17:26 |
|
#30 |
New Member
John Philip
Join Date: Mar 2024
Posts: 8
Rep Power: 2 |
did you get answer
|
|
October 2, 2024, 18:07 |
|
#31 |
New Member
Steven Pells
Join Date: Apr 2024
Posts: 6
Rep Power: 2 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pressure Outlet Guage pressure | Mohsin | FLUENT | 36 | April 29, 2016 18:16 |
Bad pressure distribution in pump | oringo | FLUENT | 2 | March 2, 2013 11:38 |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 03:15 |
hydrostatic and static pressure | pi | CFX | 3 | May 26, 2004 11:35 |
Definition of pressure | Ola Nordblom | FLUENT | 1 | August 16, 2001 16:58 |