How Can i impose gravity in Two Phase Flow Engine
Hi There,
How Can i impose gravity forces in this code?
-------------------
# encoding: utf-8
# This script demonstrates a simple case of drainage simulation using the "2PFV" two-phase model implemented in UnsaturatedEngine.
# The script was used to generate the result and supplementary material (video) of [1]. The only difference is the problem size (40k particles in the paper vs. 1k (default) in this version)
# [1] Yuan, C., & Chareyre, B. (2017). A pore-scale method for hydromechanical coupling in deformable granular media. Computer Methods in Applied Mechanics and Engineering, 318, 1066-1079. (http://
import matplotlib; matplotlib.
from yade import pack
import pylab
from numpy import *
utils.readParam
from yade.params import table
seed=table.seed
num_spheres=
compFricDegree = table.compFricD
confiningS=-1e5
## creat a packing with a specific particle side distribution (PSD)
psdSizes,
sp=pack.
mn,mx=Vector3(
sp.makeCloud(
## create material #0, which will be used as default
O.materials.
O.materials.
## create walls around the packing
walls=aabbWalls
wallIds=
O.bodies.
triax=TriaxialS
internalCompac
goal1=confiningS,
goal2=confiningS,
goal3=confiningS,
max_vel=10,
label="triax"
)
newton=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
GlobalStiffnes
triax,
newton
]
while 1:
O.run(1000,True)
unb=unbalance
if unb<0.01 and abs(triax.
break
#######
## REACH NEW EQU. STATE ###
#######
finalFricDegree = 30 # contact friction during the deviatoric loading
#We move to deviatoric loading, let us turn internal compaction off to keep particles sizes constant
triax.internalC
# Change contact friction (remember that decreasing it would generate instantaneous instabilities)
setContactFrict
while 1:
O.run(1000,True)
unb=unbalance
if unb<0.001 and abs(triax.
break
triax.depth0=
triax.height0=
triax.width0=
O.save(
O.run(1000,True)
ei0=-triax.
si0=-triax.
from yade import plot
O.engines=
def history():
plot.
s11=
s22=
s33=
pc=
sw=
i=O.iter
)
plot.plots=
plot.plot()
#######
## Drainage Test under oedometer conditions ###
#######
##oedometer conditions
triax.stressMask=2
triax.goal1=
goalTop=
triax.goal2=goalTop
triax.wall_
recorder.dead=0
##Instantiate a two-phase engine
unsat=TwoPhaseF
meanDiameter=
##set boundary conditions, the drainage is controlled by decreasing W-phase pressure and keeping NW-phase pressure constant
unsat.bndCondIs
unsat.bndCondVa
unsat.isPhaseTr
unsat.initializ
unsat.surfaceTe
##start invasion, the data of normalized pc-sw-strain will be written into pcSwStrain.txt
file=open(
for pg in arange(
#increase gaz pressure at the top boundary
unsat.
#compute the evolution of interfaces
unsat.invasion()
#save the phases distribution in vtk format, to be displayed by paraview
unsat.
#compute and apply the capillary forces on each particle
unsat.
for b in O.bodies:
O.forces.
#reac
while 1:
O.run(
unb=
if unb<0.01:
break
file.
file.close()
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jérôme Duriez
- Solved:
- Last query:
- Last reply: