← Back to team overview

yade-dev team mailing list archive

Re: updating PFV

 

On 20/02/14 10:52, Christian Jakob wrote:
> Hi,
>
> I want to do some updates/improvements of PFV method.

Don't do anything yet! There is some code cleaning going on locally
(different variable names, removing useless functions, and so on). It
will mess up everything when I will commit if you have local diffs. Make
you a favor and wait one more week, or be ready for tedious merge.


>
> First thing I wanna do is a simulation with an increasing pore
> pressure in all cells to investigate liquefaction of a loose sand at
> different stress conditions. I tested imposePressure(), but for now it
> is not possible to use it within a loop over PFV cells. Actually it
> needs position of the cells (or at least a point within the cell), but
> I want it to do something like:
>
> for i in range(flow.ncells()):
>   flow.imposePressure(i,p)

This loop is strange. Do I miss something?
1/ If you impose pressure everywhere, there is no point using a fluid
solver (which aim is to compute pressure, at the end of the day)
2/ If pressure is the same everywhere, it applies no force on particles
(forces only come whith pressure gradients), again no point to simulate
a fluid.
3/ In liquefaction, pressure increase comes from the hydromechanical
coupling (and the model gives that) not from an externally applied pore
pressure
4/ The element number "i" is not something you can rely on, this is why
such function does not exist. The mesh is changing all the time as
particles move, thus element number "i" is meaningless. Applying
pressure at a specific location in space is more appropriate.

Besides, I agree that there is a need for writing loops on all elements
in other cases. We (you, Thomas, me, ...) can add it after the code
cleaning step.
 
>
> I had a short look at the source code, it is quite confusing. I
> searched code for imposePressure. It finds 6 lines in
> pkg/dem/FlowEngine.hpp, but where is corresponding code in .cpp file?
> I noticed there is a macro called TPL. How can edit the code of this
> macro?
>
imposePressure is defined in the hpp [1].
The TPL macro as well [2].

[1] https://github.com/yade/trunk/blob/master/pkg/dem/FlowEngine.hpp#L330
[2] https://github.com/yade/trunk/blob/master/pkg/dem/FlowEngine.hpp#L24


The template aspect makes things a bit more difficult to read, but it is
the only way I found to not duplicate the whole PFV code each time there
is something new. Periodic BC, drainage model, solute transport, etc.
will normally be only different instances of FlowEngine with different
template parameters (and maybe additional functions). It is the case for
periodic BC already, which do not duplicate anything.
I'm open to suggestions if somebody has a better idea of design. The
root of the problem is the data type in each element/node, which is the
template parameter of CGAL::Triangulation and is different for each new
model.

Cheers.

Bruno




Follow ups

References