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.

Using dependant variable as a variable

Please login with a confirmed email address before reporting spam

Hi,

I am using comsol 4.2a for a heat transfer model. I have 2 problems and I will be very great ful if somebody answers them,

First of all, I have a varying material property. The thermal conductivity changes with the temperature of that material. So I used model input > temperature to solve the problem. My question is: Is it taking the temperature of that position or is it actually taking the temperature of the whole model?

second question, Can I use a temperature of a part of the device that I am modelling as a variable and use it again in the simulations?


12 Replies Last Post 2012年7月9日 GMT-4 10:18
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 2012年7月4日 GMT-4 01:37
Hi

the dependent variables are fields (that is they are T(x,y,z,t ...)) so if you write T the rest is implicit nad its the local temperature that applies to the dx*dy*dz element.

You can always define a global MyT as aveop1(T) over some domain or oundary nad decide to link some of your dependences on "T" to MyT, then you force the same scalar value MyT to all elements defined

--
Good luck
Ivar
Hi the dependent variables are fields (that is they are T(x,y,z,t ...)) so if you write T the rest is implicit nad its the local temperature that applies to the dx*dy*dz element. You can always define a global MyT as aveop1(T) over some domain or oundary nad decide to link some of your dependences on "T" to MyT, then you force the same scalar value MyT to all elements defined -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月4日 GMT-4 10:50
Hi,


I also have a similar problem. I want to simulate the electrodialysis process in two channels, one being the dilute channel and the other one, the concentrated channel.

My problem is that many of my properties depend on the concentration of the solution. I defined 2 sets of variables attached to the domain of each channel, for example:

rho=(1+0.000395*c1)*(999.93+2.3e-2[1/K]*T)

is the density of the electrolyte in the dilute channel. (With c2, it would be the density in the concentrate channel).

Since the simulation is done under constant temperature, the density of the electrolyte is only a function of the concentration.

Due to the phenomena occuring within the channels, the concentration varies along both channels. I defined an integration boudary on the outlet of my geometry to obtain an average concentration (cNa_in) that I use as inlet/inflow condition for the next simulation in a time dependent analysis.

My question is now, how can I have my properties calculated with this average concentration, for each step of the simulation. I tried simply to define the properties with this new variable as:

rho=(1+0.000395*cNa_in)*(999.93+2.3e-2[1/K]*T)

but it didn`t work.


I hope you can help me.


Oscar



Hi, I also have a similar problem. I want to simulate the electrodialysis process in two channels, one being the dilute channel and the other one, the concentrated channel. My problem is that many of my properties depend on the concentration of the solution. I defined 2 sets of variables attached to the domain of each channel, for example: rho=(1+0.000395*c1)*(999.93+2.3e-2[1/K]*T) is the density of the electrolyte in the dilute channel. (With c2, it would be the density in the concentrate channel). Since the simulation is done under constant temperature, the density of the electrolyte is only a function of the concentration. Due to the phenomena occuring within the channels, the concentration varies along both channels. I defined an integration boudary on the outlet of my geometry to obtain an average concentration (cNa_in) that I use as inlet/inflow condition for the next simulation in a time dependent analysis. My question is now, how can I have my properties calculated with this average concentration, for each step of the simulation. I tried simply to define the properties with this new variable as: rho=(1+0.000395*cNa_in)*(999.93+2.3e-2[1/K]*T) but it didn`t work. I hope you can help me. Oscar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月5日 GMT-4 11:55
hi,

Thanks Ivar and oscar.

well I found a way to bypass this thing and it works . before I was using joule heating and now I am only considering my problem as a heat transfer one. :) . That somehow solves my problem.

But still I am struggling with the second problem. I am using a probe for the second problem. But the probe can what I have seen only integrate or sum but I want the probe to be updated all the time and it will act as a variable. what am I doing wrong.

today I installed 4.3 and now using it.

arif
hi, Thanks Ivar and oscar. well I found a way to bypass this thing and it works . before I was using joule heating and now I am only considering my problem as a heat transfer one. :) . That somehow solves my problem. But still I am struggling with the second problem. I am using a probe for the second problem. But the probe can what I have seen only integrate or sum but I want the probe to be updated all the time and it will act as a variable. what am I doing wrong. today I installed 4.3 and now using it. arif

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月5日 GMT-4 14:40
dear Ivar,

about the second problem, I tried your way and I think, it is working quite fine.. you are a life saver.. thanks a lot

br,
arif
dear Ivar, about the second problem, I tried your way and I think, it is working quite fine.. you are a life saver.. thanks a lot br, arif

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月6日 GMT-4 03:48
Hi arif,


could you please explain me how you solve your second problem, that is, using the temperature that you are calculating as a variable for the simulation?


thanks
Hi arif, could you please explain me how you solve your second problem, that is, using the temperature that you are calculating as a variable for the simulation? thanks

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月9日 GMT-4 09:45
sorry for the late reply Oscar. I was away. I took Ivar's suggestion. I defined a paramemter MyT and then model coupling and average. select the domain. The average variable name is aveop1. Then use a variable with the name like T_m as aveop1(T). hope it works for you.

BR,
Arif
sorry for the late reply Oscar. I was away. I took Ivar's suggestion. I defined a paramemter MyT and then model coupling and average. select the domain. The average variable name is aveop1. Then use a variable with the name like T_m as aveop1(T). hope it works for you. BR, Arif

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月9日 GMT-4 10:04
Hi,


so, for example, if I want the average of the concentration in a domain, I go to Detinitions-Model Couplings-Average, I choose the domain and then in the operator name, I write:

aveop1(c), but then it says

"Invalid property value
-Property: opname "Operator name" is a string. Must be a valid variable name"

Any idea what is happening?


Hi, so, for example, if I want the average of the concentration in a domain, I go to Detinitions-Model Couplings-Average, I choose the domain and then in the operator name, I write: aveop1(c), but then it says "Invalid property value -Property: opname "Operator name" is a string. Must be a valid variable name" Any idea what is happening?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月9日 GMT-4 10:08
c is the dependant variable here right ? Is the concentration variable expressed as c ? what physics are you using `?
c is the dependant variable here right ? Is the concentration variable expressed as c ? what physics are you using `?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月9日 GMT-4 10:14
Hi,

Yeah, c is the dependant variable. I am using the transport of diluted species of the Chemical Reaction library.

I think I got it, first I just simply define the average operation, I create aveop1 selecting my domain.

Then I create a variable for that specific domain, for example:

c aveop1(c1)

and now I can have all my properties in function of the average concentration "c" , like

rho (density)=(1+0.00934*c)*(A+B+C)


Am I right??
Hi, Yeah, c is the dependant variable. I am using the transport of diluted species of the Chemical Reaction library. I think I got it, first I just simply define the average operation, I create aveop1 selecting my domain. Then I create a variable for that specific domain, for example: c aveop1(c1) and now I can have all my properties in function of the average concentration "c" , like rho (density)=(1+0.00934*c)*(A+B+C) Am I right??

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月9日 GMT-4 10:15
I cannot explain myself that well. maybe this will help
I cannot explain myself that well. maybe this will help


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月9日 GMT-4 10:17
can you change the name of the variable and then try c to lets say c_a ..everything in my opinion looks fine.. but i am new to comsol.. using it for 3-4 months


br,
arif
can you change the name of the variable and then try c to lets say c_a ..everything in my opinion looks fine.. but i am new to comsol.. using it for 3-4 months br, arif

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月9日 GMT-4 10:18
Yeah,


that was exaclty what I tried to write. I think it is working now. Thank you very much for your help.


See you,



Oscar
Yeah, that was exaclty what I tried to write. I think it is working now. Thank you very much for your help. See you, Oscar

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.