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.

How to link global material properties to dependent variables at the component level?

Please login with a confirmed email address before reporting spam

I have a model with two components, and would like to link a material in each component to a global material (blood). Some blood properties, such as viscosity, are calculated from dependent variables within the model component. I can define these dependent variables as Local Properties of the material, however, Local Properties seem to be a feature only of the global material and are not available in the linked material. Thus they become undefined at the global level and there doesn't seem to be a way to link them to the dependent variables in each component.

My workaround is to move the material to the component level and duplicate it for each component, but this defeats the advantages of having global materials. Is this the only possible approach? If not, could someone provide guidance?

--
Steven Conrad, MD PhD
LSU Health

5 Replies Last Post 2016年7月6日 GMT-4 23:53
Linus Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年6月23日 GMT-4 04:26
Hi Steven,

A simple way to give the components control over the local properties in a global material is to have them define these same properties with a global scope. I am attaching a dummy example with a global material whose density depends on the temperature, "T". In Component 1, I have set up a variable called root.T, with the value 300[K]. In Component 2, I am instead defining root.T as the dependent variable T. The result is a density which in Component 1 evaluates to a constant and in Component 2 follows the temperature distribution.

I hope this helps! If not, please contact support with a model demonstrating the issue, and I or one of my colleagues will be happy to look at it.

Linus
Hi Steven, A simple way to give the components control over the local properties in a global material is to have them define these same properties with a global scope. I am attaching a dummy example with a global material whose density depends on the temperature, "T". In Component 1, I have set up a variable called root.T, with the value 300[K]. In Component 2, I am instead defining root.T as the dependent variable T. The result is a density which in Component 1 evaluates to a constant and in Component 2 follows the temperature distribution. I hope this helps! If not, please contact support with a model demonstrating the issue, and I or one of my colleagues will be happy to look at it. Linus


Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年6月23日 GMT-4 11:39
Linus,

This is exactly what I needed. I was not aware that I could define a globally-scoped variable at the component level, and that is what is needed to make this work.

If this issue is brought up by others, perhaps an article on the COMSOL blog might be a good idea.

Steve

--
Steven Conrad, MD PhD
LSU Health
Linus, This is exactly what I needed. I was not aware that I could define a globally-scoped variable at the component level, and that is what is needed to make this work. If this issue is brought up by others, perhaps an article on the COMSOL blog might be a good idea. Steve -- Steven Conrad, MD PhD LSU Health

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年6月24日 GMT-4 00:43
Linus,

I ran into a snag. When my two components are of different dimensions (one is axisymmetric and the other is 3D), then I get an error about duplicate variable names. I think this is likely due to the fact that I had to include the 3D physics under the 3D component as well as including the 2D axi physics under the 2D axisymmetric component.

I noticed in your example that you had the Heat Transfer physics defined only once in one of the components, but your components were of the same dimension.

Any thoughts?

--
Steven Conrad, MD PhD
LSU Health
Linus, I ran into a snag. When my two components are of different dimensions (one is axisymmetric and the other is 3D), then I get an error about duplicate variable names. I think this is likely due to the fact that I had to include the 3D physics under the 3D component as well as including the 2D axi physics under the 2D axisymmetric component. I noticed in your example that you had the Heat Transfer physics defined only once in one of the components, but your components were of the same dimension. Any thoughts? -- Steven Conrad, MD PhD LSU Health

Daniel Smith COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年6月24日 GMT-4 09:54
Hi Steve, when you defined root.T under Definitions>Variables, what was the "Geometric entity level" set to? If this is set to "Entire model", then you will get the error you reported. If it is set to "Domain>All Domains" then it should work.

Dan
Hi Steve, when you defined root.T under Definitions>Variables, what was the "Geometric entity level" set to? If this is set to "Entire model", then you will get the error you reported. If it is set to "Domain>All Domains" then it should work. Dan

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年7月6日 GMT-4 23:53
Thanks, Dan & Linus

Thanks, this appears to be working. If any further problems develop, I'll repost.

--
Steven Conrad, MD PhD
LSU Health
Thanks, Dan & Linus Thanks, this appears to be working. If any further problems develop, I'll repost. -- Steven Conrad, MD PhD LSU Health

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.