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
Posted 3 lug 2012, 10:22 GMT-4 Chemical Reaction Engineering, Parameters, Variables, & Functions Version 4.2a, Version 4.3 12 Replies
Please login with a confirmed email address before reporting spam
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?
Please login with a confirmed email address before reporting spam
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
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
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
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
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
BR,
Arif
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
br,
arif
Please login with a confirmed email address before reporting spam
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.
Suggested Content
- BLOG Implementing a Thermostat with the Events Interface
- FORUM Variable definition
- KNOWLEDGE BASE Circular Variable Dependency Detected
- KNOWLEDGE BASE Failed to Evaluate Variable Jacobian
- BLOG How to Model Periodicity in Microfluidic Systems