You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can i implement time dependent dirichlet boundary condition. Lets say I am solving for the temperature in 1D, at the left boundary T left b = T0 + A*t, where T0 is is the temperature at boundary at t = 0; A is a constant and t is the time in this case.
Thank you
The text was updated successfully, but these errors were encountered:
Indeed, I had find out how to implement time dependent bc. I knew about ramp function, however, I did not know that the system can update the boundary condition at each time: here is the implementation of time dependent BC:
Tf is the surface temperature and it change with the time according to the following function:
function bconditionsT!(f,u,bnode,data)
v=ramp(bnode.time,dt=(0,final_t),du=(Tf(bnode.time), Tf(bnode.time)))
boundary_dirichlet!(f,u,bnode,species=Tₙ,region=1,value=v)
boundary_dirichlet!(f,u,bnode,species=mₙ,region=2,value=0)
end
I think you don't need the ramp function here - you can just write v=Tf(bnode.time)
The ramp function is meant to help with the situation where e.g. at t=0 we have a zero initial value, and want to set a nonzero Dirichlet bc u=u_d for t>0. In this case, the timestep adapation would struggle. Using ramp(t, dt=(0,delta), du=(0,u_d)) allows to ramp up the bc from zero during the small time interval (0,delta), and the time step control can adapt.
Hi,
How can i implement time dependent dirichlet boundary condition. Lets say I am solving for the temperature in 1D, at the left boundary T left b = T0 + A*t, where T0 is is the temperature at boundary at t = 0; A is a constant and t is the time in this case.
Thank you
The text was updated successfully, but these errors were encountered: