CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

How to define Vacuum Conditions in OpenFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 13, 2019, 06:21
Default
  #21
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Okay so to clarify. You have a closed domain, so you must define a pressure somewhere. This is what you are doing in the fvSolution file. for the cell with id 0, you define a pressure with 2.5 pascal.
In the p_rgh file what you are setting in your case are only initial values. Also for p. Since you set the pressure to 2.5 pascal in that cell in your domain, you can assume that the pressure will be ~2.5 pascal in the whole domain. That's why it is suggested (not a must, but strongly suggested) to initialize p_rgh and p with that 2.5 pascal to help the convergence of the solver.
simrego is offline   Reply With Quote

Old   August 13, 2019, 06:25
Default
  #22
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Quote:
Originally Posted by Raza Javed View Post
I have checked about the Pr value for small pressure, but couldn't find it. and Pr is also not directly dependent on pressure,

Is there anyway to find Pr for different pressures?

Pr is not directly, but it is calculated from the conductivity, viscosity, and specific heat. And they can depend. I'm not 100% if the Pr of air in that really small pressure is the same than on atmospheric pressure. You have to check it before you get unreal results because of that really simple mistake (wrong material props).
simrego is offline   Reply With Quote

Old   August 13, 2019, 06:29
Default
  #23
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Quote:
Originally Posted by simrego View Post
Okay so to clarify. You have a closed domain, so you must define a pressure somewhere. This is what you are doing in the fvSolution file. for the cell with id 0, you define a pressure with 2.5 pascal.
In the p_rgh file what you are setting in your case are only initial values. Also for p. Since you set the pressure to 2.5 pascal in that cell in your domain, you can assume that the pressure will be ~2.5 pascal in the whole domain. That's why it is suggested (not a must, but strongly suggested) to initialize p_rgh and p with that 2.5 pascal to help the convergence of the solver.



If I understood right, this is what I did:


fvSolutions:



Code:
solvers
{
    rho
    {
        solver          PCG
        preconditioner  DIC;
        tolerance       1e-7;
        relTol          0;
    }

    p_rgh
    {
        solver           GAMG;
        tolerance        1e-7;
        relTol           0.01;

        smoother         GaussSeidel;

        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator     faceAreaPair;
        mergeLevels      1;

        maxIter          10;
    }

    "(U|h|k|epsilon)"
    {
        solver           PBiCG;
        preconditioner   DILU;
        tolerance        1e-7;
        relTol           0.1;
    }
}

SIMPLE
{
    momentumPredictor on;
    nNonOrthogonalCorrectors 2;
    pRefCell        0;
    pRefValue       2.5;
    //rhoMin          rhoMin [1 -3 0 0 0] 700;
    //rhoMax          rhoMax [1 -3 0 0 0] 1200;
}

relaxationFactors
{
    fields
    {
        rho             1;
        p_rgh           0.7;
    }
    equations
    {
        U               0.7;
        h               0.7;
        nuTilda         0.7;
        k               0.7;
        epsilon         0.7;
        omega           0.7;
        "ILambda.*"     0.7;
    }
}

// ************************************************************************* //

and


changeDictionaryDict:


Code:
p_rgh
{
    internalField   uniform 2.5;

    boundaryField
    {

        defaultFaces
        {
            type            fixedFluxPressure;
            value           uniform 2.5;
        }

        ".*"
        {
            type            fixedFluxPressure;
            value           uniform 2.5;
        }
    }
}

p
{
    internalField   uniform 2.5;

    boundaryField
    {
        ".*"
        {
            type            calculated;
            value           uniform 2.5;
        }
    }
}

I hope this is correct now?
Raza Javed is offline   Reply With Quote

Old   August 13, 2019, 07:13
Default
  #24
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Yep, seems fine.
simrego is offline   Reply With Quote

Old   August 20, 2019, 04:53
Default
  #25
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Hi..


Hope you will be fine.


I have question related to fvOptions. If I am using fvOptions to put power in one volume, then what exactly this power is? Is this a power dissipation of that object?


And how can I calculate that with this power, what would be the temperature of my object?


Thank you
Raza Javed is offline   Reply With Quote

Old   August 23, 2019, 04:42
Default
  #26
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Quote:
Originally Posted by simrego View Post
In this solver the calculated pressure field is p_rgh. p is calculated from p_rgh. You should just set calculated BC for every p field. Also these values are only the initial values. In your air/fvSolution file you have to define a reference cell, and a referecne pressure. You can set it to 1bar if your pressure is 1 bar in the domain.
For the material properties you can use what you want, but you need a temperature dependent density. You will have some convective heat transfer. In the U file all you do is set the velocity on the boundaries to zero, which is correct for a wall. But in the domain you will have non zero velocities. (nonuniform temperature field -> nonuniform density -> fluid will start moving.)

Hello,


I have one question here:


How can I find the referenceCell to put in the fvOptions?


for example, in my case, I want to have 1e-5 pascal pressure on the complete AIR domain. so how can I put that?


I shall be very thankful if you can help.


Thank you
Raza Javed is offline   Reply With Quote

Old   August 23, 2019, 05:02
Default
  #27
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi!


If you solve the flow equations, you cant. But as i mentioned earlier you can use frozenFlow in your fvSolution of air and you won't solve any flow equations. Just initialize the domain with that 1e-5 pascal, and zero velocity, and that's all. It won't change since you won't solve any flow equations, only the energy equation.
simrego is offline   Reply With Quote

Old   August 23, 2019, 05:20
Default
  #28
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Quote:
Originally Posted by simrego View Post
Hi!


If you solve the flow equations, you cant. But as i mentioned earlier you can use frozenFlow in your fvSolution of air and you won't solve any flow equations. Just initialize the domain with that 1e-5 pascal, and zero velocity, and that's all. It won't change since you won't solve any flow equations, only the energy equation.

Thank you so much for your reply.


Yes. I did that frozen flow, and Now the solver is not solving any flow equation. Good.


Now, I reduced the pressure to a very low value for Air, to generate a vacuum. But the results after this remain exactly the same. There is no difference in the temperature gradient as with the high temperature (1 bar).


I checked for the prandtl number also, and It doesn't actually change so much with the pressure (its range is approximately 0.7 to 0.8).


But I don't know, how the behavior of temperature could be same even with so less pressure?


Thank you
Raza Javed is offline   Reply With Quote

Old   August 23, 2019, 05:39
Default
  #29
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Of course they remain the same with lower pressure. Check the energy equation what you are solving. It is not affected by the pressure.
BUT since you decrease the pressure your material props must change I think, since you have much less air particles. The thermal conductivity of the air will decreasing really fast as you decrease the pressure. In a really high vacuum you will have nearly 0 thermal conductivity.
Maybe it is not significant from 1bar to 10. But when you go down from 1 bar to 1e-5 Pa, it should be.
simrego is offline   Reply With Quote

Old   August 23, 2019, 06:27
Default
  #30
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Quote:
Originally Posted by simrego View Post
Of course they remain the same with lower pressure. Check the energy equation what you are solving. It is not affected by the pressure.
BUT since you decrease the pressure your material props must change I think, since you have much less air particles. The thermal conductivity of the air will decreasing really fast as you decrease the pressure. In a really high vacuum you will have nearly 0 thermal conductivity.
Maybe it is not significant from 1bar to 10. But when you go down from 1 bar to 1e-5 Pa, it should be.



Thank you so much for your response. It is helpful.


One more question here, Is it possible to use P1 model for Air in my case?


I tried P1 model and it is showing that the Air gets hot faster as compared to the case if I don't use radiation.



I think this behaviour is correct? or NOT?


Thank you
Raza Javed is offline   Reply With Quote

Old   August 23, 2019, 07:27
Default
  #31
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Not really. P1 is good for optically thick media. For air it is not.
It became hot faster because i think you had wrong coefficients for your absorption emission model and the air is absorbed a lot of heat which is not correct since air is "transparent". The radiation should just go through the air without absorption/emission... That's why viewFactor model is the best choice for you I think.
simrego is offline   Reply With Quote

Old   August 23, 2019, 10:13
Default
  #32
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Quote:
Originally Posted by simrego View Post
Not really. P1 is good for optically thick media. For air it is not.
It became hot faster because i think you had wrong coefficients for your absorption emission model and the air is absorbed a lot of heat which is not correct since air is "transparent". The radiation should just go through the air without absorption/emission... That's why viewFactor model is the best choice for you I think.
Ok good. So what would be the difference when we put radiations?
Because I don’t know what I should see to make it sure that my radiation is working fine.?

Thank you.
Raza Javed is offline   Reply With Quote

Old   August 26, 2019, 03:52
Default
  #33
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Quote:
Originally Posted by simrego View Post
Not really. P1 is good for optically thick media. For air it is not.
It became hot faster because i think you had wrong coefficients for your absorption emission model and the air is absorbed a lot of heat which is not correct since air is "transparent". The radiation should just go through the air without absorption/emission... That's why viewFactor model is the best choice for you I think.



I have read in forum that If I want to check that my radiation model is working or NOT, then I must use wallHeatFlux utility on each boundary. but I don't know about that.


Can you please help me in this?


Thank you
Raza Javed is offline   Reply With Quote

Old   August 26, 2019, 04:11
Default
  #34
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Yes, this is a good idea
run this (I hope i have no typo, and replace the regionName and numberOfProcessors to your needs):
chtMultiRegionSimpleFoam -postProcess -func wallHeatFlux -region regionName -latestTime


or in parallel:
mpirun -np numberOfProcessors chtMultiRegionSimpleFoam -parallel -postProcess -func wallHeatFlux -region regionName -latestTime



But you have to run it in on the case with and without radiation so you can see the difference.
simrego is offline   Reply With Quote

Old   August 26, 2019, 04:15
Default
  #35
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Quote:
Originally Posted by simrego View Post
Yes, this is a good idea
run this (I hope i have no typo, and replace the regionName and numberOfProcessors to your needs):
chtMultiRegionSimpleFoam -postProcess -func wallHeatFlux -region regionName -latestTime


or in parallel:
mpirun -np numberOfProcessors chtMultiRegionSimpleFoam -parallel -postProcess -func wallHeatFlux -region regionName -latestTime



But you have to run it in on the case with and without radiation so you can see the difference.



DO I need to install anything or configure any library etc before doing this? OR I can directly do this?


Quote:
chtMultiRegionSimpleFoam -postProcess -func wallHeatFlux -region regionName -latestTime
Raza Javed is offline   Reply With Quote

Old   August 26, 2019, 04:17
Default
  #36
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Quote:
Originally Posted by simrego View Post
Yes, this is a good idea
run this (I hope i have no typo, and replace the regionName and numberOfProcessors to your needs):
chtMultiRegionSimpleFoam -postProcess -func wallHeatFlux -region regionName -latestTime


or in parallel:
mpirun -np numberOfProcessors chtMultiRegionSimpleFoam -parallel -postProcess -func wallHeatFlux -region regionName -latestTime



But you have to run it in on the case with and without radiation so you can see the difference.

because some people are saying that something should be added in controlDict in functions etc etc. but I didn't use it, so I don't have any idea.
Raza Javed is offline   Reply With Quote

Old   August 26, 2019, 04:24
Default
  #37
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
I RAN it and it gave me the following error:


Code:
Create time

Create fluid mesh for region air for time = 28.5

Create solid mesh for region heater for time = 28.5

--> FOAM Warning : 
    From function static bool Foam::functionObjectList::readFunctionObject(const Foam::string&, Foam::dictionary&, Foam::HashSet<>&, const Foam::word&)
    in file db/functionObjects/functionObjectList/functionObjectList.C at line 245
    Cannot find functionObject file wallHeatFlux
Time = 28.5
*** Reading fluid mesh thermophysical properties for region air

    Adding to thermoFluid

Selecting thermodynamics package 
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

    Adding to rhoFluid

    Adding to UFluid

    Adding to phiFluid

    Adding to gFluid

    Adding to hRefFluid

    Adding to ghFluid

    Adding to ghfFluid

    Adding to turbulence

Selecting turbulence model type laminar
Selecting radiationModel viewFactor
Selecting absorptionEmissionModel constantAbsorptionEmission
Selecting scatterModel none
Selecting sootModel none
    Adding MRF

No MRF models present

    Adding fvOptions

No finite volume options present

*** Reading solid mesh thermophysical properties for region heater

    Adding to thermos

Selecting thermodynamics package 
{
    type            heSolidThermo;
    mixture         pureMixture;
    transport       constIso;
    thermo          hConst;
    equationOfState rhoConst;
    specie          specie;
    energy          sensibleEnthalpy;
}

    Adding to radiations

Selecting radiationModel opaqueSolid
Selecting absorptionEmissionModel constantAbsorptionEmission
Selecting scatterModel none
Selecting sootModel none
    Adding fvOptions

No finite volume options present


End
Raza Javed is offline   Reply With Quote

Old   August 26, 2019, 04:43
Default
  #38
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
What version of OF are you using?
You don't need anything for that. It should works:
You can also do it in the controlDict file like this (but this is the same function call):

https://openfoam.com/documentation/g...x.html#details
simrego is offline   Reply With Quote

Old   August 26, 2019, 04:53
Default
  #39
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Quote:
Originally Posted by simrego View Post
What version of OF are you using?
You don't need anything for that. It should works:
You can also do it in the controlDict file like this (but this is the same function call):

https://openfoam.com/documentation/g...x.html#details

I did the following:


In the controlDict I put:


Code:
functions
{
       #include wallHeatFlux(region=air)
}
and then I used the following


Code:
wallHeatFlux -region air -latestTime

And it Works


But on the air_to_heater interface, it is also showing some convection also. even After I am using frozenFlow=Yes


Thank you
Raza Javed is offline   Reply With Quote

Old   August 26, 2019, 05:23
Default
  #40
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
I think you see some conduction through the air.
simrego is offline   Reply With Quote

Reply

Tags
openfoam, radiation, vacuum


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 contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 15:54
OpenFOAM Training, London, Chicago, Munich, Houston 2016-2017 cfd.direct OpenFOAM Announcements from Other Sources 0 September 14, 2016 03:19
An odd ERROR mdakbari Fluent UDF and Scheme Programming 7 April 4, 2016 04:30
OpenFoam volume conditions vmsandip2011 OpenFOAM Running, Solving & CFD 5 February 24, 2012 10:32
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24


All times are GMT -4. The time now is 14:54.