Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Dirchlet Boundary Condition with Time Dependence

Please login with a confirmed email address before reporting spam

I'm modeling an extension of the "Groundwater Flow and Solute Transport" Model found in the Model Library published in 2008, for COMSOL 3.5a. I wish to assign a cycling boundary condition for release of the contaminant. I have assigned the following statement to r for this condition: C_in*(435<=x&&x<=690&&(.5*cos((1/90)*t)+.5)) Where C_in is the concentration, assigned as 1, to represent 100%. When I have COMSOL plot the concentration level on the boundary it doesn't cycle in the cosine manner (I hope) I have assigned. In Matlab the function cycles how I would like, but I suppose I am not entering the function correctly for COMSOL. How am I to enter this condition?

Thanks in advance!

4 Replies Last Post 2012年7月24日 GMT-4 21:02
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年1月11日 GMT-5 16:25
Hi

have you tried

C_in*(435>=x)*(x<=690)*(.5*cos((1/90)*t)+.5))

I believe this is what you are expressing, probably it works in Matlab too

by the way I changed the *(435<=x)* to *(435>=x)* but I might have missed something too

--
Good luck
Ivar
Hi have you tried C_in*(435>=x)*(x

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年1月12日 GMT-5 11:52
Hi Ivar,

When I write the boundary conditions in this manner, (without the ampersands) it hangs and doesn't solve the system more then one time step. I have seen documentation for both ways of writing the conditional statement. Which is the most commonly used way? Also is it legal to write the time condition in a function like this?

Thank you.
Hi Ivar, When I write the boundary conditions in this manner, (without the ampersands) it hangs and doesn't solve the system more then one time step. I have seen documentation for both ways of writing the conditional statement. Which is the most commonly used way? Also is it legal to write the time condition in a function like this? Thank you.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年1月13日 GMT-5 01:44
Hi

I use it , so I believe its "legal". The difficulty is the step, you should smoothen them. Comsol asks for at least the first derivative of all BC's to converge correctly, and the bolean make Dirac or hard steps, that is not very good ;) Smoothen the steps with a Heaviside

--
Good luck
Ivar
Hi I use it , so I believe its "legal". The difficulty is the step, you should smoothen them. Comsol asks for at least the first derivative of all BC's to converge correctly, and the bolean make Dirac or hard steps, that is not very good ;) Smoothen the steps with a Heaviside -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月24日 GMT-4 21:02

Comsol asks for at least the first derivative of all BC's to converge correctly, and the bolean make Dirac or hard steps, that is not very good ;) Smoothen the steps with a Heaviside

--
Good luck
Ivar



This info is really interesting. Thanks Ivar.
[QUOTE] Comsol asks for at least the first derivative of all BC's to converge correctly, and the bolean make Dirac or hard steps, that is not very good ;) Smoothen the steps with a Heaviside -- Good luck Ivar [/QUOTE] This info is really interesting. Thanks Ivar.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.