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.

Is it possible to override a dependent variable?

Andrew Prudil Nuclear Materials

Please login with a confirmed email address before reporting spam

Hi everyone,
I've have a model in which I solve a number of coupled phenomena including temperature using a time-dependent solver. I then want to cool down my model to see the deformation at room temperature but I don't need to see the transition. Right now this is really slowing down my model because it is require so many time-steps to model.

Ideally I would like to be able to:

Run a Transient model.
Stop it.
Run a second transient model with the temperature at a different value. (without the temperature physics mode)

Does anyone have any ideas how to override the value of a dependent variable for part of the model? I could make an additional variable like T_fix to do it and use that everywhere instead, but that would require very substantial changes to the model so I'm look for a more elegant solution.

Is overriding a variable even supported by Comsol? All my attempts produce a duplicate variable name error.

2 Replies Last Post 5 juil. 2012, 13:41 UTC−4
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 21 janv. 2012, 04:57 UTC−5
Hi

you can run a transient model for a given time, then link to a sationary one, and then relaunch a tranisnt one. by getting the initial conditions of one to be loaded from the preceding one. But today (it's supposed to be improved in the future releases once, I have heard) you have to update your BC conditions accordingly. Among others the "t" variable becomes undefined when you exit a time series, and relaunch a stationary case.
For that define a Parameter t=whatever_fits_you[s], COMSOL will overwrite it when you run a time series, and just use it for the other cases.

It requires some inventive action, but it works nicely ;) Check the settings of the solver Derived variable sub-nodes

--
Good luck
Ivar
Hi you can run a transient model for a given time, then link to a sationary one, and then relaunch a tranisnt one. by getting the initial conditions of one to be loaded from the preceding one. But today (it's supposed to be improved in the future releases once, I have heard) you have to update your BC conditions accordingly. Among others the "t" variable becomes undefined when you exit a time series, and relaunch a stationary case. For that define a Parameter t=whatever_fits_you[s], COMSOL will overwrite it when you run a time series, and just use it for the other cases. It requires some inventive action, but it works nicely ;) Check the settings of the solver Derived variable sub-nodes -- Good luck Ivar

Andrew Prudil Nuclear Materials

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 5 juil. 2012, 13:41 UTC−4
I just wanted to say that I found a way to do this in 4.3 in case anyone comes across this post when searching.

I used two time-dependent steps. For each of the steps you can now enable and disable model tree items. So, I made a set of variables/equations which are disabled in the first one and enabled in the second one, and I disabled the physics module in the second one.

In my specific case I'm doing heat transfer in the first time-step and this is disabled in the second one. I then enable a set of variables with the same name as the dependent variable thus taking its place.

This new feature seems extremely powerful!
I just wanted to say that I found a way to do this in 4.3 in case anyone comes across this post when searching. I used two time-dependent steps. For each of the steps you can now enable and disable model tree items. So, I made a set of variables/equations which are disabled in the first one and enabled in the second one, and I disabled the physics module in the second one. In my specific case I'm doing heat transfer in the first time-step and this is disabled in the second one. I then enable a set of variables with the same name as the dependent variable thus taking its place. This new feature seems extremely powerful!

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.