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

[swak4Foam] No particles inserted with groovyBC when using dsmcFOAM

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 4, 2013, 11:19
Default No particles inserted with groovyBC when using dsmcFOAM
  #1
New Member
 
Tobias Fuchs-Martschitz
Join Date: Oct 2013
Posts: 3
Rep Power: 12
Tobias1990 is on a distinguished road
Hi,

I am trying to run a case where I define a linear velocity gradient on the inlet and outlet, so for example have the velocity at y=0 be 10 and at y=ymax be 100. I am trying to use groovy bc for this. The code runs, but I dont get any particles inserted at my inlet or outlet. My number of equivalent particles is low enough that for a system not using groovyBC I get 150,000 particles. Does anyone know what the problem is?

Here is my code:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object boundaryU;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [ 0 1 -1 0 0 0 0 ];

internalField uniform ( 0 0 0 );

boundaryField
{


outLet
{
type groovyBC;
value uniform (0 0 0);
variables "yp=pts().y;minY=min(yp);maxY=max(yp);wallV=10;str eamV=100;height=pos().y;grad=(steamV-wallV)/(maxY-minY)";
valueExpression "(wallV+grad*height)*normal()";
}

inLet
{
type groovyBC;
value uniform (0 0 0);
variables "yp=pts().y;minY=min(yp);maxY=max(yp);wallV=10;str eamV=100;height=pos().y;grad=(steamV-wallV)/(maxY-minY)";
valueExpression "(wallV+grad*height)*normal()";
}
front
{
type cyclic;
}
back
{
type cyclic;
}
surface
{
type fixedValue;
value uniform (0 0 0);
}
sphere
{
type fixedValue;
value uniform (0 0 0);
}
top
{
type fixedValue;
value uniform (0 0 0);
}

}


// ************************************************** *********************** //


Id be very grateful for any help!

Kind Regards,
Tobias
Tobias1990 is offline   Reply With Quote

Old   December 4, 2013, 14:07
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Tobias1990 View Post
Hi,

I am trying to run a case where I define a linear velocity gradient on the inlet and outlet, so for example have the velocity at y=0 be 10 and at y=ymax be 100. I am trying to use groovy bc for this. The code runs, but I dont get any particles inserted at my inlet or outlet. My number of equivalent particles is low enough that for a system not using groovyBC I get 150,000 particles. Does anyone know what the problem is?

Here is my code:

outLet
{
type groovyBC;
value uniform (0 0 0);
variables "yp=pts().y;minY=min(yp);maxY=max(yp);wallV=10;str eamV=100;height=pos().y;grad=(steamV-wallV)/(maxY-minY)";
valueExpression "(wallV+grad*height)*normal()";
}

inLet
{
type groovyBC;
value uniform (0 0 0);
variables "yp=pts().y;minY=min(yp);maxY=max(yp);wallV=10;str eamV=100;height=pos().y;grad=(steamV-wallV)/(maxY-minY)";
valueExpression "(wallV+grad*height)*normal()";
}


Id be very grateful for any help!

Kind Regards,
Tobias
OK. There is a lot of information missing without which it is hard to help you:

- which solver are you using: I guess it is one with lagrangian particles
- how are you injecting the particles: my guess is on the patch

The problem is IMHO not groovyBC but that you're using it wrong and did not check the velocities that you implemented with it.

At a first glance the two BCs look suspiciously similar: not even a sign is different. Haven't looked it through, but seems to me that the expression before normal() in the valueExpressions is always positive. If I'm not mistaken normal() always points out of the geometry. So you set patches where flow goes out. If you inject particles there, where might they go? Hmm …
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   December 5, 2013, 06:05
Default
  #3
New Member
 
Tobias Fuchs-Martschitz
Join Date: Oct 2013
Posts: 3
Rep Power: 12
Tobias1990 is on a distinguished road
Quote:
Originally Posted by gschaider View Post
OK. There is a lot of information missing without which it is hard to help you:

- which solver are you using: I guess it is one with lagrangian particles
- how are you injecting the particles: my guess is on the patch

The problem is IMHO not groovyBC but that you're using it wrong and did not check the velocities that you implemented with it.

At a first glance the two BCs look suspiciously similar: not even a sign is different. Haven't looked it through, but seems to me that the expression before normal() in the valueExpressions is always positive. If I'm not mistaken normal() always points out of the geometry. So you set patches where flow goes out. If you inject particles there, where might they go? Hmm …
I am sorry for not giving enough information. I am new to this forum and openFoam, so sometimes I forget what is relevant

To give you more information:
I am running dsmcFOAM, which creates a "lagrangian" and "uniform" in my /0/ directory. So i guess it is a Lagrangian solver.
Yes, you are correct, I am injecting them on the patch.

Yes the two boundaries are the same. I wanted to impose the same velocity gradient in the inlet and the outlet. I have now changed the inlet boundary condition to point INTO the geometry, by adding a negative sign. When running it this way, I dont get any particles injected either. When initialising the system with particles, they slowly start to dissipate through both patches. I have tried running example cases listed here: http://openfoamwiki.net/index.php/Contrib/groovyBC

,where the simplest one should be the one with a parabolic inlet condition that pulsates:
inlet { type groovyBC; variables "yp=pts().y;minY=min(yp);maxY=max(yp);para=-(maxY-pos().y)*(pos().y-minY)/(0.25*pow(maxY-minY,2))*normal();"; valueExpression "10*(1+0.5*sin(500*time()))*para"; value uniform (10 0 0); } outlet { type groovyBC; valueExpression "vector(0,0,0)"; gradientExpression "vector(0,0,0)"; fractionExpression "(phi > 0) ? 0 : 1"; value uniform (0 0 0); } These unfortunately don't insert any particles either. I wanted to try and condense my problem to a few questions to make it easier to answer:

1. Am I missing an essential component here for inserting particles? I have looked through the forums, but haven't found any information regarding this.
2. If the inlet/outlet BC's are say both say 10m/s at a certain height, pointing in the same direction, (inlet points into geometry, outlet points out of geometry), would this have been the correct definition? So far I have been using it this way.
3. Is there any more information I you would need to identify the problem?
4. I have defined the rest of my boundary files for the inlet and outlet just as I would for a regular inlet/outlet. (I believe this is zerogradient for all boundary files, apart from temperature, which I set to be 300K and for the pointlevel, which is set as calculated). Do I need to define these as groovyBC as well?

Thank you very much for any help! Its really appreciated!

Tobias
Tobias1990 is offline   Reply With Quote

Old   December 5, 2013, 06:08
Default
  #4
New Member
 
Tobias Fuchs-Martschitz
Join Date: Oct 2013
Posts: 3
Rep Power: 12
Tobias1990 is on a distinguished road
Quote:
Originally Posted by Tobias1990 View Post
I am sorry for not giving enough information. I am new to this forum and openFoam, so sometimes I forget what is relevant

To give you more information:
I am running dsmcFOAM, which creates a "lagrangian" and "uniform" in my /0/ directory. So i guess it is a Lagrangian solver.
Yes, you are correct, I am injecting them on the patch.

Yes the two boundaries are the same. I wanted to impose the same velocity gradient in the inlet and the outlet. I have now changed the inlet boundary condition to point INTO the geometry, by adding a negative sign. When running it this way, I dont get any particles injected either. When initialising the system with particles, they slowly start to dissipate through both patches. I have tried running example cases listed here: http://openfoamwiki.net/index.php/Contrib/groovyBC

,where the simplest one should be the one with a parabolic inlet condition that pulsates:
inlet { type groovyBC; variables "yp=pts().y;minY=min(yp);maxY=max(yp);para=-(maxY-pos().y)*(pos().y-minY)/(0.25*pow(maxY-minY,2))*normal();"; valueExpression "10*(1+0.5*sin(500*time()))*para"; value uniform (10 0 0); } outlet { type groovyBC; valueExpression "vector(0,0,0)"; gradientExpression "vector(0,0,0)"; fractionExpression "(phi > 0) ? 0 : 1"; value uniform (0 0 0); } These unfortunately don't insert any particles either. I wanted to try and condense my problem to a few questions to make it easier to answer:

1. Am I missing an essential component here for inserting particles? I have looked through the forums, but haven't found any information regarding this.
2. If the inlet/outlet BC's are say both say 10m/s at a certain height, pointing in the same direction, (inlet points into geometry, outlet points out of geometry), would this have been the correct definition? So far I have been using it this way.
3. Is there any more information I you would need to identify the problem?
4. I have defined the rest of my boundary files for the inlet and outlet just as I would for a regular inlet/outlet. (I believe this is zerogradient for all boundary files, apart from temperature, which I set to be 300K and for the pointlevel, which is set as calculated). Do I need to define these as groovyBC as well?

Thank you very much for any help! Its really appreciated!

Tobias
I found the problem! I had set the boundary entry for inlet/outlet as "groovyBC" instead of "boundary". Now I just hope the boundary is correct thank you for your help!
Tobias1990 is offline   Reply With Quote

Old   December 5, 2013, 12:46
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Tobias1990 View Post
I found the problem! I had set the boundary entry for inlet/outlet as "groovyBC" instead of "boundary". Now I just hope the boundary is correct thank you for your help!
Don't understand. But if it works: great
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Tags
dsmcfoam openfoam, groovybc

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
dsmcFoam setup hherbol OpenFOAM Pre-Processing 1 November 19, 2021 02:52
[swak4Foam] Change in alpha and U with groovyBC in twoPhaseEulerFoam dani2702 OpenFOAM Community Contributions 0 November 17, 2016 04:30
dsmcFoam - micro-hole limiting the number of dsmc particles Araist OpenFOAM Running, Solving & CFD 0 June 25, 2015 07:50
dsmcFoam charged particles latvietis OpenFOAM 0 October 15, 2012 11:26
Per face tracking of particles that left and entered the cell in dsmcFoam sor OpenFOAM Programming & Development 1 August 28, 2012 06:35


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