Dear all,
I am trying to switch on and switch off the forcing term in the governing equations (momentum equation) after a certain time (solver.sim_time > 0.5).
I initially define,
iForcing = 1
# Problem
problem = d3.IVP([u, p, tau_p], namespace=locals())
problem.add_equation("dt(u) + (1/rho_f)*grad(p) - nu*lap(u) = - u@grad(u) + iBody*fb + iForcing*Fw")
#problem.add_equation("dt(s) - D*lap(s) = - u@grad(s)")
problem.add_equation("div(u) + tau_p = 0") # Used to put the boundary condition on pressure (Pressure Poisson's equation)
problem.add_equation("integ(p) = 0") # Pressure gauge
Say, I want to switch off the turbulent forcing in the momentum equation after t = 0.5 s, so I define a certain if-else condition,
# temporal variation of the swithces
if (solver.
sim_time < 0.5):
iForcing = 1
else:
iForcing = 0
But this condition does not seem to work. The governing equations are taking iForcing =1 , only. I even tried to define the if-else condition in the main loop, but it still doesn't seem to work.
Dear developers and fellow users, please help me out to tackle this issue of switching on and off the forcing term in the governing equations.
Thank you in advance.
Sinceely
Abishek Sarkar