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.

Space Coordinates Variable

Please login with a confirmed email address before reporting spam

Hi,


I am trying to create a simple model Coupling Momentum transport and Conduction/Convection in 2D axisymetric: a hot air flow in a cylinder.

I want to define heat losses on boundaries : Q(z)=h(T(r=R)-T(r=0))


So my problem is to access in COMSOL to the temperature at r=0 and r=R in each z position (the heat loss varies with the z position).



Thank you for your help.


With regards.



Gabriel


10 Replies Last Post Apr 7, 2012, 11:28 a.m. EDT
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 Oct 4, 2009, 4:22 a.m. EDT
Hi

it took me some time to figure out a potential way, basically (COMSOL developper this is for you :) because when I go into the integration and coupling variables, I constantly have to switch forth and back from the help and the programm to verify my correct understanding of the variables you use, it would be MUCH easier for us if you add the definitions, and/or the mathematical equations you are using (arclength = s, boundary integration is over "s" dl or, subdomain integration over dx dy, or dr dz ... extrusion (x) = int over y of f(x,y) etc. I agree there are many cases to consider, but there must be a better way to reduce this to something generic, no?)
Back to the issue, I understand that you want to access the temperature of an edge as a variable defined on another edge (hope I'm right).

I have made the folloving simple example: 2D axisymmetric application mode [htgt], I draw a rectangle from 0,0 to 0.6,1 in r,z, I set BC's axisymmetric on axis r=0 or edge #1, then define a temperature gradient along the top and bottom of edges #2,3 such as 300[K]+100[K]*s (s is the arc length variable, in this case defied as
¦¦s¦¦=(r[1/m]/0.6),
it has a sign (sens of the edge arrows), so this must be carefully checked, but in our case they go the same way), edge # 4 is untouched.
I mesh and solve by default and get a nice rainbow image of the temperature distribution.

Then I plot the value T along edge "1" respectively "4" with the function "Postprocessing - Domain Plot Parameters", in the General-tab I select keep current plot, and Line/Extrusion-tab: I want the variable T, I define "x" axis data either "z" or arc length (="s") as in this case they are parallel, and I plot once by selecting edge "1", then selecting edge "4", I get two opposite non linear functions expressing the temperature along the edge length.

I understand that you want to get the temperature values T on the axis (r=0, edge "1") defined on the outer boundary "4" such to calculate an expression for the heat source there.

For this I would use the "Options - Extrusion Coupling Variables - Boundary Variables" I select the source boundary "1" along r=0, define a Name i.e. T00 and an expression T for the temperature as defined on this boundary. I select "General transformation" and use "z" as source transformation variable (COMSOL help: might I use s ?). Then I select the destination tab: select "Level": "boundary" , I tick and select boundary "4" and set the destination transformation as "z" (or s?, but z works as we are aligned). This will define on boundary "4" the variable T00 being the value of the tempature on the axis at the same height "z" (or projection along s?).

Now you can define on boundary "4" any heat sorce based on the difference of temperature (T-T00).

You can check this by plotting with the same commands the variables T on boundaries 1 and 4 (separately by keeping the plot), and T00 on boundary 4 (as it is not defined anywhere else).

Now what if you do not want it on the edge "4", but all over the subdomain "1", I would try (and it worked for me in this case aligned with the coordinate) to select in the extrusion destination "Level" "sub-domain", and set in "1" the destination transformation as "z" (not s now as "s" is only defined on boundaries=edges=lines). In this way in fact boundary "4" gets by "proximity" also defined the variable T00 (COMSOL help: I'm I right?)

So does this help ?

There are quite some info in the documentation files on these extrusion variables, they are very usefull, but I find it still long to define, as the GUIs do not tell the full story, I'm always missing a full mathematical link as you have nice equations to help us on (most of) the PDE GUI's, I had to "sleep over a night" to find this one (I slept well anyhow ;).

Have fun
Ivar
Hi it took me some time to figure out a potential way, basically (COMSOL developper this is for you :) because when I go into the integration and coupling variables, I constantly have to switch forth and back from the help and the programm to verify my correct understanding of the variables you use, it would be MUCH easier for us if you add the definitions, and/or the mathematical equations you are using (arclength = s, boundary integration is over "s" dl or, subdomain integration over dx dy, or dr dz ... extrusion (x) = int over y of f(x,y) etc. I agree there are many cases to consider, but there must be a better way to reduce this to something generic, no?) Back to the issue, I understand that you want to access the temperature of an edge as a variable defined on another edge (hope I'm right). I have made the folloving simple example: 2D axisymmetric application mode [htgt], I draw a rectangle from 0,0 to 0.6,1 in r,z, I set BC's axisymmetric on axis r=0 or edge #1, then define a temperature gradient along the top and bottom of edges #2,3 such as 300[K]+100[K]*s (s is the arc length variable, in this case defied as ¦¦s¦¦=(r[1/m]/0.6), it has a sign (sens of the edge arrows), so this must be carefully checked, but in our case they go the same way), edge # 4 is untouched. I mesh and solve by default and get a nice rainbow image of the temperature distribution. Then I plot the value T along edge "1" respectively "4" with the function "Postprocessing - Domain Plot Parameters", in the General-tab I select keep current plot, and Line/Extrusion-tab: I want the variable T, I define "x" axis data either "z" or arc length (="s") as in this case they are parallel, and I plot once by selecting edge "1", then selecting edge "4", I get two opposite non linear functions expressing the temperature along the edge length. I understand that you want to get the temperature values T on the axis (r=0, edge "1") defined on the outer boundary "4" such to calculate an expression for the heat source there. For this I would use the "Options - Extrusion Coupling Variables - Boundary Variables" I select the source boundary "1" along r=0, define a Name i.e. T00 and an expression T for the temperature as defined on this boundary. I select "General transformation" and use "z" as source transformation variable (COMSOL help: might I use s ?). Then I select the destination tab: select "Level": "boundary" , I tick and select boundary "4" and set the destination transformation as "z" (or s?, but z works as we are aligned). This will define on boundary "4" the variable T00 being the value of the tempature on the axis at the same height "z" (or projection along s?). Now you can define on boundary "4" any heat sorce based on the difference of temperature (T-T00). You can check this by plotting with the same commands the variables T on boundaries 1 and 4 (separately by keeping the plot), and T00 on boundary 4 (as it is not defined anywhere else). Now what if you do not want it on the edge "4", but all over the subdomain "1", I would try (and it worked for me in this case aligned with the coordinate) to select in the extrusion destination "Level" "sub-domain", and set in "1" the destination transformation as "z" (not s now as "s" is only defined on boundaries=edges=lines). In this way in fact boundary "4" gets by "proximity" also defined the variable T00 (COMSOL help: I'm I right?) So does this help ? There are quite some info in the documentation files on these extrusion variables, they are very usefull, but I find it still long to define, as the GUIs do not tell the full story, I'm always missing a full mathematical link as you have nice equations to help us on (most of) the PDE GUI's, I had to "sleep over a night" to find this one (I slept well anyhow ;). Have fun Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 5, 2009, 6:56 a.m. EDT
Hi,

Thanks a lot for your devotion and explanation in order to help me. Using Extrusion Coupling Variables on boundaries is exactly what I need. So I resolve my modelling problem.

For the next time, I would be more explicit to present my model.

Bye,

Gabriel
Hi, Thanks a lot for your devotion and explanation in order to help me. Using Extrusion Coupling Variables on boundaries is exactly what I need. So I resolve my modelling problem. For the next time, I would be more explicit to present my model. Bye, Gabriel

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 28, 2011, 8:45 a.m. EST
Hi Ivar

I've been trying to get my head around the various forms of coupling variables that COMSOL can provide. I had a look at the short example you provided above and I think it's helped me somewhat. I was wondering if it is possible to make use of these integration/extrusion/projection variables in a transient analysis? There doesn't seem to be an example of that form anywhere. I'm using a combination of Navier-Stokes (ns) and Moving Mesh (ale).
Hi Ivar I've been trying to get my head around the various forms of coupling variables that COMSOL can provide. I had a look at the short example you provided above and I think it's helped me somewhat. I was wondering if it is possible to make use of these integration/extrusion/projection variables in a transient analysis? There doesn't seem to be an example of that form anywhere. I'm using a combination of Navier-Stokes (ns) and Moving Mesh (ale).

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 28, 2011, 8:45 a.m. EST
Hi Ivar

I've been trying to get my head around the various forms of coupling variables that COMSOL can provide. I had a look at the short example you provided above and I think it's helped me somewhat. I was wondering if it is possible to make use of these integration/extrusion/projection variables in a transient analysis? There doesn't seem to be an example of that form anywhere. I'm using a combination of Navier-Stokes (ns) and Moving Mesh (ale).
Hi Ivar I've been trying to get my head around the various forms of coupling variables that COMSOL can provide. I had a look at the short example you provided above and I think it's helped me somewhat. I was wondering if it is possible to make use of these integration/extrusion/projection variables in a transient analysis? There doesn't seem to be an example of that form anywhere. I'm using a combination of Navier-Stokes (ns) and Moving Mesh (ale).

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 Feb 28, 2011, 9:06 a.m. EST
Hi

coupling variables are solution independent so they can be used for any case I would say.
Now projection and extrusion coupling variables are (I find) less intuitive, and trickier to apply, but essential in many cases.

I'm still searching for simple examples to illustrate them.

Perhaps some other users have some good "simple" examples to illustrate their use to post here or top add to the model exchange ?

I believe part of the issue is the lack of correct and true understanding, by most users, of the implicit conventions used when writing out a formula in COMSOL.

When are they global, or local, or defined per (x,y,z), or per elementary mesh element dx*dy*dz ?

My way around is to study the units but the implicit "function of (x,y,z) I find is not obvious to feel/see)


--
Good luck
Ivar
Hi coupling variables are solution independent so they can be used for any case I would say. Now projection and extrusion coupling variables are (I find) less intuitive, and trickier to apply, but essential in many cases. I'm still searching for simple examples to illustrate them. Perhaps some other users have some good "simple" examples to illustrate their use to post here or top add to the model exchange ? I believe part of the issue is the lack of correct and true understanding, by most users, of the implicit conventions used when writing out a formula in COMSOL. When are they global, or local, or defined per (x,y,z), or per elementary mesh element dx*dy*dz ? My way around is to study the units but the implicit "function of (x,y,z) I find is not obvious to feel/see) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 3, 2011, 9:39 a.m. EST
Thanks for the reply, I appreciate the advice.

I'm starting to wonder if indeed a coupling variable is what I require for my situation. Essentially, what I need COMSOL to do is allow an outflow boundary to alter it's size according to the behaviour of the fluid near it, since the top edge (s=1) is a free surface and the bottom edge is a sliding wall. I'm looking for an equilibrium to be achieved between the mass of fluid flowing out of the boundary and the body forces and the effect of the sliding wall on the fluid in the domain. Is there some variable designated in COMSOL for the width of a boundary, that can be used in the boundary condition to allow it to move in this way? I hope you can make sense of my explanation here, if not I'l try again, but any tips or ideas you could provide would be a great help.
Thanks for the reply, I appreciate the advice. I'm starting to wonder if indeed a coupling variable is what I require for my situation. Essentially, what I need COMSOL to do is allow an outflow boundary to alter it's size according to the behaviour of the fluid near it, since the top edge (s=1) is a free surface and the bottom edge is a sliding wall. I'm looking for an equilibrium to be achieved between the mass of fluid flowing out of the boundary and the body forces and the effect of the sliding wall on the fluid in the domain. Is there some variable designated in COMSOL for the width of a boundary, that can be used in the boundary condition to allow it to move in this way? I hope you can make sense of my explanation here, if not I'l try again, but any tips or ideas you could provide would be a great help.

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 Mar 3, 2011, 10:11 a.m. EST
Hi

there is a wall offset value somewhere but fluidics is not my main domain, so I have not used it and do no know if its related to what you are looking for. Check the doc

--
Good luck
Ivar
Hi there is a wall offset value somewhere but fluidics is not my main domain, so I have not used it and do no know if its related to what you are looking for. Check the doc -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 6, 2012, 5:27 p.m. EDT
Hi! I am having some trouble with co-ordinate transformations in comsol. I have a 3D simulation that I've done using cartesian co-ordinates. I want to be abe able to visualize my results in a cylindrical co-ordinate system. Is that possible? This is because, I have an annular 3D element which is a certain sector angle.

I'd be really appreciative if you guys can help me with your thoughts/suggestions.

Thanks,
Rohini
Hi! I am having some trouble with co-ordinate transformations in comsol. I have a 3D simulation that I've done using cartesian co-ordinates. I want to be abe able to visualize my results in a cylindrical co-ordinate system. Is that possible? This is because, I have an annular 3D element which is a certain sector angle. I'd be really appreciative if you guys can help me with your thoughts/suggestions. Thanks, Rohini

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 Apr 7, 2012, 5:47 a.m. EDT
Hi

you cannot refer to your corrdinate system by drop downs in the postprocessing, BUT you CAN access them by there names sys2.r, sys2.phi etc (in v4, forgotten their naming in 3.5 but there are there somewhere ;), or you make you own Definitions variables and plot according to these ones, or you write out your equations in the plot views such as sqrt(u^2+v^2) for dr in the XY plane (solid displacements) ...

--
Good luck
Ivar
Hi you cannot refer to your corrdinate system by drop downs in the postprocessing, BUT you CAN access them by there names sys2.r, sys2.phi etc (in v4, forgotten their naming in 3.5 but there are there somewhere ;), or you make you own Definitions variables and plot according to these ones, or you write out your equations in the plot views such as sqrt(u^2+v^2) for dr in the XY plane (solid displacements) ... -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 7, 2012, 11:28 a.m. EDT
Thanks Ivar. I was doing that indeed. Putting in expressions such as x^2 + y^2 for obtaining the radial component. Not really clear about how to obtain the tangential components of my velocity fields. Under the list of expressions, I do see transformation matrices between coordinate systems , but not sure how to feed those values.

Alternatively, is there any way to set up my 3D geometry in a cylindrical co-ordinate system rather than a cartesian system? I don't have axisymmetry in my model, so cylindrical isn't the natural choice.

Thanks for your help,
Rohini
Thanks Ivar. I was doing that indeed. Putting in expressions such as x^2 + y^2 for obtaining the radial component. Not really clear about how to obtain the tangential components of my velocity fields. Under the list of expressions, I do see transformation matrices between coordinate systems , but not sure how to feed those values. Alternatively, is there any way to set up my 3D geometry in a cylindrical co-ordinate system rather than a cartesian system? I don't have axisymmetry in my model, so cylindrical isn't the natural choice. Thanks for your help, Rohini

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.