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.

Access parameters of assigned materials

Please login with a confirmed email address before reporting spam

Hello everybody,

for a simulation model, I use a number of user defined material parameters and functions, which are stored in the material model. The parameters and functions are used to compute different physical properties. At the moment, I use the the standard formulation mat1.def.etc. to access the values. In the future a material library shall be used, so that the materials for the simulation can be changed quickly. If a new material is added, it gets the new identifier mat2, instead of mat1, so the first material has to be removed first, before a new material is added.

My question is, is there a function or operator to access the material properties of the material, that is assigned to a specific domain? I know, that there is the option "from material" e. g. for the young's modulus in the solid mechanics module but I want to use different specific functions in different domains, so that I have to access the parameters directly.

4 Replies Last Post 23 févr. 2012, 16:18 UTC−5
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 23 févr. 2012, 15:35 UTC−5
Hi

I'm not sure I fully catch you, but lets say you have 2 materials (defined in the material nodes, and assigned one to each domain) then in the formulas you access these i.e. solid.rho which is mapped automatically to mat1.def.rho and respectively mat2.def.rho for domain 2 (asuming mat1 is on domain 1 ...)

by using the physics (i.e. solid) generic name for a material property i.e. solid.rho you leave to COMSOL to sort out the mapping how to extract the value. Note that solid.rho is in fact a field solid.rho(x,y,z,t) and the density might not be constant over a domain

There are many of these implicit fields with the COMOSL notation, in the biginning I found it confusing, but once you catch it you get used to it ;)

Note that mat1.def.rho is specifying the domain, in some sens and it you address your rho like that be sure it applies only to the domain mapped by "mat1"

--
Good luck
Ivar
Hi I'm not sure I fully catch you, but lets say you have 2 materials (defined in the material nodes, and assigned one to each domain) then in the formulas you access these i.e. solid.rho which is mapped automatically to mat1.def.rho and respectively mat2.def.rho for domain 2 (asuming mat1 is on domain 1 ...) by using the physics (i.e. solid) generic name for a material property i.e. solid.rho you leave to COMSOL to sort out the mapping how to extract the value. Note that solid.rho is in fact a field solid.rho(x,y,z,t) and the density might not be constant over a domain There are many of these implicit fields with the COMOSL notation, in the biginning I found it confusing, but once you catch it you get used to it ;) Note that mat1.def.rho is specifying the domain, in some sens and it you address your rho like that be sure it applies only to the domain mapped by "mat1" -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23 févr. 2012, 15:53 UTC−5
Ok, I'll try to make a bit clearer. I have a geometry with 2 domains, both use the same material, but they have different physical properties (one is powder, on is dense) which are computed via different functions for the physical values. An example: The density rho is rho(T) for domain one, but (1-abc)*rho(T) for domain 2. abc is stored a local parameter under the material node in the def group, so the formula I entered for rho in domain 2 looks like (1-mat1.def.abc)*mat1.def.rho(T). Instead of mat1.def. is there a possibility to tell Comsol to use the specific parameter abc of the material that is assigned to the domain, maybe something like assignedmaterial.def? I could use two different materials, but I'd prefer to use just one material definition.

It would just be convinient for the later user of the model, if he could just assign a different material to the geometry and if he had not to delete the first material in the first place and then add the new material.
Ok, I'll try to make a bit clearer. I have a geometry with 2 domains, both use the same material, but they have different physical properties (one is powder, on is dense) which are computed via different functions for the physical values. An example: The density rho is rho(T) for domain one, but (1-abc)*rho(T) for domain 2. abc is stored a local parameter under the material node in the def group, so the formula I entered for rho in domain 2 looks like (1-mat1.def.abc)*mat1.def.rho(T). Instead of mat1.def. is there a possibility to tell Comsol to use the specific parameter abc of the material that is assigned to the domain, maybe something like assignedmaterial.def? I could use two different materials, but I'd prefer to use just one material definition. It would just be convinient for the later user of the model, if he could just assign a different material to the geometry and if he had not to delete the first material in the first place and then add the new material.

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 23 févr. 2012, 16:14 UTC−5
Hi

I'm not next to my COMSOL WS so I cannot check, but, if I read you correctly) cannt you define the same material for both domains then in the first physics node (for solid it would be linear material node) you select
Density rho user defined and try something like: rho*(1+abc*(dom==1)) or use an "if()" operator

or you define 2 lienar material nodes, andwhere you need to use the abc variable you replace the material value by your User defined formula

Pls check carefully e.g. by loading the initial values (solver Dependent variables node => Compute to selected) and by plotting "rho" over both domains

--
Good luck
Ivar
Hi I'm not next to my COMSOL WS so I cannot check, but, if I read you correctly) cannt you define the same material for both domains then in the first physics node (for solid it would be linear material node) you select Density rho user defined and try something like: rho*(1+abc*(dom==1)) or use an "if()" operator or you define 2 lienar material nodes, andwhere you need to use the abc variable you replace the material value by your User defined formula Pls check carefully e.g. by loading the initial values (solver Dependent variables node => Compute to selected) and by plotting "rho" over both domains -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23 févr. 2012, 16:18 UTC−5
Hm, that's an interesting idea. I'll give it a try.

Thank a lot :-)
Hm, that's an interesting idea. I'll give it a try. Thank a lot :-)

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.