Load and run new simulation
Hi,
I am loading (o.load) results from a saved simulation (o.save). I running a new simulation on loaded data.
I defining ParticleSwelling ()(increase particle radiues over time) by using pyrunner in the engine and define the iterperiod=10 000. The simulation does not run the command every 10 000 iteration, as defined. Instead is seems to run ParticleSwelling() for realPeriod=1, which is A period I defined for commands checkForce(
So my question, how can I get the command run for each 10 000 simulation.
One more question, in my saved simulation the timestep is 1e-7. But defined a new timestep in loaded simulation to 1e-5. The new simulation still use the old time step of 1e-5. How can I define a new timestep?
Best regards,
Mithu
Here is my code:
from __future__ import print_function
from yade import utils, plot, timing
from yade import pack
import pandas as pd
import numpy as np
from PIL import Image
from yade import pack, export
from scipy.interpolate import interp1d
readParamsFromT
from yade.params.table import *
from scipy.integrate import odeint
import matplotlib.pyplot as plt
import os
import csv
from matplotlib.pyplot import figure
from scipy.interpolate import interp1d
from pylab import *
from scipy.optimize import curve_fit
o = Omega()
save=0
# Physical parameters
fr = 0.41
rho = 1561
Diameter = 0.0012/2
D=Diameter
r1 = Diameter/2
#r2 = Diameter/2
k1 = 1.26e5
kp = 12*k1
kc = k1 * 0.1
ks = k1 * 0.1
DeltaPMax = Diameter/3.0
Chi1 = 0.34
PhiF1=0.999
#PhiF1 = DeltaPMax*
#if save==1:
#o.dt = 1.0e-7
#elif save==0:
o.dt=1.0e-5
particleMass = 4.0/3.0*
Vi1 = math.sqrt(
m_tot=0.0005
#no_p=m_
no_p=1000
Tab_rad=0.005
Cyl_height=0.015
cross_area=
##Single particle swelling model
def model(r,
Q=(
drdt =((D*rho_
return drdt
P=[1.45,
#******
# Add material
mat1 = o.materials.
# Spheres for compression and walls
sp=pack.
sp.makeCloud(
sp.toSimulation
walls=o.
r_save=[]
radius=[]
initial_save=[]
size_save=[]
radius.append(0)
swell_t=
i=0
for b in O.bodies:
if isinstance(b.shape, Sphere):
r_save.
# Add engines
o.engines = [
ForceResetter(),
InsertionSort
InteractionLoop(
[Ig2_
Ig2_
Ig2_
[Ip2_
[Law2_
),
NewtonIntegra
PyRunner(
#DeformContro
]
def ParticleSwelling():
time_
Liq_
Liq_
radius=[]
radius.
for b in O.bodies:
if isinstance(b.shape, Sphere):
k=b.id
if Liq_pos>=par_pos:
if swell_t[0][k]==0:
t = np.linspace(0,time)
r = odeint(
elif Liq_pos<par_pos:
r_save.
size_
size_
if time_current>20:
o.pause()
if save==0:
o.load(
initial_
initial_
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Mithushan Soundaranathan for more information if necessary.