CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

How to get rid of PRefValue

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2022, 08:42
Default How to get rid of PRefValue
  #1
New Member
 
Join Date: Jun 2022
Posts: 7
Rep Power: 4
Yupp is on a distinguished road
Hello foamers.

I try to simulate the thermodynamic phenomena that take place in a closed enclosure heated by the walls using the multiphase solver interCondensatingEvaporatingFoam.

The problem is in 2 dimensions. It is a rectangle in which initially liquid water is contained. The 4 sides of this rectangle are walls.

boundary
Code:
(
    FrontandBack
    {
        type            empty;
        inGroups        1(empty);
        nFaces          30134;
        startFace       29826;
    }
    Left
    {
        type            wall;
        inGroups        1(wall);
        nFaces          247;
        startFace       59960;
    }
    Right
    {
        type            wall;
        inGroups        1(wall);
        nFaces          247;
        startFace       60207;
    }
    Bottom
    {
        type            wall;
        inGroups        1(wall);
        nFaces          61;
        startFace       60454;
    }
    Top
    {
        type            wall;
        inGroups        1(wall);
        nFaces          61;
        startFace       60515;
    }
)
alpha.liquid (Volume fraction of liquid)
Code:
dimensions      [0 0 0 0 0 0 0];

internalField   uniform 1;

boundaryField
{
    Bottom
    {
        type            zeroGradient;
    }

    Top
    {
        type            zeroGradient;    
    }

    Left
    {
        type            zeroGradient;
    }

    Right
    {
        type            zeroGradient;
    }

    FrontandBack
    {
        type            empty;
    }
}
The initial pressure is 1 atm, temperature 20°C. The saturation temperature is given fixed at 100°C to simplify the problem. Turbulence is modelled by a k-wSST model. All the walls are at a temperature of 110°C, so phase change occurs quickly.

All the turbulence fields (epsilon, omega, nut, k) have boundary conditions respecting the wallFunction function (epsilonWallFunction, nutWallFunction etc). p and p_rgh have zeroGradient boundaries. U has noSlip and T, as I said, have a 110 °C fixedValue.



As the simulation progresses, the liquid water close to the walls turns into gas which rises to the top of the tank by gravity. After a while, there is not even any liquid left and the gas continues to heat up to 110°C. But I have a major problem: the pressure inside the enclosed enclosure do not rise which is not possible when considering the conservation of matter at constant volume.

In fact I noticed that the pressure reaches pRefValue whatever the boundaries. I've tried to change the boundaries in many different ways, there is almost no influence on the pressure, which just goes from initial pressure to pRefValue.

According to the source code of interCondensatingEvaporatingFoam, this therefore means that my simulation lacks data allowing it to operate without clinging to the pRefValue. But I can't find what. Does someone have an idea ? I feel like the problem is not even with file 0, nor in transportProperties...

Thank you !
Yupp is offline   Reply With Quote

Old   April 16, 2023, 06:14
Default
  #2
New Member
 
Filippo Azzini
Join Date: Apr 2020
Posts: 10
Rep Power: 6
Filippo_azz is on a distinguished road
Good morning, I’m finding a similar problem with my simulation, did you have solved this problem??
If yes, can you give me more information?

Thank you so much
Filippo_azz is offline   Reply With Quote

Old   April 16, 2023, 15:47
Default
  #3
New Member
 
Join Date: Jun 2022
Posts: 7
Rep Power: 4
Yupp is on a distinguished road
Quote:
Originally Posted by Filippo_azz View Post
Good morning, I’m finding a similar problem with my simulation, did you have solved this problem??
If yes, can you give me more information?

Thank you so much

Hello !

I regret this post a little because it shows that I didn't really know what I was playing with at the time! But that's how we learn.

My system was forced to use Pref because I don't define a boundary condition on the pressure at any time - and it can't be inferred directly with the equation set initially in the solver. I thought that by giving a pressure in initial condition and letting the thermodynamic system work, the pressure would evolve and be an output of the problem. This taught me to always understand what you're playing with. In this case, pressure is an input to the solver, not an output.

Clearly: the solver needs to be given a pressure to make this calculation, and it does not calculate pressure. So if the conditions are insufficient, then Pref is used. The right solution is to define a justified hypothesis about pressure for your problem, allowing you to calculate it, and implement it in the solver.

Hope this helped!
Yupp is offline   Reply With Quote

Old   April 16, 2023, 17:01
Default
  #4
New Member
 
Filippo Azzini
Join Date: Apr 2020
Posts: 10
Rep Power: 6
Filippo_azz is on a distinguished road
Dear Yupp, thank you for your response, I agree with you, every time you use only Neumann BC for the pressure you need to specify the pressure value in one cell using pRefValue. In my simulation, I have a closed system, similar to your problem I think, where phase change occurs.
In my case, the density of the vapor phase is different from the density of the fluid phase, and when the phase change occurs also the pressure will change in the domain, but if I use pRefValue the value of the pressure in that cell will remain constant during the simulation, and as result, I obtain not-physical distribution.
Any idea about how can solve this??

Best.
Filippo_azz is offline   Reply With Quote

Old   April 17, 2023, 04:41
Default
  #5
New Member
 
Join Date: Jun 2022
Posts: 7
Rep Power: 4
Yupp is on a distinguished road
Quote:
Originally Posted by Filippo_azz View Post
Dear Yupp, thank you for your response, I agree with you, every time you use only Neumann BC for the pressure you need to specify the pressure value in one cell using pRefValue. In my simulation, I have a closed system, similar to your problem I think, where phase change occurs.
In my case, the density of the vapor phase is different from the density of the fluid phase, and when the phase change occurs also the pressure will change in the domain, but if I use pRefValue the value of the pressure in that cell will remain constant during the simulation, and as result, I obtain not-physical distribution.
Any idea about how can solve this??

Best.

Hey


As I said, you need to give a pressure as an input in your problem. And to do so, you need to add an equation to your solver, so that your solver knows what pressure to use. For exemple, if :
- VOF method is used in the solver
- Gas can be considered as ideal (or another equation of state) in the whole simulation
- Liquid can be considered as incompressible in the whole simulation
- The system is enclosed, meaning there is material quantity conservation is the domain

Then I think you can consider an equation calculating pressure based on the temperature, volume and density of your cells (you need to find). When you find this equation, incorporate it in your solver. Your pressure will become an output of the problem, and pressure will be computed. It will stop using Pref


Hope it helps !
Yupp is offline   Reply With Quote

Reply

Tags
multiphase, phase_change, prefvalue, pressure


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get rid of plus symbol? Rajkool Mesh Generation & Pre-Processing 2 January 27, 2020 09:15
[Commercial meshers] How to get rid of internal walls (surfaces)? bmikuz OpenFOAM Meshing & Mesh Conversion 17 December 5, 2013 16:24
The meaning and use of pRefCell and pRefValue jf115009 OpenFOAM Programming & Development 1 September 25, 2013 10:58
getting rid of pyramids from Wake region Prakash.Paudel ANSYS Meshing & Geometry 0 August 29, 2011 22:55
how to get rid of shadow wall ssn FLUENT 2 January 3, 2008 13:00


All times are GMT -4. The time now is 10:51.