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

access to velocity gradient for Lagrangian particles

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

Like Tree1Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   March 31, 2010, 19:28
Default access to velocity gradient for Lagrangian particles
  #1
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 119
Rep Power: 7
jiejie is on a distinguished road
Dear all

I am kind of get stuck at finding the velocity gradient at a particular position for the Lagrangian particle dynamics. My question is how I should calculate the velocity gradient if I have the velocity vector "U_". Is there some utility like "curl" that I can use to calculate it?

Thank you very much.
jiejie is offline   Reply With Quote

Old   April 1, 2010, 14:30
Default
  #2
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Hi jie
It seems not. And it seems that the gradient is only reasonable for a Euler field. A possible way is calculating the gradient from an Eulerian field converted from particle lagrangian velocity field
Junwei
su_junwei is offline   Reply With Quote

Old   April 1, 2010, 21:33
Default
  #3
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 119
Rep Power: 7
jiejie is on a distinguished road
Quote:
Originally Posted by su_junwei View Post
Hi jie
It seems not. And it seems that the gradient is only reasonable for a Euler field. A possible way is calculating the gradient from an Eulerian field converted from particle lagrangian velocity field
Junwei
Yes I am trying to get the gradient for Euler Field and use it to calculate the particle movement. Do you have any idea how to calculate the Euler field gradient?
jiejie is offline   Reply With Quote

Old   April 1, 2010, 23:05
Default
  #4
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Oh sorry.

I am confused last night. Just use fvc::grad(U_) and make an interpolation on the particle location like this

volTensorField gradU=fvc::grad(U_);
autoPtr<interpolation<tensor> >gradUInterpolator_ =
interpolation<tensor>::New(interpolationSchemes, gradU);
//interpolationSchemes is a word for assigning interpolation schemes("cell", "cellPoint" or "cellPointFace")

tensor gradUatPoint = gradUInterpolator->interpolate(ball.position(), ball.cell());

If the gradient vary little across the space, interpolation can be neglected, and use the gradient at the cell center to represent the gradient at the particle location. In this situation, just use the following code
tensor gradUatPoint =gradU[ball.cell()];
ball is the particle defined in OpenFOAM.

Hope this helps

regards, Junwei Su
su_junwei is offline   Reply With Quote

Old   April 6, 2010, 08:54
Default Sampling tool for Lagrangian Particles
  #5
New Member
 
sankarv
Join Date: Feb 2010
Posts: 26
Rep Power: 7
sankarv is on a distinguished road
Dear su_junwei

Is there a sampling tool for Lagrangian particles ? i.e, I would
like to collect particle statistics such as mean particle size, mean
particle velocity etc., at an arbitrary surface inside the domain
DURING the simulation ?

I saw from another post that there is an utility called
functionObject for doing this for Eulerian fields. I am looking for the
lagrangian particles.

Please let me know

Thanks
Vaidya
sankarv is offline   Reply With Quote

Old   April 6, 2010, 09:31
Default
  #6
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Hi Vaidya

I don't think there is a tool in OpenFOAM which can sample particles on a arbitrary surface in the solution domain. I didn't find one. Actually, at a certain time point, there may be no particles hitting the surface concerned exactly. If you want to get a distribution(of particle size, velocity, etc) on a certain plane, I think you'd better make a conversion from Lagrangian field to Eulerian field and then use the sampling tool in OpenFOAM.

The sample utility in OpenFOAM is located at
../OpenFOAM/OpenFOAM-1.6/src/sampling

Regards, Junwei
su_junwei is offline   Reply With Quote

Old   April 6, 2010, 10:01
Default
  #7
New Member
 
sankarv
Join Date: Feb 2010
Posts: 26
Rep Power: 7
sankarv is on a distinguished road
Thanks Su-junwei. I will keep looking. Hopefully the developers Hrvoje Jasak or Henry Weller might have some idea. But unfortunately no body else seems to know

Thanks
Vaidya
sankarv is offline   Reply With Quote

Old   April 6, 2010, 22:00
Default
  #8
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 119
Rep Power: 7
jiejie is on a distinguished road
Quote:
Originally Posted by su_junwei View Post
Oh sorry.

volTensorField gradU=fvc::grad(U_);
autoPtr<interpolation<tensor> >gradUInterpolator_ =
interpolation<tensor>::New(interpolationSchemes, gradU);
//interpolationSchemes is a word for assigning interpolation schemes("cell", "cellPoint" or "cellPointFace")

tensor gradUatPoint = gradUInterpolator->interpolate(ball.position(), ball.cell());
Hi JunWei

I am sorry about the confusion caused, the "U_" is the parcel velocity and it is a vector but not a vector field. Hence, I got some error complaining about "volTensorField gradU=fvc::grad(U_);"

I assume that maybe I could calculate the velocity gradient with the velocity filed U and interpolate the velocity gradient at the parcel position.

Thanks a lot

Last edited by jiejie; April 6, 2010 at 22:24.
jiejie is offline   Reply With Quote

Old   April 6, 2010, 22:48
Default
  #9
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Hi Jie
What force do you want to calculate for a particle, I haven't encountered a force for granular flow. Are you trying to implement a meshless method?
I usually make a conversion from the lagrangian field to euler field when calculating the Euler properties of granular fields.
If you don't want a conversion, you can search all the particles around the particle concerned, calculate the gradient and do a average. This is common in meshless method, the formulation can be found in text book about meshless method.

Regards, Junwei
su_junwei is offline   Reply With Quote

Old   April 6, 2010, 23:55
Default
  #10
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 119
Rep Power: 7
jiejie is on a distinguished road
Hi JunWei

I am trying to calculate the drag and lift force acting on the particle so that I need the velocity gradients from the Eulerian field at the position of the particle.

I will try to create a volVectorField GradU that contains all the velocity gradients and interpolate them on to the position of the particle.

One quick question about the createFields.H:

Info << "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

It creates and initialises the volVectorField U and U is calculated from other mechanisms, right?

So I can just do the followings to create GradU?

Info << "Reading field GradU\n" << endl;
volVectorField GradU
(
IOobject
(
"GardU",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

However, there are 9 components of the velocity gradients. Should I create and initialise each of them as GradU1, GradU2 and etc?

Or should I use the "voltensorFields"?

volTensorField gradU(fvc::grad(U));

I am pretty new to OpenFOAM so I am still learning myself.

Thanks

Last edited by jiejie; April 7, 2010 at 00:22.
jiejie is offline   Reply With Quote

Old   April 7, 2010, 00:29
Default
  #11
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Quote:
Originally Posted by jiejie View Post
Hi JunWei

volVectorField GradU
(
IOobject
(
"GardU",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

Thanks

Hi Jie

you can do it like the following code (you don't have to initialize it using the file)

volTensorField GradU
(
IOobject
(
"GardU",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
fvc::grad(U)
);

PS: Don't forget recalculate gradU before using it.

Regards,Junwei
su_junwei is offline   Reply With Quote

Old   April 7, 2010, 00:40
Default
  #12
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 119
Rep Power: 7
jiejie is on a distinguished road
That means at each point of the tensor field of GradU, it should have 9 velocity gradient components as GradU.xx(), GradU.xy(), GradU.xz() ...?
jiejie is offline   Reply With Quote

Old   April 7, 2010, 01:10
Default
  #13
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
exactly

Junwei
su_junwei is offline   Reply With Quote

Old   April 8, 2010, 22:44
Default
  #14
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 119
Rep Power: 7
jiejie is on a distinguished road
Hi JunWei

I managed to get gradU calculated and updated during the simulation. However, I have problem to access gradU. All my particle dynamics is defined in a file called "mySolidParticle.C". It gives some error of "mySolidParticle.C:83: error: ‘gradU’ was not declared in this scope" when I tried to compile my solver after I added in the following code:

autoPtr<interpolation<tensor> >gradUInterpolator_ =
interpolation<tensor>::New(cell, gradU);

How should I access the tensor field gradU other than the main "SOLVER.C" (SOLVER.C contains the main mechanism for solver)?

Thank you
jiejie is offline   Reply With Quote

Old   April 9, 2010, 23:49
Default
  #15
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Hi Jie
You don't have to declare the gradU in createField.H. You just get the value where you use it. In your case, declare it before the interpolator for instance like this

volTensorField gradU=fvc::grad(U_);
autoPtr<interpolation<tensor> >gradUInterpolator_ =
interpolation<tensor>::New(cell, gradU);

If you U_ is not accessible. you can lookup it through ObjectRegistry using the the function
const volVectorField &U=[db or simular, you can get ObjectRegistry].lookupObject<volVectorField>("U");
you can also lookup gradU, if it is declared elsewhere createFields.H for instance.
const volTensorField & gradU=[db...].lookupObject<volTensorField>("gradU");

Regards, Junwei
su_junwei is offline   Reply With Quote

Old   April 10, 2010, 00:34
Default
  #16
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 119
Rep Power: 7
jiejie is on a distinguished road
Thanks JunWei

I will give the lookup it through ObjectRegistry a try.
jiejie is offline   Reply With Quote

Old   April 20, 2010, 01:49
Default
  #17
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 119
Rep Power: 7
jiejie is on a distinguished road
Hi JunWei

Now I am trying to write out the gradU for each particle. So I add "gradU.write();" in the "solidparticleIO.C". This should create a file at /xxx/lagrangian/defaultCloud/gradU where xxx is the time step at which OpenFOAM output the data.

At /xxx/lagrangian/defaultCloud/, there are files of d, positions, U, gradU where d is the diameter of the particles, position is the locations of the particles, U is the velocity at the location of the particles, gradU should be the velocity gradients at the location of the particles.

In my d and U fields, they contain the corresponding information of all the particles in the flow field. However, it only contains the velocity gradients information for one particle at the location where it releases the particle in the flow field in gradU.

Would you have any idea about this?
jiejie is offline   Reply With Quote

Old   April 20, 2010, 08:58
Default how to set correct mass flow rate for lagrangian particles ?
  #18
New Member
 
sankarv
Join Date: Feb 2010
Posts: 26
Rep Power: 7
sankarv is on a distinguished road
Dear Junwei

I am running a simulation where a simple nozzle is injecting compressible gas + solid particles jet into an open atmosphere. I am using OF 1.6.x

I know the mass flow rate of the particles, density of the particles and the particle diameter distribution from the experiments.

I am using the patchInjection option to inject particles from the inlet patch. The code works without a problem

But I am not quite sure how to set the mass flow rate of the particles correctly in the kinematicCloud1Properties file

My simple question is this:

Can you please tell me what is the relationship between
parcelsPerSecond, massTotal, volumeflowRate, SOI and duration ?

Please help me

Thanks
Vaidya
sankarv is offline   Reply With Quote

Old   April 20, 2010, 11:33
Default
  #19
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Quote:
Originally Posted by jiejie View Post
Hi JunWei

In my d and U fields, they contain the corresponding information of all the particles in the flow field. However, it only contains the velocity gradients information for one particle at the location where it releases the particle in the flow field in gradU.

Would you have any idea about this?
Perhaps. you forgot to update gradU every time step. Just recalculate gradU every time step. add the following line to time loop
gradU=fvc::grad(U) ;

regards,Junwei
su_junwei is offline   Reply With Quote

Old   April 20, 2010, 12:00
Default
  #20
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Quote:
Originally Posted by sankarv View Post
Dear Junwei
Can you please tell me what is the relationship between
parcelsPerSecond, massTotal, volumeflowRate, SOI and duration ?

Please help me

Thanks
Vaidya
Hi Vaidya
The meaning of these keywords may be

parcelsPerSecond: The total number of particles should be injected a second after start starttime of Injection(SOI)

massTotal: the total mass of particles should be injected between SOI and SOI+duration.

volumeFlowRate: the total volume of the particles should be injected a second after SOI

SOI: start of injection

duration: The injection time segment. Injecting particle from SOI to SOI+duration

regards,Junwei
calim_cfd likes this.
su_junwei is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finely dispersed particles in predetermined velocity field BrainDebugger STAR-CCM+ 1 May 14, 2014 06:32
Velocity gradient on Symmetry Boundary prikeyma FLUENT 2 September 2, 2011 06:16
axial velocity in bend pipe with adverse pressure gradient liguifan OpenFOAM 0 July 24, 2011 05:56
Velocity gradient Stephen Main CFD Forum 0 April 7, 2003 10:28
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11


All times are GMT -4. The time now is 03:30.