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

dsmcFoam Vacuum

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 18, 2011, 12:18
Default dsmcFoam Vacuum
  #1
New Member
 
Join Date: Aug 2011
Posts: 1
Rep Power: 0
bitguang is on a distinguished road
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.
bitguang is offline   Reply With Quote

Old   October 24, 2011, 04:13
Default
  #2
Member
 
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17
Erik is on a distinguished road
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);
Then compile the dsmc library and then compile the solver.

Cheers and hope this helps,
Erik
Erik is offline   Reply With Quote

Old   December 6, 2011, 16:50
Default
  #3
spk
Member
 
Join Date: Aug 2009
Posts: 67
Rep Power: 17
spk is on a distinguished road
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
spk is offline   Reply With Quote

Old   December 7, 2011, 03:49
Default
  #4
Member
 
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17
Erik is on a distinguished road
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
Erik is offline   Reply With Quote

Old   December 7, 2011, 07:40
Default
  #5
spk
Member
 
Join Date: Aug 2009
Posts: 67
Rep Power: 17
spk is on a distinguished road
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
spk is offline   Reply With Quote

Old   December 7, 2011, 07:53
Default
  #6
Member
 
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17
Erik is on a distinguished road
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
Erik is offline   Reply With Quote

Old   December 7, 2011, 08:14
Default
  #7
spk
Member
 
Join Date: Aug 2009
Posts: 67
Rep Power: 17
spk is on a distinguished road
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
spk is offline   Reply With Quote

Old   December 7, 2011, 08:19
Default
  #8
Member
 
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17
Erik is on a distinguished road
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
Erik is offline   Reply With Quote

Old   December 7, 2011, 08:29
Default
  #9
spk
Member
 
Join Date: Aug 2009
Posts: 67
Rep Power: 17
spk is on a distinguished road
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
spk is offline   Reply With Quote

Old   December 7, 2011, 08:33
Default
  #10
Member
 
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17
Erik is on a distinguished road
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
Erik is offline   Reply With Quote

Old   December 7, 2011, 08:35
Default
  #11
spk
Member
 
Join Date: Aug 2009
Posts: 67
Rep Power: 17
spk is on a distinguished road
Ok i understand!
Thanks a lot Erik for your time!!!
spk is offline   Reply With Quote

Old   December 8, 2011, 18:52
Default
  #12
spk
Member
 
Join Date: Aug 2009
Posts: 67
Rep Power: 17
spk is on a distinguished road
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
spk is offline   Reply With Quote

Old   March 2, 2012, 04:56
Default dsmcInitialise
  #13
New Member
 
Weiyue Liu
Join Date: May 2011
Location: Wuppertal, Germany
Posts: 2
Rep Power: 0
liuwy86 is on a distinguished road
Quote:
Originally Posted by Erik View Post
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);
Then compile the dsmc library and then compile the solver.

Cheers and hope this helps,
Erik
Hi Erik,

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
liuwy86 is offline   Reply With Quote

Old   March 5, 2012, 04:29
Default
  #14
Member
 
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17
Erik is on a distinguished road
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
Erik is offline   Reply With Quote

Old   March 5, 2012, 05:54
Default
  #15
New Member
 
Weiyue Liu
Join Date: May 2011
Location: Wuppertal, Germany
Posts: 2
Rep Power: 0
liuwy86 is on a distinguished road
Hi Erik,

Thank you very much for your reply!

Liu
liuwy86 is offline   Reply With Quote

Old   March 24, 2012, 13:19
Default
  #16
New Member
 
Thanasis
Join Date: Mar 2010
Location: Greece
Posts: 9
Rep Power: 16
thanz is on a distinguished road
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
thanz is offline   Reply With Quote

Old   September 24, 2012, 16:03
Default
  #17
Member
 
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17
Erik is on a distinguished road
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
Erik is offline   Reply With Quote

Old   September 24, 2012, 16:08
Default
  #18
Member
 
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17
Erik is on a distinguished road
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
Erik is offline   Reply With Quote

Old   May 2, 2013, 05:53
Smile How to see the molecular in paraview
  #19
New Member
 
Carl
Join Date: Dec 2012
Posts: 14
Rep Power: 13
jiaoxiaolei is on a distinguished road
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?
jiaoxiaolei is offline   Reply With Quote

Old   November 10, 2014, 12:12
Default pressure and velocity on inlet?
  #20
New Member
 
Join Date: Oct 2013
Posts: 3
Rep Power: 13
lojodr is on a distinguished road
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.
lojodr is offline   Reply With Quote

Reply


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
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


All times are GMT -4. The time now is 11:24.