CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Lagrangian Particles (https://www.cfd-online.com/Forums/openfoam/74837-lagrangian-particles.html)

forsumit April 9, 2010 12:25

Lagrangian Particles
 
1 Attachment(s)
Dear Fomers,

I have been trying to use the following tutorial for my case, where I am trying to track particles in grit chamber feeding system

http://www.tfd.chalmers.se/~hani/kur...m_reviewed.pdf

I have also attached the picture, the problem is that the simulation just stops after 12 seconds.

Initially I did not implement all the changes but when things did not work with injecting one particle every time step, I decided to implement the improvement suggested in Chap-5 of the tutorial, but I am getting stuck at the last step of 5.2 in the tutorial and my error is "transportProperties was not declared in this scope"

Can any one suggest me some thing?

Thanks,
Sumit

foamWang April 29, 2010 14:48

solution?
 
Hi Sumit,

Did you solve this problem?
I met the exactly the same one.

Please comment.

Thanks.

Roro

Quote:

Originally Posted by forsumit (Post 253974)
Dear Fomers,

I have been trying to use the following tutorial for my case, where I am trying to track particles in grit chamber feeding system

http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2009/AureliaVallier/Tutorial_icoLagrangianFoam_reviewed.pdf

I have also attached the picture, the problem is that the simulation just stops after 12 seconds.

Initially I did not implement all the changes but when things did not work with injecting one particle every time step, I decided to implement the improvement suggested in Chap-5 of the tutorial, but I am getting stuck at the last step of 5.2 in the tutorial and my error is "transportProperties was not declared in this scope"

Can any one suggest me some thing?

Thanks,
Sumit


forsumit April 29, 2010 15:10

Hello Roro,

Unfortunately I did not, I got busy with some other work.

But if both of us are having the same problem may be we need to tinker with the code, or else may be both of us are doing some thing identically wrong :)

If you come to find out some thing kindly let me know, may be we should make some noise and some one who has more experience with this solver will help us in resolving the problem.

Cheers,
Sumit

foamWang April 29, 2010 15:24

Solved
 
Hi Sumit,

I got the answer from others. ( :) thanks Alberto)

In createFields.H, declare transportProperties object before the two added commands like this:

IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
scalar rho(readScalar(transportProperties.lookup("rho"))) ; //add
scalar mu(readScalar(transportProperties.lookup("mu"))); //add

I still met other errors, but would like to explore by myself first preassuming you dont have. Let's come back later.

Thanks.

Roro

Quote:

Originally Posted by forsumit (Post 256918)
Hello Roro,

Unfortunately I did not, I got busy with some other work.

But if both of us are having the same problem may be we need to tinker with the code, or else may be both of us are doing some thing identically wrong :)

If you come to find out some thing kindly let me know, may be we should make some noise and some one who has more experience with this solver will help us in resolving the problem.

Cheers,
Sumit


foamWang April 29, 2010 16:26

some addition
 
Hi,

I also change in createParticle.H
from
IncompressibleCloud cloud(vpi,U)
to
IncompressibleCloud cloud(vpi,U, rho, mu)

error message for googling:

IncompressibleCloudI.H:85: error: ‘Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::IncompressibleCloud::volFrac() const’ is private

forsumit April 30, 2010 17:01

Thanks
 
Hey Roro,

I am going to implement the changes and see how it goes.

Thanks a lot.

Sumit

forsumit May 1, 2010 12:26

Hey Roro,

Just wanted to confirm some thing, when you started working with icoLagrangianFoam incorporated in PISO frame for turbulence. Did your simulation also stop after a while??

This was my initial problem. The bad part is that the simulation keeps on going for some time and then it just hangs without any messages, hence no way of knowing (at least for me) where to start the debugging procedure.

After which, I thought of incorporating the modification in the code as suggested in the tutorial. I am not sure if this is the right way to go. I also want to ask after incorporating the modification what input files would we need to run the new pisoLagrangianFoam.

Thanks,
Sumit

foamWang May 12, 2010 14:55

Hi Sumit,

Sorry for late reply. I just realized you replied my post.

Honestly, I keep updating the code and cannot remember all the places I changed. I should learn some systematic way to debug.

Anyway, I don't have problem on turbulence modeling.
I suggest you use pisofoam to finish a single phase run with similar boundary conditions first (with the same turbulence model. I am using dynamic mixed Smagorinsky, which was the best one I discovered so far.).

Thanks.

Roro



Quote:

Originally Posted by forsumit (Post 257133)
Hey Roro,

Just wanted to confirm some thing, when you started working with icoLagrangianFoam incorporated in PISO frame for turbulence. Did your simulation also stop after a while??

This was my initial problem. The bad part is that the simulation keeps on going for some time and then it just hangs without any messages, hence no way of knowing (at least for me) where to start the debugging procedure.

After which, I thought of incorporating the modification in the code as suggested in the tutorial. I am not sure if this is the right way to go. I also want to ask after incorporating the modification what input files would we need to run the new pisoLagrangianFoam.

Thanks,
Sumit


forsumit May 12, 2010 16:10

Hey Roro,

I just wanted to let you know that, I am using Piso foam and I was able to run the simulation without any particles. It's just that when the particles come in picture I have troubles.

Especially as I said the model just hangs without giving me any messages, If it diverges or does some thing I can still think about things to do. But, when there is no error messages it become tricky.

Thanks,
Sumit

foamWang May 12, 2010 16:18

Sorry.

Could you give me more details about ḧangs¨?
I dont quite understand.

Thanks.

Roro

Quote:

Originally Posted by forsumit (Post 258543)
Hey Roro,

I just wanted to let you know that, I am using Piso foam and I was able to run the simulation without any particles. It's just that when the particles come in picture I have troubles.

Especially as I said the model just hangs without giving me any messages, If it diverges or does some thing I can still think about things to do. But, when there is no error messages it become tricky.

Thanks,
Sumit


forsumit May 12, 2010 17:08

That is the whole problem Roro, when I say hangs what I mean is that the simulation stops after 12 seconds and message in out file is "trying to move the particles" and nothing else.
You can see the plot that I presented in the beginning of this thread

foamWang May 12, 2010 17:19

One thing I would suggest is
change in HardBallParticle.C from
updateProperties(deltaT,data,cellI,face());
to
updateProperties(dt,data,cellI,face()); //RQ Wang edited

You may change other things in the function of move.
I guess the problem is in that class.

Pls let me know whether the problem is solved or other issue arises.

Thanks.

Roro



Quote:

Originally Posted by forsumit (Post 258552)
That is the whole problem Roro, when I say hangs what I mean is that the simulation stops after 12 seconds and message in out file is "trying to move the particles" and nothing else.
You can see the plot that I presented in the beginning of this thread


forsumit May 12, 2010 18:41

Thanks a lot Roro, I will let you know how it goes, Let me ask you some thing else meanwhile. As far as my limited experience with openFOAM is concerned I think I am at stage where I am able to run things and make minor modifications based on some tutorial .

Let me ask you what has been your strategy in getting a handle around the umpteen number of solvers and other things that the software offers.

Thanks,
Sumit

forsumit May 12, 2010 21:58

Hey Roro,

This is how the simulation hangs.

Time = 11.8

Courant Number mean: 0.0125869 max: 0.235498
Moving Particles
26 Particles moved. 0 walls hit. 0 particles left the model.
I am at the end of evolve
DILUPBiCG: Solving for Ux, Initial residual = 0.000120558, Final residual = 2.27526e-07, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 0.000212698, Final residual = 2.95205e-07, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 0.000378498, Final residual = 5.44318e-07, No Iterations 1
DICPCG: Solving for p, Initial residual = 0.00106836, Final residual = 9.31466e-05, No Iterations 5
DICPCG: Solving for p, Initial residual = 0.000165794, Final residual = 1.60982e-05, No Iterations 58
time step continuity errors : sum local = 1.44282e-09, global = -1.43116e-11, cumulative = 3.05453e-05
DICPCG: Solving for p, Initial residual = 7.84517e-05, Final residual = 7.70299e-06, No Iterations 49
DICPCG: Solving for p, Initial residual = 2.40704e-05, Final residual = 2.36162e-06, No Iterations 429
time step continuity errors : sum local = 2.11662e-10, global = -6.05362e-12, cumulative = 3.05453e-05
DILUPBiCG: Solving for epsilon, Initial residual = 0.000173315, Final residual = 4.12178e-07, No Iterations 1
DILUPBiCG: Solving for k, Initial residual = 0.000339063, Final residual = 4.69541e-07, No Iterations 1
ExecutionTime = 10425.3 s ClockTime = 10494 s

Time = 11.81

Courant Number mean: 0.0125872 max: 0.235497
Moving Particles



As you can see, Courant numbers and other residual is under control but the simulation doesn't go beyond this and I don't see any thing else in the error file. Please let me know if you have any idea

Thanks,
Sumit

foamWang May 12, 2010 23:13

Hi Sumit,

It is very glad to share experience with others.
Doing research often means exploring alone.
I am very happy to see somebody is accompanying.

My strategy is usually like this:

OMG! some thing wrong!
First, dump a couple of lines in source code like

Info << "RoRo is stuck 1" << endl;
Info << "RoRo is stuck 2" << endl;

Run it again...
Depending on output, you may narrow your error to some specific lines.

Run again with more Info lines until you can target a specific command or class.

Guess what the code means and modify tentatively.

Most time it's a frustrating process. It looks like a detective novel.
Solve the mystery one by one.

If too blue, find the boss or some guy online to talk. Get idea. Test until you are good.

Believe all the things are worthwhile. Don't give up easily.

I am just first year phd student. A lot of things to learn. Hope we can become friends along the road.
-----------------------------------------

On the issue of the Moving particle. I suggest you to target the specific lines. Your info line may be in a loop running repeatedly forever.

If you can show where you are stuck in the source code, it's much easier to solve the problem. At least we have more information to solve.

Thanks.
Roro




Quote:

Originally Posted by forsumit (Post 258581)
Hey Roro,

This is how the simulation hangs.

Time = 11.8

Courant Number mean: 0.0125869 max: 0.235498
Moving Particles
26 Particles moved. 0 walls hit. 0 particles left the model.
I am at the end of evolve
DILUPBiCG: Solving for Ux, Initial residual = 0.000120558, Final residual = 2.27526e-07, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 0.000212698, Final residual = 2.95205e-07, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 0.000378498, Final residual = 5.44318e-07, No Iterations 1
DICPCG: Solving for p, Initial residual = 0.00106836, Final residual = 9.31466e-05, No Iterations 5
DICPCG: Solving for p, Initial residual = 0.000165794, Final residual = 1.60982e-05, No Iterations 58
time step continuity errors : sum local = 1.44282e-09, global = -1.43116e-11, cumulative = 3.05453e-05
DICPCG: Solving for p, Initial residual = 7.84517e-05, Final residual = 7.70299e-06, No Iterations 49
DICPCG: Solving for p, Initial residual = 2.40704e-05, Final residual = 2.36162e-06, No Iterations 429
time step continuity errors : sum local = 2.11662e-10, global = -6.05362e-12, cumulative = 3.05453e-05
DILUPBiCG: Solving for epsilon, Initial residual = 0.000173315, Final residual = 4.12178e-07, No Iterations 1
DILUPBiCG: Solving for k, Initial residual = 0.000339063, Final residual = 4.69541e-07, No Iterations 1
ExecutionTime = 10425.3 s ClockTime = 10494 s

Time = 11.81

Courant Number mean: 0.0125872 max: 0.235497
Moving Particles



As you can see, Courant numbers and other residual is under control but the simulation doesn't go beyond this and I don't see any thing else in the error file. Please let me know if you have any idea

Thanks,
Sumit


forsumit May 13, 2010 15:00

Hey Roro,

Thanks for the inputs. I can sure use a friend as I go along :). I am penultimate year PhD student, I usually works with hydrodynamic and water quality model. I was initiated to OpenFOAM a little while ago and have tried things on and off.

I have used fluent in the past, but would like to learn openFOAM in a better way.

How abt you? What is your research all about?

Take Care,
Sumit

foamWang May 13, 2010 15:59

Hi Sumit,

Cool. I am also in water quality/hydradynamics/coastal engineering field!

I am studying how dredged material release in coast or land reclaimation problem now. We are addressing how to minimize the turbidity of release.

Anyway, today I met the problem of "hang" in my case.
I think that's the problem of the parallelization.
Is your particles stuck at the boundary of the processes?

I can avoid this problem by running on single process.
We definitely need to address the bugs in parallel later.

At present, I found some processor patch is ok, but some are not. They stop the simulations.

Pls check it and keep in touch.

Thanks.

Roro

Quote:

Originally Posted by forsumit (Post 258680)
Hey Roro,

Thanks for the inputs. I can sure use a friend as I go along :). I am penultimate year PhD student, I usually works with hydrodynamic and water quality model. I was initiated to OpenFOAM a little while ago and have tried things on and off.

I have used fluent in the past, but would like to learn openFOAM in a better way.

How abt you? What is your research all about?

Take Care,
Sumit


spej October 13, 2010 09:29

Hi Foamers,

I have the same problem with the stop of writing data in my output-file. I tried the way of RoRo with the lines, but get no results at the moment. Has anyone solved the problem?

regards

spej October 14, 2010 09:32

I believe i find an endless loop in the move-function. I compare the hardballpartilce-synatx and the solidparticle-syntax. In the solidparticle move function there is an extra if-case:

if (onBoundary() && td.keepParticle)
{
if (isType<processorPolyPatch>(pbMesh[patch(face())]))
{
td.switchProcessor = true;
}
}

this if-instruction is missing in the hardballparticle.c. Could this be the reason for the endless loop?

foamWang October 14, 2010 12:45

Could you target any specific command line in "move" class?

I didn't add the "if" command as you stated, but still solved this problem.

Since I made too many other modifications, I don't remember where to further edit. Please remind me.

Thanks.

Roro

Quote:

Originally Posted by spej (Post 279184)
I believe i find an endless loop in the move-function. I compare the hardballpartilce-synatx and the solidparticle-syntax. In the solidparticle move function there is an extra if-case:

if (onBoundary() && td.keepParticle)
{
if (isType<processorPolyPatch>(pbMesh[patch(face())]))
{
td.switchProcessor = true;
}
}

this if-instruction is missing in the hardballparticle.c. Could this be the reason for the endless loop?



All times are GMT -4. The time now is 20:36.