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.

Assign material properties on mesh elements

Please login with a confirmed email address before reporting spam

Dear all.

I'm wondering if it is possible to assign different properties on different mesh elements.

Thank you for your reply in advance.

Wonseok

9 Replies Last Post 25 juil. 2016, 12:17 UTC−4
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: 2 decades ago 1 nov. 2009, 03:28 UTC−5
Hi

from my knowledge you ONLY apply the material and BC (boundary conditions) to geometries in COMSOL, then you mesh and the mesh items inheret these properties by location.

If you tink about it it's rather logical, at least I find it so

If you have imported a mesh, you need to recreate geometries from them, COMSOL is rather good to detect common surfaces and join them together, (thereafter you can set material and BC conditions on the geometries). In [V3.5a] have a look at "Mesh - Create Geometires from Mesh" and the related documentation

Good luck
Ivar
Hi from my knowledge you ONLY apply the material and BC (boundary conditions) to geometries in COMSOL, then you mesh and the mesh items inheret these properties by location. If you tink about it it's rather logical, at least I find it so If you have imported a mesh, you need to recreate geometries from them, COMSOL is rather good to detect common surfaces and join them together, (thereafter you can set material and BC conditions on the geometries). In [V3.5a] have a look at "Mesh - Create Geometires from Mesh" and the related documentation Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 2 decades ago 2 nov. 2009, 10:33 UTC−5
Hi Wonseok,
I think you can make any physical property to be dependent on the space coordinates (x,y,z, for instance).
For instance, if you want to assign a space dependent Young modulus, you just have to specify it in your subdomain settings. Call it "E" and specify its space dependence as a function written in "Options/Expressions/Sudomain expressions.
Clearly the same holds for BCs, load, initial conditions and so on.
I hope this help.

Alessandro
Hi Wonseok, I think you can make any physical property to be dependent on the space coordinates (x,y,z, for instance). For instance, if you want to assign a space dependent Young modulus, you just have to specify it in your subdomain settings. Call it "E" and specify its space dependence as a function written in "Options/Expressions/Sudomain expressions. Clearly the same holds for BCs, load, initial conditions and so on. I hope this help. Alessandro

Please login with a confirmed email address before reporting spam

Posted: 2 decades ago 2 nov. 2009, 10:41 UTC−5
Thank you for your reply.

I appreciate all.

Wonseok
Thank you for your reply. I appreciate all. Wonseok

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: 2 decades ago 3 nov. 2009, 02:51 UTC−5
Hi Allesandro

You are right that you can define "space" material properties by using bolean functions, but fomally you are defining that on the "geometries", then the meshing process is independent of the materials, but the mesh nodes inherits the properties of the domains, boundaries, or the node location linked to the bolean expressions used.

I beleive it's imporant to distinguish this clearly, even if finally for the end user, it will apear as if the mesh has a physical property.

But this is more a "high" level methodological discussion.

Have a nice day
Ivar
Hi Allesandro You are right that you can define "space" material properties by using bolean functions, but fomally you are defining that on the "geometries", then the meshing process is independent of the materials, but the mesh nodes inherits the properties of the domains, boundaries, or the node location linked to the bolean expressions used. I beleive it's imporant to distinguish this clearly, even if finally for the end user, it will apear as if the mesh has a physical property. But this is more a "high" level methodological discussion. Have a nice day Ivar

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 10 mars 2016, 18:48 UTC−5
Ivar, is COMSOL 5.2 updated such that a user can change material properties of each element? Topology Optimization is available and I believe that it utilizes this capability.
Ivar, is COMSOL 5.2 updated such that a user can change material properties of each element? Topology Optimization is available and I believe that it utilizes this capability.

Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 11 mars 2016, 14:09 UTC−5
Dear All,

This question of applying material properties to elements comes up on occasion. It is not something which you would ever truly want to do within COMSOL, or within any finite element code for that matter. Let's think about why:

A finite element problem must, by its very definition, be convergent with respect to mesh refinement. (www.comsol.com/multiphysics/mesh-refinement) Roughly speaking, as you decrease the element size (and increase the number of elements used to mesh a problem) a correctly-posed finite element model converges towards the exact solution.

Now, lets think about what would happen if in fact we did define different material properties within each mesh element. Let's suppose that we have a mesh (call in Mesh 1) with a different material property in each element. We can solve this model and get an answer. But how do we verify this answer? Through the process of mesh refinement. We will need to introduce a second mesh (Mesh2), and a third (Mesh 3), and so on and monitor how the solution converges. But the higher numbered meshes must represent the same material distribution, so these refined meshes can only be subdivisions of the original mesh. (Think about one quadrilateral element, it can get subdivided into 4,9, 16, etc... smaller quad elements.)

So we can see that our desire to apply different material properties to different elements is actually (at least in the COMSOL terminology and usage) just the desire to have a bunch of domains that happen to look like elements. Each of these domains has different properties, and as you perform a mesh refinement study you increase the number of elements in each domain. So by all means, if you want to have different material properties in different areas, do so, but just sketch a bunch of domains, apply different materials properties in each, and then perform a mesh refinement study (starting with the coarsest possible mesh where you only have one element per domain) to verify your solution.

And as some of our colleagues have pointed out, you can enter materials properties that vary as function of spatial dimensions, so expressions such as density = 1000[kg/m^3]*(1+x/0.1[m]) would make density increase with x-direction. This would introduce a spatial variation between elements, but this same expression can be used regardless of the mesh.

Lastly: With respect to topology optimization. You can, if you want to, use a discontinuous constant discretization within each element. However, within our examples we use instead a linear discretization of material properties within each element. This makes is possible to introduce a gradient-based smoothing of the fields to avoid checkboarding or mesh dependency. (see, for example: www.comsol.com/model/topology-optimization-of-an-mbb-beam-7428) Although you could introduce a discontinuous constant discretization of the material property distribution if you really wanted to, you would then need still need to address the possibility of checkerboarding and come up with a technique to avoid it and demonstrate convergence of your solution with mesh refinement.

Best Regards,
Dear All, This question of applying material properties to elements comes up on occasion. It is not something which you would ever truly want to do within COMSOL, or within any finite element code for that matter. Let's think about why: A finite element problem must, by its very definition, be convergent with respect to mesh refinement. (http://www.comsol.com/multiphysics/mesh-refinement) Roughly speaking, as you decrease the element size (and increase the number of elements used to mesh a problem) a correctly-posed finite element model converges towards the exact solution. Now, lets think about what would happen if in fact we did define different material properties within each mesh element. Let's suppose that we have a mesh (call in Mesh 1) with a different material property in each element. We can solve this model and get an answer. But how do we verify this answer? Through the process of mesh refinement. We will need to introduce a second mesh (Mesh2), and a third (Mesh 3), and so on and monitor how the solution converges. But the higher numbered meshes must represent the same material distribution, so these refined meshes can only be subdivisions of the original mesh. (Think about one quadrilateral element, it can get subdivided into 4,9, 16, etc... smaller quad elements.) So we can see that our desire to apply different material properties to different elements is actually (at least in the COMSOL terminology and usage) just the desire to have a bunch of domains that happen to look like elements. Each of these domains has different properties, and as you perform a mesh refinement study you increase the number of elements in each domain. So by all means, if you want to have different material properties in different areas, do so, but just sketch a bunch of domains, apply different materials properties in each, and then perform a mesh refinement study (starting with the coarsest possible mesh where you only have one element per domain) to verify your solution. And as some of our colleagues have pointed out, you can enter materials properties that vary as function of spatial dimensions, so expressions such as density = 1000[kg/m^3]*(1+x/0.1[m]) would make density increase with x-direction. This would introduce a spatial variation between elements, but this same expression can be used regardless of the mesh. Lastly: With respect to topology optimization. You can, if you want to, use a discontinuous constant discretization within each element. However, within our examples we use instead a linear discretization of material properties within each element. This makes is possible to introduce a gradient-based smoothing of the fields to avoid checkboarding or mesh dependency. (see, for example: http://www.comsol.com/model/topology-optimization-of-an-mbb-beam-7428) Although you could introduce a discontinuous constant discretization of the material property distribution if you really wanted to, you would then need still need to address the possibility of checkerboarding and come up with a technique to avoid it and demonstrate convergence of your solution with mesh refinement. Best Regards,

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 12 mars 2016, 16:19 UTC−5
Walter,

Thanks for the great explanation. Is there a way to give COMSOL tabulated x,y,z coordinates with the property E(x,y,z) at each point and have COMSOL interpolate the material property between these points? I am using a discontinuous function but always get errors on the boundaries due to computer rounding errors. See picture. (Also, I realize now that I should do a linear interpolation across a single element rather than keep it's properties constant. Don't mind that.).
Walter, Thanks for the great explanation. Is there a way to give COMSOL tabulated x,y,z coordinates with the property E(x,y,z) at each point and have COMSOL interpolate the material property between these points? I am using a discontinuous function but always get errors on the boundaries due to computer rounding errors. See picture. (Also, I realize now that I should do a linear interpolation across a single element rather than keep it's properties constant. Don't mind that.).


Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 14 mars 2016, 08:55 UTC−4
Dear Dustin,
Follow this: www.comsol.com/blogs/using-point-cloud-data-in-your-comsol-model/ and use the Nearest Neighbor interpolation and Nearest Function extrapolation.
If you are still having difficulties, contact your COMSOL Support Team.
Best Regards,
Dear Dustin, Follow this: http://www.comsol.com/blogs/using-point-cloud-data-in-your-comsol-model/ and use the Nearest Neighbor interpolation and Nearest Function extrapolation. If you are still having difficulties, contact your COMSOL Support Team. Best Regards,

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 25 juil. 2016, 12:17 UTC−4
Dear Walter Frei,

Is there an example that demonstrates how to assign spatially distributed properties (x,y,z) using matlab? I would like to read in my matrix as if it is a spreedsheet without needing to save it to another file.

I am also trying to sweep through several properties. Is there a way to connect each matrix/spreedsheet to a sweep variable without needing to rebuild the geometry and the mesh each time?

thank you for your help,

Carolyne
Dear Walter Frei, Is there an example that demonstrates how to assign spatially distributed properties (x,y,z) using matlab? I would like to read in my matrix as if it is a spreedsheet without needing to save it to another file. I am also trying to sweep through several properties. Is there a way to connect each matrix/spreedsheet to a sweep variable without needing to rebuild the geometry and the mesh each time? thank you for your help, Carolyne

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.