Releasing constrained boundary conditions in a transient problem

Hi everyone,
I have a simple question. I would like to know if there are ways to switch between fixed DirichletBC and free Neumann on a certain boundary in case of time-dependent problems.
For example in a 3D problem I want to apply a fixed boundary u=0 for 20 seconds and then release this boundary:

if time <= 20
bc = DirichletBC(V, Constant((0.0,0.0,0.0)), left)  # fixed condition for certain time
else #free boundary condition

Thank you in advance
Ali

Well, as you state above in your pseudocode, just make a loop like this and

If something:
     bc=[DirichletBC(....)]
Else:
     bc=[]
solve(a==L, u, bcs=bc)

A similar approach can also be done with assembling before solving.

1 Like

Thanks for your reply!