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.

Access Model Temperature Values? - COMSOL 5.0

Please login with a confirmed email address before reporting spam

I am running COMSOL 5.0, and I would like to define a Global Variable for ionic conductivity (IC) within my new material. This has a function of the form:

IC = 40.25*exp(-1000/T)

Unfortunately, COMSOL refuses to recognize 'T' or 'mod1.T' as proper representations of the temperature. Is it no longer possible to define material properties and global variables by the model temperature? If anyone has any insights, I would be extremely grateful!

4 Replies Last Post 14.06.2016, 11:02 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 08.04.2015, 04:56 GMT-4
Hi Christopher,

Of course it's possible in COMSOL to define material properties and global variables (these last ones by integration or similar operations) by the model temperature!!

Please, be careful: you talk of Global variable: that's a variable independent on the position, that takes a unique value for all the geometry, and surely your IC variable is not such a variable.

In other words, the key is what T is for COMSOL (I mean for COMSOL running your model). If you are solving a heat problem, T is usually the name of the dependent variable (you can check that in the physics node, dependent variables field, at the end), and COMSOL will recognize it. I suppose that's your case. If that is the case, T is not a global variable, but a local one (depending on position, and on t if the study is time dependent). So your variable IC = 40.25*exp(-1000/T) could be defined as such: a variable (inside Component/Definitions/Variables). In that case, IC is local, not global.

Or perhaps T (and IC) for you is not a local variable, but a representative one, like an average. In that case, you could define such a variable in Definitions/Component couplings/Average. If such, use a name different from those of the variables and parameters already defined in your model (and different from the names of COMSOL constants, parameters and operators).

Jesus.
Hi Christopher, Of course it's possible in COMSOL to define material properties and global variables (these last ones by integration or similar operations) by the model temperature!! Please, be careful: you talk of Global variable: that's a variable independent on the position, that takes a unique value for all the geometry, and surely your IC variable is not such a variable. In other words, the key is what T is for COMSOL (I mean for COMSOL running your model). If you are solving a heat problem, T is usually the name of the dependent variable (you can check that in the physics node, dependent variables field, at the end), and COMSOL will recognize it. I suppose that's your case. If that is the case, T is not a global variable, but a local one (depending on position, and on t if the study is time dependent). So your variable IC = 40.25*exp(-1000/T) could be defined as such: a variable (inside Component/Definitions/Variables). In that case, IC is local, not global. Or perhaps T (and IC) for you is not a local variable, but a representative one, like an average. In that case, you could define such a variable in Definitions/Component couplings/Average. If such, use a name different from those of the variables and parameters already defined in your model (and different from the names of COMSOL constants, parameters and operators). Jesus.

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: 10 years ago 08.04.2015, 07:03 GMT-4
Hi

"T" (Temperature) is not defined as such before you have added some physics and that you have passed through (or solved/initiated) the physics node and or solver node.

My way around is to define a Definition - Parameter "T" i.e as 20[degC]", this Parameter value will be overriden by the dependent variable "T", if defined later in any physics, if not, then my Parameter "T" solves any dimensional and reference issues for COMSOL

I use this also for "t" (with default t=0[s]) time when I mix a stationary solver followed by a time depedent solver, to avoid redefining all BCs for each case, when these are dependent on the variable "t" time (again an internal variable only existing for COMSOL once you have set up a physics and a time dependent solver that has been "initialised").

Furthermore, you need to learn clearly the differences between scalars variables, field variables f(x,y,z,t), global variables f(t) etc. as by default in COMSOL writing notation you OMIT the spatial and time dependences; as well as the implicit dx*dy*dz on all related operators. They all look the same, only the context will explain what applies. But with the handy "Unit" logic of COMSOL you can pin-point clearly any discrepancies

--
Good luck
Ivar
Hi "T" (Temperature) is not defined as such before you have added some physics and that you have passed through (or solved/initiated) the physics node and or solver node. My way around is to define a Definition - Parameter "T" i.e as 20[degC]", this Parameter value will be overriden by the dependent variable "T", if defined later in any physics, if not, then my Parameter "T" solves any dimensional and reference issues for COMSOL I use this also for "t" (with default t=0[s]) time when I mix a stationary solver followed by a time depedent solver, to avoid redefining all BCs for each case, when these are dependent on the variable "t" time (again an internal variable only existing for COMSOL once you have set up a physics and a time dependent solver that has been "initialised"). Furthermore, you need to learn clearly the differences between scalars variables, field variables f(x,y,z,t), global variables f(t) etc. as by default in COMSOL writing notation you OMIT the spatial and time dependences; as well as the implicit dx*dy*dz on all related operators. They all look the same, only the context will explain what applies. But with the handy "Unit" logic of COMSOL you can pin-point clearly any discrepancies -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 08.04.2015, 13:27 GMT-4
Thank you for your reply! I didn't know the COMSOL library did not automatically import temperature as a prototype variable, and that I would need to add physics later in the process tree to get it to define temperatures (T, T2, T3...) under the global variable list. This makes a lot of sense to me now, as I had to learn to ignore the "Tree" structure of COMSOL modeling in favor of a single interdependent model where the "Global" parameters are defined by physics that are added much later in the process. I do really like the idea of aliasing variables to begin with, and then having them overridden by the dependent variables later in the code.

Does calling the temperature, 'T', not evaluate the parameter at the given point in space? I usually deal with incompressible fluids so I usually evaluate velocity first, then temperature, and finally other desired parameters. So I usually want COMSOL to evaluate the formula for the ionic conductivity at each point within my material. I though that calling 'T' in a variable passed to a new material property would accomplish this, but I may be wrong.
Thank you for your reply! I didn't know the COMSOL library did not automatically import temperature as a prototype variable, and that I would need to add physics later in the process tree to get it to define temperatures (T, T2, T3...) under the global variable list. This makes a lot of sense to me now, as I had to learn to ignore the "Tree" structure of COMSOL modeling in favor of a single interdependent model where the "Global" parameters are defined by physics that are added much later in the process. I do really like the idea of aliasing variables to begin with, and then having them overridden by the dependent variables later in the code. Does calling the temperature, 'T', not evaluate the parameter at the given point in space? I usually deal with incompressible fluids so I usually evaluate velocity first, then temperature, and finally other desired parameters. So I usually want COMSOL to evaluate the formula for the ionic conductivity at each point within my material. I though that calling 'T' in a variable passed to a new material property would accomplish this, but I may be wrong.

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 14.06.2016, 11:02 GMT-4

Older versions of COMSOL had a shared variable: T for Temperature.
As seen here:
Inline image 1

New versions do not have the "T" dependent variable.

That is why when I try to use it I get this error message: Inline image 2
I have tried to assign and initial value for T under the global parameters so that it can get overridden by other heating sources later but I am still receiving the same error.

How can I create a dependent variable for Temperature in COMSOL 4.4?


Thank you for your time !



Best Regards,
Laura Arciniegas
Older versions of COMSOL had a shared variable: T for Temperature. As seen here: Inline image 1 New versions do not have the "T" dependent variable. That is why when I try to use it I get this error message: Inline image 2 I have tried to assign and initial value for T under the global parameters so that it can get overridden by other heating sources later but I am still receiving the same error. How can I create a dependent variable for Temperature in COMSOL 4.4? Thank you for your time ! Best Regards, Laura Arciniegas

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.