|
[Sponsors] |
October 18, 2011, 12:18 |
dsmcFoam Vacuum
|
#1 |
New Member
Join Date: Aug 2011
Posts: 1
Rep Power: 0 |
Hello,
a gas from inlet (atmospheric conditions) to outlet (vacuum) How to set the parameter of the vacuum boundary (rho, or ?) of outlet in the dsmcFoam ? And how to set the the parameter of boundary (V, rhoN, or P) of inlet ? Thanks. |
|
October 24, 2011, 04:13 |
|
#2 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
Hello Bitguang,
For the inlet and outlet patches the dsmcFoam code, by default, puts a numberdensity of particles defined in the freeStream entry of your control/dsmcProperties. Other than this it reads the boundaryU and boundaryT entries in the time directory and controls these boundaries accordingly. The quick fix for simulating vacuum is to set a velocity boundary at the vacuum patch which "blows" the newly created particles out of the domain directly i.e. a high velocity in direction out of the domain. Alternativly you can enter the file src/dscm/submodels/InflowBoundaryModel/FreeStream/FreeStream.C (around line 200) and enter something like: Code:
// From Bird eqn 4.22 scalar nd= numberDensities_[i]; scalar nIn=<inlet value>;//enter here desired inlet number density scalar nOut=<outlet value>;//enter here desired outlet number density //name your inlet "inLet" and your outlet "outLet" if("inLet"==patch.name()) nd= nIn/cloud.nParticle(); if("outLet"==patch.name()) nd= nOut/cloud.nParticle(); Info << "target number density for patch <" << patch.name() << "> is :" << nd*cloud.nParticle() << endl; pFA[i] = mag(patch.faceAreas())*nd*deltaT *mostProbableSpeed *( exp(-sqr(sCosTheta)) + sqrtPi*sCosTheta*(1 + erf(sCosTheta)) ) /(2.0*sqrtPi); Cheers and hope this helps, Erik |
|
December 6, 2011, 16:50 |
|
#3 |
Member
Join Date: Aug 2009
Posts: 67
Rep Power: 17 |
Hi Erik,
I have the same problem! Can you help me? In the file FreeStream.C what value i have to enter for the desired inlet number density and outlet? The only value known is the input particle number density for inlet and vacuum for outlet. If you have time in this thread i describe my problem! http://www.cfd-online.com/Forums/ope...am-solver.html Thanks a lot, spk |
|
December 7, 2011, 03:49 |
|
#4 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
Hi Spk,
This depends on the problem which you want to solve, if I understand you question correctly. If you instead know what pressure and temperature you want at the inlet or outlet of your case then determine the number density by n=p/kT (ideal gas law). Then enter these values for nIn and nOut. Cheers and hope this helps, Erik |
|
December 7, 2011, 07:40 |
|
#5 |
Member
Join Date: Aug 2009
Posts: 67
Rep Power: 17 |
Hi Erik,
Thanks a lot for your answer! Yes i know pressure and temperature for the inlet so i know nIn! The outlet is vacuum and also i know the temperature! What value should i enter for nOut? Thanks, spk |
|
December 7, 2011, 07:53 |
|
#6 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
Hi spk,
No problem. If your outlet is perfect vacuum set nOut = 0. And it wont matter what temperature you set (have) there. Cheers, Erik |
|
December 7, 2011, 08:14 |
|
#7 |
Member
Join Date: Aug 2009
Posts: 67
Rep Power: 17 |
Hi Erik,
Thanks for your fast answer! Ok i understand! I would like to ask you an another question! These values nIn and nOut, i have to enter also to folder 0 at files dsmcRhoN and rhoN? Thanks, spk |
|
December 7, 2011, 08:19 |
|
#8 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
The way I am describing here might be a bit of dirty coding.
What you write here over-rides what is written for the same boundaries in the time directory. For the freeStream utility it is only the temperature and the bulkVelocity which are read from the time directory. Cheers, Erik |
|
December 7, 2011, 08:29 |
|
#9 |
Member
Join Date: Aug 2009
Posts: 67
Rep Power: 17 |
Thanks Erik,
You mean that it wont matter what values are entered to dsmcRhoN and rhoN? I thought to enter these values to 0 folder as fixed values. Also at boundaryU file, i think to enter 0 and fixed value for inlet(according to my problem) and 0 and calculated for outlet! spk |
|
December 7, 2011, 08:33 |
|
#10 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
yes, it wont matter what number density you prescribe for these patches in the 0 directory. But the bulk-velocity and the temperature is still read from the 0 directory so these need to be correct.
Cheers |
|
December 7, 2011, 08:35 |
|
#11 |
Member
Join Date: Aug 2009
Posts: 67
Rep Power: 17 |
Ok i understand!
Thanks a lot Erik for your time!!! |
|
December 8, 2011, 18:52 |
|
#12 |
Member
Join Date: Aug 2009
Posts: 67
Rep Power: 17 |
Hi Erik again,
I changed and saved the FreeStream.C file. In order to compile the dsmc library and solver, i have to create a Make folder with options and files? Then use wmake? Can you give some instructions? I'm new OpenFoam user! Thanks a lot, spk |
|
March 2, 2012, 04:56 |
dsmcInitialise
|
#13 | |
New Member
Weiyue Liu
Join Date: May 2011
Location: Wuppertal, Germany
Posts: 2
Rep Power: 0 |
Quote:
I have two questions: 1. For scalar nIn=<inlet value>; scalar nOut=<outlet value>; I think for one patch (e.g. inLet) I can only input one desired number density value. I got the same number density value if I use more than one spieces (N2 and O2), but actually they should not be the same (i.e. N2 78%, O2 22%). So I wonder how to get the different values for different spieces if only one number density values is input, or is there another way to do it? 1. Is it possible to set ununiform number density values so as to get a ununiformly distributed pressure? Thanks in advance. Liu |
||
March 5, 2012, 04:29 |
|
#14 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
Hi Liu,
1) The lines I wrote were meant for a single specie gas. If you have more than one specie you could try and enter an if condition to the code above as follows: if("inLet"==patch.name() && typeId==0) nd= nIn0/cloud.nParticle(); if("outLet"==patch.name()&& typeId==0) nd= nOut0/cloud.nParticle(); if("inLet"==patch.name() && typeId==1) nd= nIn1/cloud.nParticle(); if("outLet"==patch.name()&& typeId==1) nd= nOut1/cloud.nParticle(); 2) The distribution of pressure should depend on the configuration of your case. If the inLet and outLet are set similarly you should achieve the set and desired values uniformly in the whole domain. Cheers, Erik |
|
March 5, 2012, 05:54 |
|
#15 |
New Member
Weiyue Liu
Join Date: May 2011
Location: Wuppertal, Germany
Posts: 2
Rep Power: 0 |
Hi Erik,
Thank you very much for your reply! Liu |
|
March 24, 2012, 13:19 |
|
#16 |
New Member
Thanasis
Join Date: Mar 2010
Location: Greece
Posts: 9
Rep Power: 16 |
Hi Erik,
Could you give a hint how the code should be modified in order to read the number of density values from a file. I am new in C++ Thanks |
|
September 24, 2012, 16:03 |
|
#17 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
Hi Thanasis,
Sorry for giving a late reply. To read data from a file: //Add the following lines among you inclusion files #include <iostream> #include <fstream> using namespace std; //add the following lines where you want to read the data (here the file which is read should have two scalar numbers) scalar p=0,Ux=0; ifstream strData; // indata is like cin strData.open("nameOfFile"); strData >> p; strData >> Ux; strData.close(); hope this helps, Erik |
|
September 24, 2012, 16:08 |
|
#18 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
Alternatively you can use OpenFOAMs format to read from dictionaries as follows:
IOdictionary setParam ( IOobject ( "myDict", mesh_.time().constant(), mesh_, IOobject::MUST_READ, IOobject::NO_WRITE ) ); scalar buffRI = readScalar ( setParam.lookup("buffResInt") ); Cheers, Erik |
|
May 2, 2013, 05:53 |
How to see the molecular in paraview
|
#19 |
New Member
Carl
Join Date: Dec 2012
Posts: 14
Rep Power: 14 |
Hi,Erik
I am using dsmcFoam to do a simulation on vaccum plume,I have a question,can we see all the moleculars in paraview?or how to display these moleculars? |
|
November 10, 2014, 12:12 |
pressure and velocity on inlet?
|
#20 |
New Member
Join Date: Oct 2013
Posts: 3
Rep Power: 13 |
Hello Erik,
I know this reply might be a little late but I am currently considering your option to calculate pressure driven flows. I already used your "dirty method" and I am pretty sure the method does not affect the inflow velocity (still read in the boundaryU file). It is quite uncommon to have a velocity and a pressure specified at an inlet. I thought of setting a zero gradient velocity on inlet and outlet. Or shall I still specify a fixedValue at the inlet (something like (0 0 0))? What would you suggest? Thank you very much. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
radiation modeling in vacuum | mirko | OpenFOAM Programming & Development | 7 | May 20, 2016 09:31 |
Simulation of Controlled Leak into Vacuum System | eric.m.tridas | OpenFOAM | 6 | May 6, 2015 10:46 |
Assistance in Vacuum pump simulation | enr_venkat | CFX | 5 | November 20, 2012 12:50 |
DSMC for turbomolecular vacuum pumps | ivan_cozza | OpenFOAM Running, Solving & CFD | 0 | January 20, 2011 03:54 |
Radiation in vacuum | nitin | CFX | 0 | July 6, 2009 02:49 |