Lagrangian data - particle velocity post processing
Hi everyone,
i am doing LES and i just added lagrangian particles to pimpleFoam (openfoam 7). But now i am struggeling with the post processing, which isn't as easy as I thought/expected.:confused: :( I am able to see the lagrangian data in paraView. But i have no idea how to sample the particle velocity to get (for example) an axial particle velocity profile. Additionally i need the average of the particle velocity, what could be done easily in the controlDict if i have a field. So what i need is a field of the particle velocity with that i am able to create the time average. In the Cloudfunction "VoidFraction" (VoidFraction.C) there is lagrangian data "written in a field" i guess. --> theta[p.cell()] += dt*p.nParticle()*p.volume(); So i have tried to do it the same way and edit the VoidFraction cloudfunction with this or something similar --> Uparticle[p.cell()] += dt*mag(p.U()); but this didnt work properly. The solver compiles but the magnitude of the velocity of the created field is much too high (about 10⁹). I think there is something wrong in the transfer of the "point" velocity to the "cell" velocity. Does anyone have any idea how this could work? I'm not sure this is the right way. Maybe someone has a better idea to sample the particle velocity at any position? Is there an existing CloudFunction which can be used for that? Thanks in advance |
Have you tried using 'calculate' to acquire p.U(component) and 'integrate variables' in ParaView?
|
Quote:
I created a new vector field 'UPar' in the file KinematicCloudI.H similar to the given scalar field 'theta'. Additionally i created a scalar field of the particles sum 'SumPar' (=parcels sum). I need this field because it is possible that one cell contains more than one particle and then the averaged velocity is calculated. Code:
template<class CloudType> Code:
This solution seems to be very good for my investigations. Nevertheless, if you have suggestions for improvement, I would be happy if you share them. :) |
Quote:
This is very helpful, may I ask where did you put the second code in pimpleLPT.C? I added it below the "parcels.evolve" within the runTime.run loop and it didn't work. Thanks, RIck |
Hi Rick,
I put it in the same place. Within the runtime loop and outside the pimple loop. Maybe you can try it without the temporary fields and the particle sum in a first step. Just add a velocity vectorfield "UPar2" in the createFieldsDict and then add this below the .evolve in your pimpleLPT.C file: Code:
UPar2 = kinematicCloud.UPar(); |
Quote:
Yes I think the code in .C file is fine but I still haven't figured out where the problems are, could you post your createFields.H? It would be very appreciated. Cheers, Rick |
1 Attachment(s)
I think I should post my error message here:
|
It could be the name of your Cloud (.evolve)
The name of my kinematicCloud is kinematicCloud. This is my evolve in the .C file: Code:
kinematicCloud.evolve(); Code:
const word kinematicCloudName |
Quote:
Thank you it successfully compiled. However I tested it with some cases it ended up like another error, it's like there are problems in dimension:, and my createFields.H is of attachment.:( Cheers, Rick |
1 Attachment(s)
Sorry, I forgot to attach the image, there is it.
|
After I correct some minor syntax mistakes and make some declaration in source code files, now it works perfectly now.
Thank you Kevin:) |
1 Attachment(s)
Dear Cheung Wing Ki
I also tried to create a scalar field of the particles sum (particle number per unit volume) I followed Kevin's codes and tried to compile kinematicCloudI.H Code:
template<class CloudType> KinematicCloud.H Code:
inline const tmp<volScalarField> rhoEff() const; intL4Foam.C: In function ‘int main(int, char**)’: intL4Foam.C:188:9: error: ‘SumPar’ was not declared in this scope SumPar = kinematicCloud.SumPar(); ^~~~~~ intL4Foam.C:188:33: error: ‘Foam::basicKinematicCollidingCloud {aka class Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cl oud<Foam::CollidingParcel<Foam::KinematicParcel<Fo am::particle> > > > >}’ has no member named ‘SumPar’ SumPar = kinematicCloud.SumPar(); ^~~~~~ Does anybody can help me? Thank you |
1 Attachment(s)
I tried to get particle density output per volume
Add code in kinematicCloud.H, kinematicCloudI.H, main.C file and createFields.H And got following error messages.. Anybody please can help me? Thank you |
All times are GMT -4. The time now is 03:21. |