Access to material properties in Body Force section

Numerical methods and mathematical models of Elmer
Post Reply
aminer2k
Posts: 20
Joined: 14 Dec 2009, 00:34
Location: Northern California, USA

Access to material properties in Body Force section

Post by aminer2k »

Hello,
I am having trouble finding out how to use material properties, such as density within the .sif file section 'Body Force'. For example to apply a heat source when using HeatSolve, the heat source h should be in units of W/kg. I would like to apply my user heat source A, with units of W/m^3, but need to divide by density. If my density is a function of temperature, as defined in the materials section, I need to access to the actual density across the domain, which varys node by node, since the temperature varies node by node. Any guidance on a method to get access to the material property fields across the domain from within the body force section? I can get access to Temperature or Potential by using the 'Exported Variable' approach described in this forum, but not material properties.
Thank you
aminer2k
Posts: 20
Joined: 14 Dec 2009, 00:34
Location: Northern California, USA

Re: Access to material properties in Body Force section

Post by aminer2k »

I may have found an approach that works. In order to get access to the material properties as regular variables elsewhere in the .sif, it looks like I need to run 'SaveScalars' ' SaveMaterials' solver first. It looks like this evaluates any material property listed there, and sets it as a nodal variable that is now available to reference in subsequent solvers, just as potential and temperature are. It appears that by doing this, 'density' can then be used as part of the equation for Heat Source in HeatSolve. If there is a better way to do this, or any other guidance, please let me know,
Thanks!
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Access to material properties in Body Force section

Post by raback »

Hi

Yes, this is somewhat problematic. One solution is to define a MATC function for the density and use it for the epression of density and heat source as well.

The choice of units for "Heat Source" has been somewhat unlucky. This is not the first time the question has popped up. Maybe there could be an alternate keyword for the W/m^3 units.

It would technically be quite a little change to enable expressions such as

Code: Select all

Heat Source = Variable Temperature, Density 
  Real MATC ...
If the the string "Density" would not be a field it would be sought as a material parameter. Unfortunately this could introduce some hard-to-track problems. So far there has not been any constraint that a variable and material parameter could not have the same name.

Above the string "Variable" initiates the correct mode for the internal "GetReal" commands. Perhaps one could introduce some additional string for these more generic case...

Any thoughts?

-Peter
Post Reply