Two phase flow
Hi
I am using this two phase flow engine to simulate the behaviour of unsaturated soils. So, i am running a simple script in which , for the first objective i am desaturating my sample to say some 80% and then applying an axial loading. What i am interested is to simulate something very similar to 1 d loading of unsaturated soil, under constant suction.
I reached my first objective, but for the next step i.e., loading...my program just stalls without doing anything (i neither get any kind of error message nor my prog terminates just the virtual time stops and the real time is still running). I appreciate some further help in this regard.
import matplotlib; matplotlib.
from yade import pack, qt
import pylab
from numpy import *
targetPorosity=0.40
friction=0.6
angle=atan(
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=-10000,
goal2=-10000,
goal3=-10000,
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
print triax.meanStress
if unb<0.01 and abs(triax.
break
print "out"
import sys #this is only for the flush() below
while triax.porosity>
## we decrease friction value and apply it to all the bodies and contacts
friction = 0.95*friction
setContactFric
print "\r Friction: ",friction," porosity:
sys.stdout.flush()
O.run(500,1)
#######
## REACH NEW EQU. STATE ###
#######
triax.internalC
setContactFrict
while 1:
O.run(1000,True)
unb=unbalance
if unb<0.001 and abs(triax.
break
print "out of loop"
triax.depth0=
triax.height0=
triax.width0=
O.save(
print "package saved"
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=Unsaturat
##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()
triax_iso=
stressMask=2,
goal1=0.,
goal2=-500000,
goal3=0.,
max_vel=0.001,
label="triax_iso"
)
pc_ini = (unsat.
print pc_ini
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
GlobalStiffnes
triax_iso,
NewtonIntegrat
]
def capillary():
unsat.
unsat.
unsat.
Cap = '%f_cap.txt' %(O.iter)
f2=open(Cap, 'w')
for b in O.bodies:
while 1:
if unb<0.01:
break
f2.
def addPlotData():
contact_
plot.addData(
i=O.iter,
)
name = '%f.txt' %(O.iter)
f=open(name, 'w')
for i in O.interactions:
if i.id1>5:
par1 = O.bodies[
par2 = O.bodies[
fn = i.phys.
f.
#set time step and run simulation:
O.dt=0.
plot.plots={'i ':('S11'
#show the plot
plot.plot()
def saveAddData():
#save the plot
plot.
Thanks
Amiya
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: