2PFV - update Triangulation
Hi all,
I am investigating how the mesh evolves during the drainage using 2PFV.
I my original problem, I have a significant particle deformation/
Any clue?
Here you have a simplified idea of my original script:
#!/usr/bin/python
# -*- encoding=utf-8 -*-
#******
# Copyright (C) 2010 by Bruno Chareyre *
# bruno.chareyre_
# *
# This program is free software; it is licensed under the terms of the *
# GNU General Public License v2 or later. See file LICENSE for details. *
#******
from yade import pack
from yade import bodiesHandling
from yade import export
from yade import utils
from yade import ymport
import math
import numpy
#######
### DEFINING VARIABLES AND MATERIALS ###
#######
# The following 5 lines will be used later for batch execution
nRead=readParam
num_
compFricDegree = 1, # contact friction during the confining phase
key=
unknownOk=True
)
from yade.params import table
num_spheres=
key=table.key
targetPorosity = 0.55 #the porosity we want for the packing
compFricDegree = table.compFricD
finalFricDegree = 30 # contact friction during the deviatoric loading
rate=0 # loading rate (strain rate)
damp=0.8 # damping coefficient
stabilityThresh
#2e4+70e4medio 1e4+70e4bom 1e4+60e4bom 3e4+90e4+
young=80e5 # contact stiffness200e4
young2=80e5
youngcoat=80e5
bondstr=1e3#2e7
bondstr2=1e3
bondstrcoat=1e6
## create materials for spheres and plates
mat=O.materials
O.materials.
O.materials.
## create walls around the packing
mn,mx=Vector3(
mnbox,mxbox=
walls=aabbWalls
wallIds=
sp=pack.
sp.makeCloud(
O.bodies.
#O.bodies.
#O.bodies.
#O.bodies.
#######
## DEFINING ENGINES ###
#######
triax=TriaxialS
## TriaxialStressC
## this control of boundary conditions was used for instance in http://
maxMultipli
finalMaxMul
thickness = 0,
## switch stress/strain control using a bitmask. What is a bitmask, huh?!
## Say x=1 if stess is controlled on x, else x=0. Same for for y and z, which are 1 or 0.
## Then an integer uniquely defining the combination of all these tests is: mask = x*1 + y*2 + z*4
## to put it differently, the mask is the integer whose binary representation is xyz, i.e.
## "100" (1) means "x", "110" (3) means "x and y", "111" (7) means "x and y and z", etc.
stressMask = 0,
internalCom
wall_
wall_
wall_
wall_
wall_
wall_
goal1=-200,
goal2=-200,
goal3=-200,
)
#newton=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
GlobalStiffnes
triax,
# VTKRecorder(
# newton
# NewtonIntegrato
newton
]
#Display spheres with 2 colors for seeing rotations better
Gl1_Sphere.
if nRead==0: yade.qt.
#######
### REACHING A SPECIFIED POROSITY PRECISELY ###
#######
## We will reach a prescribed value of porosity with the REFD algorithm
## (see http://
## http://
import sys #this is only for the flush() below
#poro=utils.
while 1:
O.run(50,True)
# we decrease friction value and apply it to all the bodies and contacts
# compFricDegree = 0.95*compFricDegree
setContactF
print ("\r Friction: ",compFricDegree," porosity:
sys.
# while we run steps, triax will tend to grow particles as the packing
# keeps shrinking as a consequence of decreasing friction. Consequently
# porosity will decrease
unb=
# triax.goal1=
print(unb)
if triax.strain[
triax.goal1=0
triax.goal3=0
if triax.porosity<
# triax.goal1=
break
#O.save(
print ("### Compacted state saved ###")
print(triax.
#######
### DEVIATORIC LOADING ###
#######
#We move to deviatoric loading, let us turn internal compaction off to keep particles sizes constant
#triax.
# Change contact friction (remember that decreasing it would generate instantaneous instabilities)
setContactFrict
#O.materials.
#======
#set stress control on x and z, we will impose strain rate on y
triax.stressMask = 2
triax.wall_
#now goal2 is the target strain rate
triax.goal1=
triax.goal3=
triax.goal2=
##Save temporary state in live memory. This state will be reloaded from the interface with the "reload" button.
#O.saveTmp()
#######
### Example of how to record and plot data ###
#######
#from yade import plot
from yade import plot
O.run(10,True)
#strain is logarithmic strain or true strain which is ls=(ln1+e) where e=dl/L (strain)
ei0=-triax.
si0=-triax.
# a function saving variables
def history():
plot.
if 1:
# include a periodic engine calling that function in the simulation loop
O.engines=
plot.plots=
plot.plot()
print("
#######
## Drainage Test under oedometer conditions ###
#######
##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.bndCondIs
unsat.bndCondVa
unsat.isPhaseTr
unsat.initializ
unsat.surfaceTe
#start invasion, the data of normalized pc-sw-strain will be written into pcSwStrain.txt
ts=O.dt
pgstep= 40#45000000*ts #30Pa/s
print (pgstep)
pgmax= 10000#9316 #Pa
mi=0.0009 #Pa.sec
f1=open(
for pg in arange(
print(pg)
unsat.
unsat.invasion()
unsat.
unsat.
dy=utils.
q=max(
L=dy[
P=(mi*q*L)/pg
# print(celsV1)
# print(unsat.
for b in O.bodies:
O.forces.
unsat.
unsat.
unsat.
unsat.
# if pg==520.00000001:
cels=
# celsV1=[0.0]*cels
for ii in range(cels):
celsV1=
celsV2=
f1.
f1.close()
while 1:
O.run(100,True)
# unsat.breakCont
# unsat.updateTri
unb=
if unb<0.1:
break
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Bruno Chareyre
- Solved:
- Last query:
- Last reply: