How to Calm Down in the Explicit mode in Escript
In this work, I organized the script according to the wave propagation example. The proper timestep is evaluated through the wave equation. The PDE is used to calculate the acceleration. Well, there is no dissipation in this method, and thus the system continues bouncing. So 0.5 multiplying the velocity at the last timestep is used as a dissipation scheme. And the acceleration of the system is checked at every iteration until the system is in a relative state. However, there is no specific theory for this. So I wonder if there is something like the viscous resistance to help the model calm down.
` while not convergeFlag:
iterNum += 1
self.x = self.__
self.u = self.u + du
# 1st calculation
if 'elastic' in self.mode:
elif 'dem' in self.mode:
elif 'ml' in self.mode:
# stressDamp = self.stressDamp
self.a = self.__
# aInit = sum(length(
# NOTE: the new velocity is renewed after the last velocity attenuation
v_new = self.v * self.attenuatio
t = t + self.timeStep
du = (v_new + self.v) * 0.5 * self.timeStep
self.v = v_new
# check convergence
if a_l2 < 0:
# elif residual_a < 0.1 * a_l2:
elif residual_a < aCovergenceCrit
elif iterMax and (iterNum >= iterMax):
# verbose
"""
No bug here. The $min_a$ is renewed at $iterNum$ FIRST 5 or 1000.
"""
if 'dem' in self.mode:
if iterNum % 5 == 0:
elif 'ml' in self.mode:
if iterNum % 1000 == 0:
Question information
- Language:
- English Edit question
- Status:
- Expired
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: