
[Sponsors] 
August 7, 2019, 07:05 
How to define Vacuum Conditions in OpenFoam

#1 
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 
Hello Everyone,
I am using chtMultiRegionSimpleFoam and my Openfoam version is 4.1 I am trying to simulate radiation heat transfer in a vacuum. My questions are the following: 1. How can we generate a vacuum? For example If I have one rectangular region and I want to make it a vacuum, Do I need to change themophysical properties? 2. which radiation model would be suitable for vacuum? I shall be very thankful for your help. Thank you 

August 12, 2019, 05:43 

#2 
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 
Hi!
1. Just set the reference pressure to your needs in the fvSolution file. I assume that you have a closed volume. Change from what? 2. It depends. The medium is participating in the radiation, or not? It is optically thick, or not? 

August 12, 2019, 05:52 

#3  
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 
Quote:
Thank you so much for your reply. My geometry is attached. Please have a look The green region is a heater, and the blue region is the air, that I want to make vacuum. because I want to see the behavior of radiations in the vacuum coming out from the green heater. Please let me know if you need further clarification about the case. thank you 

August 12, 2019, 05:53 

#4  
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 
Quote:
I am putting viewFactor radiation model in the region air, and radiation model Opaque on the heater. 

August 12, 2019, 07:24 

#5 
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 
Since this is air, the viewFactor model seems fine.
For the vacuum what is the pressure in the vacuum? And again this is a closed volume, right? without inlets/outlets. 

August 12, 2019, 07:37 

#6  
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 
Quote:
Yes this is a closed volume without inlets/outlets. Below is the mesh information for my air region: Code:
2 ( defaultFaces { type wall; nFaces 8400; startFace 319164; } vacuum_to_heater { type mappedWall; inGroups 1 ( wall ); nFaces 336; startFace 327564; sampleMode nearestPatchFace; sampleRegion heater; samplePatch heater_to_vacuum; } ) The pressure I am using is 1 bar, you can see below the changeDictionaryDict of my air(vacuum name used in the case) region: I have put the zero velocity, so that there should be no heat transfer through convection. Code:
boundary { defaultFaces { type wall; } } T { internalField uniform 300; boundaryField { defaultFaces { type zeroGradient; } "vacuum_to_.*" { type compressible::turbulentTemperatureCoupledBaffleMixed; Tnbr T; kappaMethod fluidThermo; value uniform 300; } } } U { internalField uniform (0 0 0); boundaryField { defaultFaces { type noSlip; } "vacuum_to_.*" { type noSlip; } } } p_rgh { internalField uniform 0; boundaryField { defaultFaces { type fixedFluxPressure; value uniform 0; } ".*" { type fixedFluxPressure; value uniform 0; } } } p { internalField uniform 100000; boundaryField { ".*" { type fixedValue; value uniform 100000; } } } 

August 12, 2019, 08:50 

#7 
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 
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.) 

August 12, 2019, 09:03 

#8  
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 
Quote:
So, the boundary conditions and initial values for p_rgh would remain as they are? like below: Code:
p_rgh { internalField uniform 0; boundaryField { defaultFaces { type fixedFluxPressure; value uniform 0; } ".*" { type fixedFluxPressure; value uniform 0; } } } And for pressure I should put on each boundary "calculated"? Material properties of my air region is below: Code:
thermoType { type heRhoThermo; mixture pureMixture; transport const; thermo hConst; equationOfState perfectGas; specie specie; energy sensibleEnthalpy; } mixture { specie { nMoles 1; molWeight 28.9; } thermodynamics { Cp 1000; Hf 0; } transport { mu 1.8e05; Pr 0.7; } } But there is no entry for density (rho). shall I put one? I exactly dont know How to define the reference cell and reference pressure? Below is my air/fvSolution file Code:
solvers { rho { solver PCG preconditioner DIC; tolerance 1e7; relTol 0; } p_rgh { solver GAMG; tolerance 1e7; relTol 0.01; smoother GaussSeidel; cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; maxIter 10; } "(Uhkepsilon)" { solver PBiCG; preconditioner DILU; tolerance 1e7; relTol 0.1; } } SIMPLE { momentumPredictor on; nNonOrthogonalCorrectors 2; pRefCell 0; pRefValue 100000; 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; Qr 0.7; } } // ************************************************************************* // 

August 12, 2019, 09:21 

#9 
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 
So for p you can use calculated. The solver solves for p_rgh, and calculate p from p_rgh. So just let the solver to calculate everything for p.
For p_rgh, you should set the initial values to 1 bar since this is your operating pressure, and it can speed up the convergence if you have a better guess with the initial values. Just replace every uniform 0; to uniform 100000; in the p_rgh subdictionary You don't need rho because of that line: equationOfState perfectGas; with this model you calculate rho from molweight, temperature, and pressure. This is accurate but it can be unstable. Your fvSolution seems fine, but your rhoMin and rhoMax will maked you mad. air density will be around 1, but you limit it between 7001200. You can comment that lines out and use the limiter only if your density blows up (if during the solution you will have really large or small densities). And you could use smaller relaxation factors. These kind of problems can be really unstable (bad convergence). 

August 12, 2019, 09:55 

#10  
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 
Quote:
I changed the boundary conditions for p and p_rgh like below: Code:
p_rgh { internalField uniform 100000; boundaryField { defaultFaces { type fixedFluxPressure; value uniform 100000; } ".*" { type fixedFluxPressure; value uniform 100000; } } } p { internalField uniform 100000; boundaryField { ".*" { type calculated; value uniform 100000; } } } First I tried putting 0 value in p instead of 100000, but then the solver was giving error, then I changed that also to 100000 like p_rgh. Is this correct? And I removed those two lines for rhomin and rhomax from fvSolutions. 

August 12, 2019, 10:14 

#11 
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 
Yes, it should.
It crashed because of your "density model" i think. you set the p for 0. For the first time it will tries to calculate the density as: rho = p/(R*T) With 0 p you will get 0 density. And everything goes wrong. In the next step it should be fine since p is recalculated from p_rgh and it will be correct. But you can't get there since you failed already. So 1bar for p is correct, but doesn't really matter since it is just an initial value. Just survive the first few iterations! And now your case is running? 

August 12, 2019, 10:31 

#12  
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 
Quote:
Yes. with the initial values and boundary conditions I attached in the last post, the solver is running. I am sorry I have one another question related to fvOptions. In my heater region inside the air region, I am putting power using fvOptions file. I want to put 10W of power in that. The volume of my heater region is 1e12 cubic meter. What value should I write in fvOptions if I am using specific volume mode? shall I divide 10 watts with the volume of heater and then put the result in fvOptions? Code:
heatSource { type scalarSemiImplicitSource; active true; scalarSemiImplicitSourceCoeffs { selectionMode all; // all, cellSet, cellZone, points // cellZone hot; //cellSet c1; volumeMode specific; // absolute; injectionRateSuSp { h (1e13 0); } } } 

August 12, 2019, 10:35 

#13 
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 
Feel free to ask. If i can i'll try to help you
There is a simpler solution. Set the volumeMode to absolute. So you can simply write 10. https://openfoam.com/documentation/guides/latest/api/classFoam_1_1fv_1_1SemiImplicitSource.html#details : Valid options for the volumeMode entry include:


August 12, 2019, 10:37 

#14 
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 
But to answer your question. in specific mode you just have to divide 10 W with the volume. So 1e13 seems correct. But I suggest you to let the solver calculate these thing so you'll have less sources for the mistakes.


August 13, 2019, 04:25 

#15  
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 
Quote:
Thank you. I did and now the solver is running. Please correct me where I am wrong. So, till here the solver is running with a heater inside air, and we put p_rgh and p equals to 1 bar. Now, I need to change this air to vacuum, so I must decrease the pressure. I cannot put zero for p because then the solver stops. So can I put p_rgh equals to zero, and p equals to very very small value for vacuum? And in the U subdictionary, do I need to put some value for the velocity also? Thank you 

August 13, 2019, 05:11 

#16 
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 
I don't think if you can set zero pressure with this solver. I think this is not suitable for that. You can use small pressure, but with 0 I think it will blow up. But you can give it a try.
If you need a different pressure, just set it in the fvSolution file, and correct the p_rgh and p field to the same pressure (Again in the p_rgh and p files you just giving initial values, they shouldn't affect the solution.) And if you decrease the pressure, you have to correct the material properties of the air to that pressure and temperature. Since the properties of air are depends on the pressure and temperature. You can leave U as it is. You will have some air motion. Or you can set a "frozenFlow yes;" flag in the "air/fvSolution/SIMPLE", and you will solve only the energy equation, thus the velocity and pressure field will be the initialized value during the solution, so if you set 0 velocity, you will have only radiation, and conduction through the air. 

August 13, 2019, 05:32 

#17  
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 
Quote:
I put everything zero like below: Code:
p_rgh { internalField uniform 0; boundaryField { defaultFaces { type fixedFluxPressure; value uniform 0; } ".*" { type fixedFluxPressure; value uniform 0; } } } p { internalField uniform 0; boundaryField { ".*" { type calculated; value uniform 0; } } } and I got the following error: Code:
Time = 0.1 Solving for fluid region vacuum #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64linuxgnu/libc.so.6" #3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:? #4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:? #5 Foam::fluidThermo::nu() const at ??:? #6 Foam::laminar<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > >::nuEff() const at ??:? #7 Foam::linearViscousStress<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > >::divDevRhoReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const at ??:? #8 ? at ??:? #9 __libc_start_main in "/lib/x86_64linuxgnu/libc.so.6" #10 ? at ??:? Floating point exception (core dumped) Quote:
where in fvSolution I can put pressure? at pRefValue? In the fvSolution file, I will put p or p_rgh ? Quote:
You mean to say that I need to change the values mentioned below with the new small pressure I will put? Code:
thermoType { type heRhoThermo; mixture pureMixture; transport const; thermo hConst; equationOfState perfectGas; specie specie; energy sensibleEnthalpy; } mixture { specie { nMoles 1; molWeight 28.9; } thermodynamics { Cp 1000; Hf 0; } transport { mu 1.8e05; Pr 0.7; } } 

August 13, 2019, 05:46 

#18 
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 
Yes this error is a figFpe, you have a division with 0 somewhere. Probably because of that 0 pressure.
Sorry, yes. Only the pRefValue have to be modified. You don't have to put anything else in the fvSolution, only modify the pRefvalue. Yes you have to modify them. I think Pr=0.7 is only valid for air on atmospheric pressure and ~300 K. Also check the viscosity. But if you use frozenFlow maybe the viscosity is redundant. 

August 13, 2019, 05:55 

#19  
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 
Quote:
Ok. for example: if I put pRefValue=2.5, then I have to change p and p_rgh in changeDictionaryDict to 2.5 also? 

August 13, 2019, 06:21 

#20  
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 
Quote:
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? 

Tags 
openfoam, radiation, vacuum 
Thread Tools  Search this Thread 
Display Modes  


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 20162017  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 SOLAVOF  Fan  Main CFD Forum  10  September 9, 2006 12:24 