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

DSMC errors at inflow and outflow boundary

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 7, 2013, 06:55
Default DSMC errors at inflow and outflow boundary
  #1
New Member
 
wenjie
Join Date: Dec 2012
Posts: 12
Rep Power: 13
wenjie is on a distinguished road
Hello,

I am a new user on dsmcFoam and trying to simulate a very basic case: a shpere in a confined microfluid in 3D in order to compute the drag coefficient.

case parameters:
0.1 atm, 293 K air with free stream velocity 20m/s. shpere diameter: 1e-6 m with an outer rectangular domain with width 6e-6 m, length 6e-6.

B.C.
0.1 atm, 293 K air for the free stream (corresponding molecular number density), Velocity: fixed value of 20m/s at inflow and outflow. symmetry plane for surrounding walls. fixed value of 0 on the surface of sphere.
Temperature: 293 K everywhere

control parameter:

meanfreepath based on VHR model is 2.2e-7 therefore the maximum grid size is chosen to be 2e-7, mean molecular thermal velocity is 450m/s, so the time step is set: 5e-11 = 0.1 (2.2e-7 / 450) which I think is small enough.

The simulation is run until T= 1.05e-6 which means the flow already passed more than 3 times of the domain length.

I attached the results.

Here are my quesitons:

1. why there is a thin layer of different velocity at the inflow and outflow? (lower at the inflow and higher at the outflow) It is physically not true, so I am wondering what set up of my case could cause this problem.

2. the velocity profile seems reasonable despite the strange phenomena mentioned above (about 20 at boundary to about 0 at the surface) but with significant fluctuation. So how longer time should I run it to get a smooth average value?

I would appreciate any relevant help!!
Attached Images
File Type: jpg Umean_dsmc_smallt.jpg (18.0 KB, 115 views)
File Type: png Umean_x3_10_5.png (4.5 KB, 91 views)
wenjie is offline   Reply With Quote

Old   February 12, 2013, 04:58
Default
  #2
New Member
 
wenjie
Join Date: Dec 2012
Posts: 12
Rep Power: 13
wenjie is on a distinguished road
Nobody is working on DSMC? Please help me with any possible guess...
wenjie is offline   Reply With Quote

Old   February 13, 2013, 22:38
Default
  #3
j3r
New Member
 
Join Date: Jun 2012
Posts: 11
Rep Power: 13
j3r is on a distinguished road
hey wenjie,
in the two files you posted, where is the inlet and outlet? y=+-3e-6?

some thinks you should keep in mind:
- you are right, the max. grid size should be smaller than the mean free path. however, they should not get too small either as you must have at least 5-10 dsmc-particles in each cell. so i would check dsmcRohN
- the inlet and outlet conditions are not only defined by U and T but also the difference in number densities (i.e. in dsmcProperties and dsmcInitilizeDict).
- the fluctuations might also be caused by the number of dsmc particles per cell (i.e. if you have only 2 in one cell the statistic noise for the average U is quite high). otherwise, too large cells might be the reason but again, you should check dsmcRohN. if you have not enough dsmc particles just decrease nEquivalentParticles in dsmcProperties (however, this will increase the computation costs)
- even though your time steps are small enough i would try to further reduce them. this will increase computation costs but might avoid artifacts at the open boundary.

also, i would try to run the same case twice and compare the results. in my case i had some difficulties with the random number generator and the results were always exactly the same. if your results are slightly different, you can take averages to decrease the fluctuation.

cheers,
j3r
j3r is offline   Reply With Quote

Old   February 17, 2013, 15:01
Default
  #4
New Member
 
wenjie
Join Date: Dec 2012
Posts: 12
Rep Power: 13
wenjie is on a distinguished road
Hi J3r,

Thanks for the comments. The inlet and outlet are x= -3e-6 and x=3e-6, which means the flow is coming from the left to the right in the first figure. There are strange thin layers of different velocity both at the inlet and outlet.

- you are right, the max. grid size should be smaller than the mean free path. however, they should not get too small either as you must have at least 5-10 dsmc-particles in each cell. so i would check dsmcRohN

I have checked the dsmcRohn, the minimum number is 9 and maximum is 247, because I have a refined mesh(smaller grid size) around the sphere, so there it appears the low values.

- the inlet and outlet conditions are not only defined by U and T but also the difference in number densities (i.e. in dsmcProperties and dsmcInitilizeDict).

Yes, that's true. But in dsmcfoam I can only define the number density through the "FreeStreamCoeffis" in the constant/dsmcProperties for the inlet and outlet, isn't it? As far as I know, the dsmcRhoN in the 0/ folder doesn't really work(the solver doesn't read in it when solving). Also, the main Idea of this simulation is to estimate the drag coefficient of the sphere in a confined microflow with a certain flow velocity. How do I know the pressure(number density) at the outlet in advance before the simulation and set it as the boundary condition? Or can I set zeroGradient like in the continuum CFD?

- even though your time steps are small enough i would try to further reduce them. this will increase computation costs but might avoid artifacts at the open boundary.

Could you please be more specific on this? What is the criteria for the time setp and why a smaller one could avoid the artifacts at the open boundary?

Thanks again.

Wenjie
Attached Images
File Type: jpg dsmc_RhoN.jpg (70.3 KB, 59 views)
wenjie is offline   Reply With Quote

Old   February 20, 2013, 15:48
Default injection of particles at the inflow boundary
  #5
New Member
 
wenjie
Join Date: Dec 2012
Posts: 12
Rep Power: 13
wenjie is on a distinguished road
I think I have figured out the inflow/olutflow thin layer problem. Thanks to the replys and messages, I have modified the tutorial case 'wedge...' using a 10 time smaller length scales(nequavalent as well).

Attached is what I found. It now makes it quite clear that the particles are injected into the domain in pulses and the velocity is averaged based on each cell.
Attached Images
File Type: jpg large_t_Umean_dsmc.jpg (73.5 KB, 84 views)
wenjie is offline   Reply With Quote

Old   February 21, 2013, 00:27
Default
  #6
j3r
New Member
 
Join Date: Jun 2012
Posts: 11
Rep Power: 13
j3r is on a distinguished road
Hi,

As far as I know (use a different case myself, so not an expert on this) the problem with dsmcFoam to simulate flow is that you can only set one number density (i.e. pressure) at all patches. Thus, in your case you have the same pressure at the inlet and outlet. But as you said, you will probably have a lower pressure and thus number density at the outlet than the inlet (i.e. pressure drop due to drag force between your gas an the walls/sphere). There are already a couple of thread that discuss this issue, i.e.:

http://www.cfd-online.com/Forums/ope...smcfoam-2.html

http://www.cfd-online.com/Forums/ope...am-vacuum.html

http://www.cfd-online.com/Forums/ope...-download.html

Regarding the time step dependance I'm not so confident but have the following theory:

Lets say you have 1000 molecules within the first cell. In one iteration step 100 move to the next cell or are deleted as they cross the open boundary. Now you initialize 100 new molecules right at the open boundary with a velocity determined by some Maxwell distribution. However, all of your molecules only move in one direction, i.e. into the first cell. This changes our average velocity within your first cell and in this direction (thus Ux in your case; similar for the outlet). If you decrease your time steps less dsmc particles are initialized in each step and this effect is less pronounced.

Regarding the pulses:
I have seen something similar before but still could not figure out where it is coming from or how to avoid it.

Cheers,
j3r
j3r is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
mixed inflow/outflow downstream boundary condition question peob OpenFOAM Running, Solving & CFD 3 February 3, 2017 11:54
CFX13 Post Periodic interface EtaEta CFX 7 December 8, 2011 18:15
Outflow boundary Control Volume SIMPLE Help !!! Mizerable Main CFD Forum 4 August 22, 2011 14:00
Inflow without outflow! ANASTASIOS GEORGOULAS FLUENT 3 September 15, 2007 04:58
Boundary Errors Shazlan Siemens 5 March 17, 2005 01:18


All times are GMT -4. The time now is 20:48.