Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 428

Updating COMSOL variables at each time step

$
0
0
Hi all,

I am trying to solve a model which requires updating a variable (something like a boundary condition) based on the solution at each TIME STEP. I am planning to use MATLAB LiveLink on order to have a control over COMSOL model solution as it progresses in time. I know there is a function to run the study node (something like Model.sol('xxx').run('xxx')); but it does not work for me, as it starts to solve the whole study. I want to have control over time stepping.

A brief description of what is going to happen in my model is as follows:
1. set initial/boundary conditions and start to solve the model
2. advance one time step
3. evaluate some predefined expression (specifically, a line integral of a solution variable)
4. check if this line integral has the value that you expect (e.g. we want it to be equal to 2)
5. if yes, then advance one time step. If not, do this time step again with updated boundary condition (until criteria are satisfied) and then advance in time.

Thanks!
Ali

Viewing all articles
Browse latest Browse all 428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>