Viscosity of water in FlowEngine

Asked by liucheng83

Hi, everyone.

Which Viscosity is used in FlowEngine, dynamic viscosity or kinematic viscosity? And is the default value is water in T=20 degree celsius using SI Unit.
----
viscosity(=1.0) why 1.0 here in class yade.wrapper.FlowEngine((object)arg1)
viscosity of the fluid

https://yade-dem.org/doc/yade.wrapper.html?highlight=flowengine#yade.wrapper.FlowEngine
-----
Why the example script oedometer.py in FluidCouplingPFV Folder using flow.viscosity=10, any consideration about it?

I know some parameter value is just for a test, but I am not sure whether any parameters are using SI Unit.

And how can I find the FlowEngine source codes.

Many thanks,
Cheng

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Caulk
Solved:
Last query:
Last reply:
Revision history for this message
Best Robert Caulk (rcaulk) said :
#1

Hello Cheng,

>Which Viscosity is used in FlowEngine, dynamic viscosity or kinematic viscosity?

FlowEngine computes flow between cells using Poiseuilles law [1], so it is using the dynamic viscosity of the fluid.

>I know some parameter value is just for a test, but I am not sure whether any parameters are using SI Unit.

YADE is (generally) unitless. You decide which units you want your system to adhere to, and assuming you are consistent, your results will remain in the system you have chosen. I did not author oedometer.py, but most of these examples are just demonstrations of functionality, I wouldn't take the numbers to mean anything special if I were you (but maybe they do, without comments I guess you need to really inspect it to find out what unit system it is in). Same goes for default values in general, these are values that worked for someone's simulation but you will need to change them to obtain accurate behavior in your specific model.

>And how can I find the FlowEngine source codes.

YADE source code is hosted on Github. The FlowEngine itself is contained in [2], but it relies on [3] and [4] for permeability calculations and the solver.

[1]Chareyre, B., Cortis, A., Catalano, E., & Barthélemy, E. (2012). Pore-Scale Modeling of Viscous Flow and Induced Forces in Dense Sphere Packings. Transport in Porous Media, 94(2), 595–615. http://doi.org/10.1007/s11242-012-0057-2

[2]https://github.com/yade/trunk/blob/master/pkg/pfv/FlowEngine.ipp.in
[3]https://github.com/yade/trunk/blob/master/lib/triangulation/FlowBoundingSphere.ipp
[4]https://github.com/yade/trunk/blob/master/lib/triangulation/FlowBoundingSphereLinSolv.ipp

Revision history for this message
liucheng83 (lcheng83) said :
#2

Hello Robert,

Thanks for your reply. It's great.

More Questions to add:
Q3:
Do you have the information about the solver used for Flowengine because I can only get this information:
--------------------
useSolver(=0)
Solver to use. 0:Gauss-Seidel, >0: Cholesky factorization (sparse CHOLMOD)
---------------------
Any lists here about the solver that is great than zero?

Q4:
I want to create a two region of the model, one has the fluid cell to calculate the flow seepage ( region one) , just the same way as oedometer.py to create the walls, boxes using aabbWalls, and get the target state using TriaxialStressController.
---------
walls=aabbWalls([mn,mx],thickness=0,material='walls')
-------
I want to add another box region ( region two) just below the bottom wall which store the balls that do not need to participate in fluid calculation. Is it possible? The main difficult is how to define the flowEngine boundary conditions of region one.

For simple for above description , I like to create two conjoint box,the upper one ( region one) need fluid calculation and the lower one ( region two) do not need fluid calculation. The lower one may share the same wall from the upper one. Is it possible?
How can I set the flowEngine boundary conditions of region one?

Many thanks,
Cheng

Revision history for this message
Robert Caulk (rcaulk) said :
#3

Hello,

>Do you have the information about the solver used for Flowengine

 The solvers basically use different libraries/methods to solve the same system of equations. The key to the numbers: 0=Gauss Seidel 1=Taucs 2=Pardiso 3=Eigen. The interfaces to these libraries are coded in [1] if you are interested in diving into the rabbit hole. My recommendation is to stick with 3, it is quite robust in my experience (not to mention it is free, while pardiso requires a license if I am not mistaken).

>Q4:

Hmm, basically you want half of your cube to not participate in fluid flow? You still want the top and bottom halves to interact mechanically, correct?

You might want to try experimenting with blocking cells [2]. For example, you'd set up the entire cube with flow, and then sweep through the bottom half of the cells with blockCell. I've never used it though, so I am unsure how that will work out. Good luck.

Cheers,

Robert

[1]https://github.com/yade/trunk/blob/master/lib/triangulation/FlowBoundingSphereLinSolv.ipp
[2]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.FlowEngine.blockCell

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#4

> 0=Gauss Seidel 1=Taucs 2=Pardiso 3=Eigen

This was some time ago. Although the code is there technically it will not work with Taucs/Pardiso unless yade is linked vs. these libs (by default cmake will not). So I confirm that 3 is the only good option. So 1 or 2 would just return "Flow engine not compiled with taucs, nothing computed if useSolver=1".

Anyway, Q3:
Taucs, Pardiso, or Eigen are (were) all used for exactly the same solver: Cholesky factorization implemented for sparse linear systems. It turned out that eigen/cholmod was the (slightly) most efficient in terms of CPU time, hence no need to consider the other ones since they are mathematicaly equivalent.

Q4. Robert's answer is excellent. You can do that.

Revision history for this message
liucheng83 (lcheng83) said :
#5

Hello Robert and Bruno,

Thanks for your reply.
I will chose to use solver 3 and I will try to test the blocking cells.

But before that, some results come out that I cannot understand,

Q5:
print flow.ignoredBody ###it get -1 as the result
How can I set a body to be ignoredBody, because it can be exclude from the triangulation from the documentation
-------
ignoredBody(=-1)
DEPRECATED, USE MASK - Id of a sphere to exclude from the triangulation.)
-------------
Q6: I try to get information about flow cells just after "print the Qin"
-------
print "Qin=",Qin," Qout=",Qout," permeability=",permeability

#print information
print "total num of nCells,flow.nCells()=", flow.nCells() ### It get 0 as a result, why?
print "total ids of bodies affected by this Engine,flow.ids=", flow.ids ### It get [] as a result, why?
print flow.ignoredBody #get -1
print flow.getVertices(0)
---------

Q7: when I unload the top wall when FlowEngine is dead by using
----
##unload
triax.goal2=0; O.run(2000,1)
---
and after FlowEngine is activated, set
--------
flow.bndCondIsPressure=[0,0,1,1,0,0]
flow.bndCondValue=[0,0,0,1,0,0]
----------

I test the Qin and Qout, sometimes it comes out with a different value like, Qin=0 and Qout=-1.19524638635e-06
Anything wrong with the input and output not equal?

Revision history for this message
liucheng83 (lcheng83) said :
#6

Q8:
I want to use mask for spheres bodies to not affected by the flowEngine, Is it possible to do that? How can I do it?
------
mask(=0)
If mask defined, only bodies with corresponding groupMask will be affected by this engine. If 0, all bodies will be affected.
--------

In the , I add mask here
--------
##Soil Packing creating
sp=pack.SpherePack()
sp.makeCloud(mn,mx,-1,0.3333,num_spheres,False, 0.95,seed=1) #"seed" make the "random" generation always the same
sp.toSimulation(material='spheres', mask=1)
-------
But the TriaxialStressController seems not woking anymore, because the TriaxialStressController Engine cannot set mask, right?

Revision history for this message
liucheng83 (lcheng83) said :
#7

Q9:

And when I execute O.step() after print Qin and Qout
The result comes out like this:
----------
GS : j=0 p_moy=-nan dp_moy=-nan
GS iterations : 0
totalForce = 0 0 0
-----
What is the meaning?

Revision history for this message
liucheng83 (lcheng83) said :
#8

Q10:

Sorry, I execute O.load('1.yade.bz2') after print Qin, so it comes out the result after I print flow.nCells(
----
Result: 0
---
But, how can recover the state to the state when I execute O.save('1.yade.bz2'), every time I O.load('1.yade.bz2'),
it seems everything is lost.

Revision history for this message
Robert Caulk (rcaulk) said :
#9

Dear Cheng,

I hate to say this. In an attempt to keep the Yade launchpad remotely organized I am going to request that you open a new thread for each of your questions. However, I implore you to read this [1] before opening each of your questions - these questions are unanswerable in their current form.

Please mark this thread "solved".

Thank you for your patience,

Robert

[1]https://yade-dem.org/wiki/Howtoask

Revision history for this message
Chareyre (bruno-chareyre-9) said :
#10

>ignoredBody(=-1)
>DEPRECATED, USE MASK - Id of a sphere to exclude from the triangulation.)

Excellent. I implemented the feature then I forgot.
So, there is this alternative to the blocking cell method: assign mask=1 to
flow engine, mask=1 to half of the particles on the good side, mask=2 for
the other half.
The fluid problem will simply not see the spheres which do not have the
right mask, as if they were not actually in the simulation. They are not
meshed, so there will be no cells to block.
Besides, the discussion becomes confusing...
Bruno

On 19 May 2017 at 02:03, liucheng83 <email address hidden>
wrote:

> Question #632800 on Yade changed:
> https://answers.launchpad.net/yade/+question/632800
>
> Status: Answered => Open
>
> liucheng83 is still having a problem:
> Hello Robert and Bruno,
>
> Thanks for your reply.
> I will chose to use solver 3 and I will try to test the blocking cells.
>
> But before that, some results come out that I cannot understand,
>
> Q5:
> print flow.ignoredBody ###it get -1 as the result
> How can I set a body to be ignoredBody, because it can be exclude from the
> triangulation from the documentation
> -------
> ignoredBody(=-1)
> DEPRECATED, USE MASK - Id of a sphere to exclude from the triangulation.)
> -------------
> Q6: I try to get information about flow cells just after "print the Qin"
> -------
> print "Qin=",Qin," Qout=",Qout," permeability=",permeability
>
> #print information
> print "total num of nCells,flow.nCells()=", flow.nCells()
> ### It get 0 as a result, why?
> print "total ids of bodies affected by this Engine,flow.ids=", flow.ids
> ### It get [] as a result, why?
> print flow.ignoredBody #get -1
> print flow.getVertices(0)
> ---------
>
> Q7: when I unload the top wall when FlowEngine is dead by using
> ----
> ##unload
> triax.goal2=0; O.run(2000,1)
> ---
> and after FlowEngine is activated, set
> --------
> flow.bndCondIsPressure=[0,0,1,1,0,0]
> flow.bndCondValue=[0,0,0,1,0,0]
> ----------
>
> I test the Qin and Qout, sometimes it comes out with a different value
> like, Qin=0 and Qout=-1.19524638635e-06
> Anything wrong with the input and output not equal?
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>
>

Revision history for this message
liucheng83 (lcheng83) said :
#11

Dear Robert,

I must say sorry for not being aware of the problem that how to raise a new question. I will try to grasp the meaning from the documentation as you suggested. Thank you for your advice.

Dear Bruno,

I will try it to see whether ignoredBody method does work because somethings went wrong. Thank you.

Cheng Liu

Revision history for this message
liucheng83 (lcheng83) said :
#12

Thanks Robert Caulk, that solved my question.

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#13

My point was to NOT use ignoredBody, as the warning suggests. Use mask instead.