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

dsmcFoam setup

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 4 Post By hherbol

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 14, 2013, 18:16
Default dsmcFoam setup
  #1
New Member
 
Henry
Join Date: Jul 2013
Posts: 1
Rep Power: 0
hherbol is on a distinguished road
To the OpenFoam community,
I have been trying to get OpenFOAM's dsmcFoam solver to work properly and with the numerous issues I have gotten I am unsure if it is due to the installation (which I have re-installed twice) or the setup I've done. I have searched online for a while and can't find any good sources that describe the use of dsmcFoam. In an effort to improve my understanding of how to run dsmcFoam (and OpenFOAM in general) I have decided to start writing in detail the use of each file and was hoping someone could tell me where I am wrong in the following descriptions. I will be using a simple fluid flow through a pipe with patches defined for “inlet”, “outlet” and “walls”.

0 Folder Files:
Dimensions are defined by [kg,m,s,K,mol,A,cd] in which the value represents the exponent. Ex. [1 -1 -2 0 0 0 0] is kg/(m*s^2)

internalField{} – This defines the initial properties of the fluid flow.
boundaryField{} – This defines the boundary conditions of the system and are kept constant.


type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0);

boundary T (Scalar) – The temperature defined for each patch. In the instance of a pipe, I've defined everything the same for it being initially at room temp:

Units (K)
internalField{}-
uniform 300; // Your initial fluid Temperature is defined here

boundaryField{}-
Inlet: type fixedValue; value uniform 300;
Outlet: type fixedValue; value uniform 300;
Walls: type fixedValue; value uniform 300;

boundaryU (Vector) – The fluid's primary velocity? I am unsure of how to properly define this...

Units (m/s)
internalField{}-
uniform (0 0 2); // Your initial fluid velocity is defined here

boundaryField{}-
Inlet: type fixedValue; value uniform (0 0 0);
Outlet: type fixedValue; value uniform (0 0 2);
Walls: type fixedValue; value uniform (0 0 2);

dsmcRhoN (Scalar) – The population of the particles in each cell. A readme says that “the boundary conditions are zeroGradient because only cell data is meaningful” so the following was defined:

Units (1/m^3)
internalField{}-
uniform 0; // Your initial fluid population is defined here

boundaryField{}-
Inlet: type calculated; value uniform 0;
Outlet: type calculated; value uniform 0;
Walls: type calculated; value uniform 0;

dsmcSigmaTcRMax (Scalar) – This file was not given in the tutorials so it was hard to understand (also, I could not find a good explanation of it online). In the readme it says that it’s “used in the selection of collision partners”. I have essentially guessed on how to define this file. I believe the Units should be 1/m^3 to correspond with particles/volume.

Units (1/m^3)
internalField{}-
uniform 0; // You have 0 chance of collisions when no fluid is present initially

boundaryField{}-
Inlet: type calculated; value uniform 0;
Outlet: type calculated; value uniform 0;
Walls: type calculated; value uniform 0;

fD (Vector) – This file holds the stress vector (force density) for the flow field. I am a little confused by what this implies here…

Units (kg/(m*s^2))
internalField{}-
uniform (0 0 0) // With no fluid, there is no force?

boundaryField{}-
Inlet: type calculated; value uniform (0 0 0);
Outlet: type calculated; value uniform (0 0 0);
Walls: type calculated; value uniform (0 0 0);

iDof (Scalar) – I believe this file defines the number density of particles in the system.

Units (1/m^3)
internalField{}-
uniform 0; // No particles at first so no number density

boundaryField{}-
Inlet: type calculated; value uniform (0 0 0);
Outlet: type calculated; value uniform (0 0 0);
Walls: type calculated; value uniform (0 0 0);

internalE(Scalar) -

Units (kg*m^2/s^2)) // Re-defined as joules. For some reason tutorial had units as Pascal
internalField{}-
uniform 0; // No particles at first so no energy

boundaryField{}-
Inlet: type calculated; value uniform 0;
Outlet: type calculated; value uniform 0;
Walls: type calculated; value uniform 0;

linearKE(Scalar) -

Units (kg*m^2/s^2)) // Re-defined as joules. For some reason tutorial had units as Pascal
internalField{}-
uniform 0; // No particles at first so no energy

boundaryField{}-
Inlet: type calculated; value uniform 0;
Outlet: type calculated; value uniform 0;
Walls: type calculated; value uniform 0;

momentum(Vector) –

Units (kg*m/s)) // Re-defined for P=m*v=kg*m/s. For some reason tutorial had (kg/(m^2*s))
internalField{}-
uniform 0; // No particles at first so no momentum

boundaryField{}-
Inlet: type calculated; value uniform (0 0 0);
Outlet: type calculated; value uniform (0 0 0);
Walls: type calculated; value uniform (0 0 0);

q(Scalar) – This is the heat flux through the system.

Units (kg/s^3)
internalField{}-
uniform 0; // No particles at first so no heat flux

boundaryField{}-
Inlet: type calculated; value uniform 0;
Outlet: type calculated; value uniform 0;
Walls: type calculated; value uniform 0;

rhoM(Scalar) – This is the density by mass of particles

Units (kg/m^3)
internalField{}-
uniform 0; // No particles at first so no mass density

boundaryField{}-
Inlet: type calculated; value uniform 0;
Outlet: type calculated; value uniform 0;
Walls: type calculated; value uniform 0;

rhoN(Scalar) – This is the density by number of particles

Units (1/m^3)
internalField{}-
uniform 0; // No particles at first so no number density

boundaryField{}-
Inlet: type calculated; value uniform 0;
Outlet: type calculated; value uniform 0;
Walls: type calculated; value uniform 0;

Constant folder:

dsmcProperties – This defines the fluid in the system

nEquivalentParticles 1.2e12 // Number of particles

WallInteractionModel MaxwellianThermal // How the particles interact with the wall

BinaryCollisionModel VariableHardSphere // How the particles interact with themselves
VariableHardSphereCoeffs {Tref 300;} // Unsure of this variable… Reference Temp?

InflowBoundaryModel FreeStream; // How the fluid is described?
FreeStreamCoeffs {numberDensities {N2 1.0e20;}}; // Number density of the particle

typeIdList (N2); // List of particles

moleculeProperties // Material properties
{
N2
{
mass 46.5e-27;
diameter 4.17e-10;
internalDegreesOfFreedom 2;
omega 0.74;
}
}

System folder:

controlDict – This describes the system and how it should be run. All functions were pre-defined (by grabbing file from the tutorial) as follows:

dsmcFields1{
type dsmcFields;
functionObjectLibs ( "libutilityFunctionObjects.so" );
enabled true;
outputControl outputTime;
}

fieldAverage1{
type fieldAverage;
functionObjectLibs ( "libfieldFunctionObjects.so" );
outputControl outputTime;
resetOnOutput off;
fields(
rhoN {mean on; prime2Mean off; base time;}
rhoM {mean on; prime2Mean off; base time;}
dsmcRhoN {mean on; prime2Mean off; base time;}
dsmcSigmaRcTMax {mean on; prime2Mean off; base time;} // I added
momentum {mean on; prime2Mean off; base time;}
linearKE{mean on; prime2Mean off; base time;}
internalE{mean on; prime2Mean off; base time;}
iDof{mean on; prime2Mean off; base time;}
q {mean on; prime2Mean off; base time;}
fD{mean on; prime2Mean off; base time;}
);
}

From dsmcFoam’s readme:
“Fields are used by dsmcFoam in several ways, some of which are different to their use elsewhere in OpenFOAM. None of these fields are solved by partial differential equations; they are used either to record simulation data, or to supply boundary data.”

1. Do I need to define anything for the fluid? Or is the fluid inherently defined? In the readme it says that the only fields that supply data to dsmcFoam are the boundaryT and boundaryU files. Thus, I have left all the other files above defining everything as “type calculated; value uniform 0;”. Is this okay?

2. In boundaryU, the velocity defined in internalField was (0 0 2). Does the 2 specify fluid traveling in the +z direction at 2 m/s?

3. In boundaryU I have defined the internalField, inlet and outlet as (0 0 2). Does this mean that I have told OpenFoam that there is fluid traveling through the inlet at 2 m/s initially, through the outlet at 2 m/s initially and through the system at 2 m/s at all times (where ‘at all times’ is defined through the internalField)?

4. In dsmcProperties, should numberDensities total to nEquivalentParticles?

5. In controlDict, what are these functions for? It looks like they define how things are output… but I’m unsure.

6. Are the following files in the system folder required for dsmcFoam? decomposeParDict, fvSchemes, fvSolution
hherbol is offline   Reply With Quote

Old   November 19, 2021, 02:52
Default
  #2
New Member
 
Tunc
Join Date: Nov 2021
Posts: 9
Rep Power: 5
tuncm18 is on a distinguished road
Thank you very much sir. Is it possible to determine the shock wave from the tutorials tho? I'd like learn about it.
tuncm18 is offline   Reply With Quote

Reply

Tags
dsmcfoam, tutorials


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
[ICEM] Hexa mesh, curve mesh setup, bunching law Anorky ANSYS Meshing & Geometry 4 November 12, 2014 01:27
Setup Cell Error in Fluent on Workbench tolu FLUENT 1 September 12, 2013 14:28
how can I Run axisymmetric flow using dsmcFoam ? mechy OpenFOAM 4 September 19, 2011 11:25
2D setup and 2D profile data file in CFX10 Se-Hee CFX 3 October 30, 2006 10:49
setup vof test problem Fang Jin FLUENT 1 June 14, 2005 09:27


All times are GMT -4. The time now is 10:35.