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.
User defined functions from Matlab for COMSOL simulation
Posted 2012年3月11日 GMT-4 16:24 Fluid & Heat, Interfacing, Studies & Solvers 1 Reply
Please login with a confirmed email address before reporting spam
I am trying to model turbulent flow as well as time-dependent species equation in a certain domain, where the species concentrations at some of the boundaries vary with time (NOT known in analytical form or as data Table). These boundary conditions need to be obtained through a completely separate procedure at each time step. I already have that part coded up in Fortran (which can be easily rewritten as m code). I am looking for a way to couple these two domains. At each time step, I want the comsol simulation to call my subroutine (.m or .c code), obtain the numerical values of those boundary conditions, solve the problem in its domain, and if a certain convergence criterion is satisfied, then moves on to next time step (and if not, calls the subroutine again in the same time-step). First, I need to know if this is feasible in comsol, and if so, what is the procedure? Is there any documentation (or possibly webinar) that I can look at?
An alternative would be to write the entire program in matlab, where comsol simulation is called at every time-step (reverse procedure!). I am using version 3.4, but should be able to use 4.0 as well.
Any help or comment is really appreciated!
Sam
Hello Sam Bey
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.