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.
Changing Boundary Conditions with Time
Posted Aug 30, 2009, 9:59 a.m. EDT Modeling Tools & Definitions, Parameters, Variables, & Functions 8 Replies
Please login with a confirmed email address before reporting spam
I am implementing a model which implements electro-osmotic switching. I have a "Y" shaped channel and after so many time steps I need to make one of the outlets change from having an electric potential (boundary condition - electric potential) to having the boundary condition of electric insulation.
Ideally the method should be able to switch back and forth between the two. It is important that this transition happens seemlessly in a single simulation, as I need to monitor the switching time and velocity profile.
I have looked at a scripting approach, such as:
fem.sol=femtime(fem, ...
'init',init, ...
but I am confused about the 'tlist',[t_st:0.1:350] parameter! Would I have to first simulate from 0:0.1:0.1 and save the solution with the boundary condition set in one of the conditions previously described, and then run 0.1:0.1:0.2 .... and so on ....?
What is the neatest way of doing this?
Regards,
Tom
Please login with a confirmed email address before reporting spam
Changing the boundary condition in scripting is fine. The main problem is halting the solver, then changing the boundary condition and then re-starting the solver from where it left off!
The simplest method, was to run the solver for say 0:0.1:2 save the solution, change the BC and re-build and re-mesh and use this as the fem for the next solution 2:0.1:4. The problem with this method is that COMSOL treats these as two seperate simulations and I cannot postplot my results continuously from 0 thru to 4!
I have tried the callback command, but this is unsuitable. I have also looked at the stopcond, but it seems that a time expression cannot be used.
Any Thoughts?
Regards,
Tom
Please login with a confirmed email address before reporting spam
Well I havnt tried it out, but I would have studied the "Equation System - Boundary Settings - Variables" - h & r variables, and see how these change for the two boundary conditions: electric potential and isolation.
I would expect that you can put a logical *(t>tmin)*t(<tmax) on these and have the switching effect, but your solver might go unstable on the transitions, so perhaps you must try a smoothen step (heaviside function). Furthermore, as you are then "messing" with the GUI interactions between physics settings and equations settings, this might "lock" the equations, but you can always "reset" them to their default.
Good luck and pls keep us informed on the progress
Ivar
Please login with a confirmed email address before reporting spam
Thank you for your suggestion.
Using the GUI I set some of the boundaries to Electric Potential and some to Electric Insulation. I then went to Physics > Equation System > Boundary Settings and studied each tab "q", "g", "h", "r" .... "variables" and looked at what was the difference in each of the settings between potential and insulation.
I then went through each and tried making a potential become an insulation by changing over each of the settings. Even though I copied over 100% (I'm sure?) I still got the locked boundary condition!
It would seem that the change of a boundary condition MUST have to come from the Physics > Boundary Settings options, or in script the bnd and ind namespaces?
Please keep feeding me with suggestions though, any help is much appreciated.
Regards,
Tom
Please login with a confirmed email address before reporting spam
I think this question more or less always refer to an electrode boundary (good conductor = floating potential) which is connected to and disconnected from a voltage source. In that case, the attached model is the desired approach. I have assumed that the you do not have the AC/DC or MEMS modules so the precooked floating potential condition is not available. Then the general approach is for the current balance (conductive media DC):
1) Define a potential BC "V=V1" on the floating electrode.
2) Add a global equation for "V1" with the expression set to "0" (default).
3) In the global equations dialog, select the weak tab and enter the weak expression "test(V1)*I". This defines an non zero integral current source (net current inflow) "I" on the floating electrode.
4) Define global expressions:
V0 = 100
R = 1e-5+1e5*flc1hs(t-5,0.1)
I = (V0-V1)/R
This way the resistance between electrode and reference potential will go smoothly from 1e-5 to 1e5+1e-5 between 4.9 and 5.1 s. When simulating, it is important to keep the max time step well below the transition time scale defined as the second argument to the smoothed Heaviside function 'flc1hs(t,scale)' - otherwise the solver may fail to recognize the change.
Simulate and watch the probe plots. See also how the potential distribution changes. When R is small, the boundary condition approaches "V=V0" and when R is large it acts as a floating electrode.
I hope this helps.
Magnus Olsson
Attachments:
Please login with a confirmed email address before reporting spam
This is an excellent Solution! Very thorough and it works perfectly!
However, I do have the AC/DC and MEMS modules! Does the problem become simpler if we implemented them?
Regards,
Tom
Please login with a confirmed email address before reporting spam
One could in principle use the SPICE interface available in AC/DC or MEMS to define the floating electrode as a "circuit terminal" boundary with the appropriate SPICE circuit for the connecting circuit (Voltage source connected via a variable resistor). For a simple connection like this, I would not say that it is much easier though.
Best regards,
Magnus
Please login with a confirmed email address before reporting spam
I have implemented your original suggestion on my 3D MEMS model. However, V1 never transits? It always remains at 100V!
I am sure I have implemented everything correctly? I have tries to attach the model, but it of the worng file type? I can email you if that helps?
Many Thanks once again.
Regards,
Tom
Please login with a confirmed email address before reporting spam
Was looking for a solution - that's great :))
thx, have a good time!
Dominique
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.