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 a material properties in an expression

Please login with a confirmed email address before reporting spam

Hi to all

I want to use the Diffusion Coefficient ( material properties) in an expression as a coefficient of a PDE.

Since the model consisted of different material with different Diffusion coefficients, I tried to use for example tem.D ( D is the variable which is written in the table of material properties) but it didn't work.

How can I call this material properties?

P.S : I add diffusion coefficient manually to the material properties of copper ( Cu )

God bless you all and thanks for your help in advance :)


7 Replies Last Post Feb 29, 2012, 4:02 p.m. EST

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 27, 2012, 12:03 p.m. EST
Hi Mousavi,

have a look at the documentation under "About Using Materials in COMSOL".

In short, e.g. for the specific heat capacity:
root.material.Cp

or, if you want to refer to a specific material
root.mod1.mat1.def.Cp

In the line above I assumed that your "model" node has the tag "mod1". You need to change that accordingly (If you don't know the tag of the "model" node click on "view"-> " model builder node label" -> "show name and tag").
Hi Mousavi, have a look at the documentation under "About Using Materials in COMSOL". In short, e.g. for the specific heat capacity: root.material.Cp or, if you want to refer to a specific material root.mod1.mat1.def.Cp In the line above I assumed that your "model" node has the tag "mod1". You need to change that accordingly (If you don't know the tag of the "model" node click on "view"-> " model builder node label" -> "show name and tag").

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 27, 2012, 4:18 p.m. EST
Dear Julian
thanks for you reply but it didn't work by " root.material.D " ( D is the variable name for diffusion coefficient ) .

Are you sure that there is such a syntax. I know about calling a material property by " physicName.materialProperty " ( e.g density in coefficient form PDE c.rho) . This syntax works fine for other predefined properties like rho or Cp but since I've added "Diffusion coefficient" manually to the copper basic properties, I cannot call it by " c.D " .

when I call it by " tem.D " it refers to elasticity matrix which is not what i mean ( tem : joul heating and thermal expansion physic interface )


Anyway, I really appreciate your consideration :)
Dear Julian thanks for you reply but it didn't work by " root.material.D " ( D is the variable name for diffusion coefficient ) . Are you sure that there is such a syntax. I know about calling a material property by " physicName.materialProperty " ( e.g density in coefficient form PDE c.rho) . This syntax works fine for other predefined properties like rho or Cp but since I've added "Diffusion coefficient" manually to the copper basic properties, I cannot call it by " c.D " . when I call it by " tem.D " it refers to elasticity matrix which is not what i mean ( tem : joul heating and thermal expansion physic interface ) Anyway, I really appreciate your consideration :)

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, 2012, 1:02 a.m. EST
Hi

again the naming convention, it all depends on the physics ;)

For standard material properties such as E the young modulus in Solid (see image) it woks with the different names, but take note: these are not variables but fields: it is E(x,y,z,r,t) (for the Young modulus) or whatever applicable.

For the diffusion coefficient D, if you look under the equations, in CHDS physics, the Diffusion coefficient is first defined in the physics and NOT in the materials, then it is distributed to its tensor coefficient chds.Dxx, .Dyy, .Dzz, .Dxy ... (this is also the case for k the HT heat conduction and many other variables).

Therefore I always take a look at the equation view to find out how COMSOL remaps the values I give and their names. For that using the "tag" view, see the image is easier than the name and identifier, to understand the full path "root.mod1.mat1.def.E" or in shortcut generic since 4.2a "material.E" but not material.D and neither NOT material.Dxx, as its NOT defined in the material section but the physics. The latter point could be brought to supports attention, I belive they could consider that change, try to send them a mail ;)
--
Good luck
Ivar
Hi again the naming convention, it all depends on the physics ;) For standard material properties such as E the young modulus in Solid (see image) it woks with the different names, but take note: these are not variables but fields: it is E(x,y,z,r,t) (for the Young modulus) or whatever applicable. For the diffusion coefficient D, if you look under the equations, in CHDS physics, the Diffusion coefficient is first defined in the physics and NOT in the materials, then it is distributed to its tensor coefficient chds.Dxx, .Dyy, .Dzz, .Dxy ... (this is also the case for k the HT heat conduction and many other variables). Therefore I always take a look at the equation view to find out how COMSOL remaps the values I give and their names. For that using the "tag" view, see the image is easier than the name and identifier, to understand the full path "root.mod1.mat1.def.E" or in shortcut generic since 4.2a "material.E" but not material.D and neither NOT material.Dxx, as its NOT defined in the material section but the physics. The latter point could be brought to supports attention, I belive they could consider that change, try to send them a mail ;) -- Good luck Ivar


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 28, 2012, 3:16 a.m. EST
Dear Ivan

thanks for you reply.

I'm trying to couple a " tem " physic with a "PDE".

The problem is that I should use a coefficient in the PDE that the value depends on the material of the domain.
This is why i tried to add diffusion coefficient to materials but as you said I can not call it by variable name " D of Dxx ".

what do you suggest to solve it?

Thank you very much
Dear Ivan thanks for you reply. I'm trying to couple a " tem " physic with a "PDE". The problem is that I should use a coefficient in the PDE that the value depends on the material of the domain. This is why i tried to add diffusion coefficient to materials but as you said I can not call it by variable name " D of Dxx ". what do you suggest to solve it? Thank you very much

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, 2012, 3:35 a.m. EST
Hi

that is possible but the material property is only defined as a field you you need to implicitely give it an x,y,z,t input, that it define a domain or boundary selection and use the material data therein (then COMSOL takes the appropriate space coordinates.) If you have a global PDE then you need to integrate or average the material data over the corresponding entity (domain or boundary) to have a globa scalar to use in the PDE.

So coupling is possible, but one must clearly understand what is what, and by default nothing distinguishes a field from a scalar varaible in COMSOL with it's notation convention, this one must "know" and I agree it took me some time too to understand and to "know" ;)

--
Good luck
Ivar
Hi that is possible but the material property is only defined as a field you you need to implicitely give it an x,y,z,t input, that it define a domain or boundary selection and use the material data therein (then COMSOL takes the appropriate space coordinates.) If you have a global PDE then you need to integrate or average the material data over the corresponding entity (domain or boundary) to have a globa scalar to use in the PDE. So coupling is possible, but one must clearly understand what is what, and by default nothing distinguishes a field from a scalar varaible in COMSOL with it's notation convention, this one must "know" and I agree it took me some time too to understand and to "know" ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 29, 2012, 1:26 p.m. EST
Thanks Ivan

I guess I've find a solution for using a variable with different values for different domain. you can create a variable node for each domain ( or group of domains) but use the same name for the variable in each node but with different expressions!! apparently , comsol has no problem with it and I guess it works well ( though I ' ve encounter new problems ).

Anyway, thank you for your time and beneficial replies.
Thanks Ivan I guess I've find a solution for using a variable with different values for different domain. you can create a variable node for each domain ( or group of domains) but use the same name for the variable in each node but with different expressions!! apparently , comsol has no problem with it and I guess it works well ( though I ' ve encounter new problems ). Anyway, thank you for your time and beneficial replies.

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 29, 2012, 4:02 p.m. EST
Hi

but that is also because the "variables" are often fields so they are defined "locally" and the same name has a meaning for x,y,z belonging to domain 1, but you can as well add a different value to the domain 2.

when we in COMSOL select a boundary (i.e. an edge in 2D) and write a scalar value
T=20[degC] we mean in fact T(x,y,t) = 20[degC] for all x,y (or "s") belonging to the boundary and for all "t".

But we can as well write
T=20[degC/m]*x which means that T(x,y,t) changes with x and has a vaue of 0[degC] at x=0[m] and increases linearly to 20[degC] at x=1[m], and so on

This applies to most entries in COMSOL

--
Good luck
Ivar
Hi but that is also because the "variables" are often fields so they are defined "locally" and the same name has a meaning for x,y,z belonging to domain 1, but you can as well add a different value to the domain 2. when we in COMSOL select a boundary (i.e. an edge in 2D) and write a scalar value T=20[degC] we mean in fact T(x,y,t) = 20[degC] for all x,y (or "s") belonging to the boundary and for all "t". But we can as well write T=20[degC/m]*x which means that T(x,y,t) changes with x and has a vaue of 0[degC] at x=0[m] and increases linearly to 20[degC] at x=1[m], and so on This applies to most entries in COMSOL -- Good luck Ivar

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.