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   April 20, 2010, 19:50
Default
  #21
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 7
jiejie is on a distinguished road
Quote:
Originally Posted by su_junwei View Post
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
Hi JunWei

I updated gradU every time step as I have gradU in the data set for each time step. However, the there is no gradU stored in the lagrangian folder. As I have the position data and gradU field data, I want to use the particle position information to check the gradU stored in the lagrangain particle is correct.
jiejie is offline   Reply With Quote

Old   April 20, 2010, 23:05
Default
  #22
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
I cannot quite following you. Do you want to store the gradU at particle centers into the Lagrangian folder or gradU has been stored but the data was not correct.
If they was not stored, just add a new variable for your particle class and add this IO utility for it like other properties in particle class. The IO utility is implemented in the following function

1) constructor function like this

Foam::solidparticle::solidparticle
(
const Cloud<solidparticle>& cloud,
Istream& is,
bool readFields
)
2) readFields
3) writeFields
4) operator<<

If gradU has been written into lagrangian folder but not correct. I think they are not updated. Note that the volTensorField gradU you declare in your createFields.H is not the field of gradU in particle center. The first is the gradU in the patchcenters and cellCenters, whereas the second is the gradu in several discrete points.

regards, Junwei
su_junwei is offline   Reply With Quote

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

Sorry about the confusion. I tried to store the gradU at particle centers into the Lagrangian folder, but it only contains the fist particle.

I added the following lines in the constructor:

######################################
Foam::solidParticle::solidParticle
(
const Cloud<solidParticle>& cloud,
Istream& is,
bool readFields
)
:
Particle<solidParticle>(cloud, is, readFields)
{
if (readFields)
{
if (is.format() == IOstream::ASCII)
{
d_ = readScalar(is);
is >> U_;
//- ** velocity gradients
is >> gradU_;
}
else
{
is.read
(
reinterpret_cast<char*>(&d_),
//sizeof(d_) + sizeof(U_)

//- **velocity gradients
sizeof(d_) + sizeof(U_) + sizeof(gradU_)
);
}
}

// Check state of Istream
is.check("solidParticle::solidParticle(Istream&)") ;
}
#####################################

and I asked it to write out the gradU

####################################
void Foam::solidParticle::writeFields(const Cloud<solidParticle>& c)
{
Particle<solidParticle>::writeFields(c);

label np = c.size();

IOField<scalar> d(c.fieldIOobject("d", IOobject::NO_READ), np);
IOField<vector> U(c.fieldIOobject("U", IOobject::NO_READ), np);

//- **velocity gradients
IOField<tensor> gradU(c.fieldIOobject("gradU", IOobject::NO_READ), np);

label i = 0;
forAllConstIter(Cloud<solidParticle>, c, iter)
{
const solidParticle& p = iter();

d[i] = p.d_;
U[i] = p.U_;

//- **velocity gradients
gradU[i] = p.gradU_;

i++;
}

d.write();
U.write();

//- **velocity gradients
gradU.write();
}
####################################

in the lagrangain folder, gradU only contains:

FoamFile
{
version 2.0;
format ascii;
class tensorField;
location "101.3";
object gradU;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

1301{(0 0 0 0 0 0 0 0 0)}

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

Instead of having all zeros in 1301{(0 0 0 0 0 0 0 0 0 0)}, it should have the gradU for all 1301 particles. I have no problem with U.
jiejie is offline   Reply With Quote

Old   April 21, 2010, 01:19
Default
  #24
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 7
jiejie is on a distinguished road
Hi JunWei

I have attached my solidparticleIO.C here.

It looks like it counts the number of particles in the gradU in lagrangian folder, but all the gradU for each particle is not there.

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

Old   April 21, 2010, 05:02
Default
  #25
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
1301{(0 0 0 0 0 0 0 0 0 0)} means there are 1301 particles with the same value. tensor::zero. The possible reason is that the gradU of the particle location was not updated. The attachment you provided is right I think.
Regards, Junwei
su_junwei is offline   Reply With Quote

Old   April 22, 2010, 20:27
Default
  #26
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 7
jiejie is on a distinguished road
Hi JunWei

I am still looking at how to update the gradU for each of the particle and I came across couple question as follows:

1. if gradU has 1301{(0 0 0 0 0 0 0 0 0 0)} at each time step, it means all the gradU stored in the particles are zero?

2. In the particle.C:

template<class ParticleType>
00411 void Foam::Particle<ParticleType>::transformPosition(const tensor& T)
00412 {
00413 position_ = transform(T, position_);
00414 }

It says this transforms the physical properties of the particle.
But in parcel.C

void Foam:: parcel::transformProperties(const tensor& T)
00689 {
00690 U_ = transform(T, U_);
00691 }

It says this transforms the position and physical properties of the particle.
How come it uses the velocity U_ to transform the position of the particle and it use position_ to transform the position of the particle?

Thank you very much.

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

Old   April 24, 2010, 04:19
Default
  #27
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
1) if gradU has 1301{(0 0 0 0 0 0 0 0 0 0)} at each time step, it means all the gradU stored in the particles are zero?
Yes
2) transform can be used in rotation. T is rotational tensor.

Junwei
su_junwei is offline   Reply With Quote

Old   April 27, 2010, 01:39
Default
  #28
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 7
jiejie is on a distinguished road
figuring out how to update gradU.

Thanks for your time JunWei

Last edited by jiejie; April 28, 2010 at 02:30.
jiejie is offline   Reply With Quote

Old   May 10, 2010, 03:01
Default
  #29
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 7
jiejie is on a distinguished road
One quick question: if I need to do an inner product of a tensor "T" and a vector "a", should it be "T & a" instead of "a & T"?
jiejie is offline   Reply With Quote

Old   December 13, 2010, 15:34
Default How to find gradU from tauMC
  #30
Member
 
ehsan
Join Date: Mar 2009
Posts: 98
Rep Power: 8
ehsan is on a distinguished road
Dear All,

tauMC is calculated via:

volTensorField tauMC("tauMC",mu*dev2(fvc::grad(U)().T()));

Could someonhe help me to find gard(U) from tauMC (revers of above relation)

the notation gard(U)=tauMC/mu gives error.

Thanks
ehsan is offline   Reply With Quote

Old   January 26, 2011, 11:57
Default Further variables in lagrangian folder
  #31
Member
 
Franco Marra
Join Date: Mar 2009
Location: Napoli - Italy
Posts: 52
Rep Power: 8
francescomarra is on a distinguished road
Dear All,

After running dieselFoam, I would be like to observe further properties of the lagrangian field, as the Weber number of each particle, similarly to the way the diameter d or the density rho of each particle is reported in the lagrangian folder at each time step. However I am a newbe with C++ and I do not understand how I can adopt the function We available in the parcelFunctions.C to compute and store this quantity for each particle. Is this a simple task or does it require a long coding effort ?
Any help will be very gratefully appreciated.

Thank you in advance,

Franco
francescomarra 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 12:11.