<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <atom:link href="http://www.comsol.eu/community/forums/general/rss/thread/3689.rss" rel="self" type="application/rss+xml"/>
  <title>COMSOL Forums: Parametric run and material library</title>
  <link>http://www.comsol.eu/community/forums/general/thread/3689/</link>
  <description>Most recent forum messages</description>
  <pubDate>Wed, 10 Mar 2010 06:23:53 +0000</pubDate>
  <image>
   <title>COMSOL Forums: Parametric run and material library</title>
   <url>http://www.comsol.eu/shared/images/logos/comsol_logo.gif</url>
   <link>http://www.comsol.eu/community/forums/general/thread/3689/</link>
  </image>
  <item>
   <title>Re: Parametric run and material library</title>
   <link>http://www.comsol.eu/community/forums/general/thread/3689/#p9617</link>
   <description>Hi&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
first for the param of the solver, I got confused by your question so this is probably not 100% related:&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
COMSOL asks for a monotonously increasing decreasing parameter value for the first element (if multiple parameters the second might not be monotonous inc/dec) so if you want to use the parametric solver, always check that your value is not repeating or changing derivative, its by design, and is written in the doc&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
--------------&lt;br /&gt;&#13;
for the material, I agree there is a double index in the system when you define a material attached to a domain, and the material is coming from the library you get a first pointer to the material in your model material database of the type mat1_variablename mat2_variablename ...  see the &amp;quot;lib.mat{1}. ...&amp;quot;&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
the easiest is to dump your file in &amp;quot;.m format, or look into the &amp;quot;history file&amp;quot;&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
The materials might have constant values or piecewise functions &amp;quot;fcns{1}. ...&amp;quot; that are defined as you can see below&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
If you want to access them in matlab the easist is to study how COMSOL is using them and do the same &lt;br /&gt;&#13;
&lt;br /&gt;&#13;
% Library materials&lt;br /&gt;&#13;
clear lib&lt;br /&gt;&#13;
lib.mat{1}.name='1006 (UNS G10060)';&lt;br /&gt;&#13;
lib.mat{1}.varname='mat1';&lt;br /&gt;&#13;
lib.mat{1}.variables.nu='nu(T[1/K])';&lt;br /&gt;&#13;
lib.mat{1}.variables.res='res(T[1/K])[ohm*m]';&lt;br /&gt;&#13;
lib.mat{1}.variables.E='E(T[1/K])[Pa]';&lt;br /&gt;&#13;
lib.mat{1}.variables.CTE='CTE(T[1/K])[1/K]';&lt;br /&gt;&#13;
lib.mat{1}.variables.sigma='sigma(T[1/K])[S/m]';&lt;br /&gt;&#13;
lib.mat{1}.variables.dL='dL(T[1/K])-dL(Tempref[1/K])';&lt;br /&gt;&#13;
lib.mat{1}.variables.alpha='alpha(T[1/K])[1/K]+(Tempref-293[K])/(T-Tempref)*(alpha(T[1/K])[1/K]-alpha(Tempref[1/K])[1/K])';&lt;br /&gt;&#13;
lib.mat{1}.variables.C='C(T[1/K])[J/(kg*K)]';&lt;br /&gt;&#13;
lib.mat{1}.variables.kappa='kappa(T[1/K])[Pa]';&lt;br /&gt;&#13;
lib.mat{1}.variables.mu='mu(T[1/K])[Pa]';&lt;br /&gt;&#13;
lib.mat{1}.variables.rho='rho(T[1/K])[kg/m^3]';&lt;br /&gt;&#13;
lib.mat{1}.variables.k='k(T[1/K])[W/(m*K)]';&lt;br /&gt;&#13;
clear fcns&lt;br /&gt;&#13;
fcns{1}.type='piecewise';&lt;br /&gt;&#13;
fcns{1}.name='dL(T)';&lt;br /&gt;&#13;
fcns{1}.extmethod='const';&lt;br /&gt;&#13;
fcns{1}.subtype='poly';&lt;br /&gt;&#13;
fcns{1}.expr={{'0','-0.002967403','1','1.81617E-5','2','-9.276156E-8','3', ...&lt;br /&gt;&#13;
  '2.54081E-10'},{'0','-0.002341855','1','4.083948E-6','2','1.512293E-8','3', ...&lt;br /&gt;&#13;
  '-6.083782E-12'}};&lt;br /&gt;&#13;
fcns{1}.intervals={'91.0','215.0','960.0'};&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
.....&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
the assignment onto your domain is done here for the first, respectively the second sub-domains defined within the {firstdomain, secondomain} (I added just 2 sub-domains) in this model. &lt;br /&gt;&#13;
For some parameters obviously the material data was not defined and you get the default cnstants, &lt;br /&gt;&#13;
&lt;br /&gt;&#13;
SO in V3.5a ALWAYS CHECK ALL YOUR VARIABLES WHEN YOU IMPORT A LIBRARY MATERIAL &lt;br /&gt;&#13;
&lt;br /&gt;&#13;
as you migh have some variables not defined in the library and they then take the default steel or copper values, this is sometime misleading.  From my understanding this default approach is no longer there in V4, you will get error messages if you forget to define a merial constant/variable, I prefer that way&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
%&lt;br /&gt;&#13;
equ.rho = {'mat2_rho(T[1/K])[kg/m^3]','mat1_rho(T[1/K])[kg/m^3]'};&lt;br /&gt;&#13;
equ.E = {'mat2_E(T[1/K])[Pa]','mat1_E(T[1/K])[Pa]'};&lt;br /&gt;&#13;
equ.nu = {0.33,'mat1_nu(T[1/K])'};&lt;br /&gt;&#13;
equ.mu = {8e5,'mat1_mu(T[1/K])[Pa]'};&lt;br /&gt;&#13;
equ.alpha = {'mat2_alpha(T[1/K])[1/K]+(Tempref_smps-293[K])/(T-Tempref_smps)*(mat2_alpha(T[1/K])[1/K]-mat2_alpha(Tempref_smps[1/K])[1/K])', ...&lt;br /&gt;&#13;
  'mat1_alpha(T[1/K])[1/K]+(Tempref_smps-293[K])/(T-Tempref_smps)*(mat1_alpha(T[1/K])[1/K]-mat1_alpha(Tempref_smps[1/K])[1/K])'};&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Sometimes the Tempref gives you some surprises it is the reference temperature for the linear expansion used in the structural application module mainly&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
In the matrial librbay display you can &amp;quot;easily&amp;quot; plot the data (unfortunately the units are not shown on the graphs)&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
hope this helps&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
good luck&lt;br /&gt;&#13;
Ivar&lt;br /&gt;&#13;
</description>
   <pubDate>Wed, 10 Mar 2010 06:23:53 +0000</pubDate>
   <guid isPermaLink="false">3689.1268202233.9617</guid>
  </item>
  <item>
   <title>Re: Parametric run and material library</title>
   <link>http://www.comsol.eu/community/forums/general/thread/3689/#p9590</link>
   <description>Hi and thank you, Ivar.&lt;br /&gt;&#13;
Maybe I was not accurate enough. Those parameters are easy when it have been defined by user, but i don't have glue what is param name for material library name. Name which defines which material properties/functions Comsol picks from material library. Example air, water, cement etc. This would be good to know for example if we are comparing different materials with different loads at structure mechanism.&lt;br /&gt;&#13;
Probably this would be easier to work from Matlab, but that is not possible.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Why first parameter must be monotonously increasing/decreasing?&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Sincerely,&lt;br /&gt;&#13;
Matti Tähtinen</description>
   <pubDate>Tue, 09 Mar 2010 13:59:26 +0000</pubDate>
   <guid isPermaLink="false">3689.1268143166.9590</guid>
  </item>
  <item>
   <title>Re: Parametric run and material library</title>
   <link>http://www.comsol.eu/community/forums/general/thread/3689/#p9587</link>
   <description>Hi&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
there is another discussion somewhere on the forum about multiple parameters&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
If I remember right in the GUI you set &lt;br /&gt;&#13;
&lt;br /&gt;&#13;
param name: param1 param2 ...&lt;br /&gt;&#13;
param value: 1 2 ...  3 4 ...  4 5 ...&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
in pairs for 2, or triplets for 3 ...&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Just be aware that the FIRST parameter must be monotonously increasing (or decreasing)&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Good luck&lt;br /&gt;&#13;
Ivar&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
</description>
   <pubDate>Tue, 09 Mar 2010 12:10:38 +0000</pubDate>
   <guid isPermaLink="false">3689.1268136638.9587</guid>
  </item>
  <item>
   <title>Parametric run and material library</title>
   <link>http://www.comsol.eu/community/forums/general/thread/3689/#p9575</link>
   <description>Hi,&lt;br /&gt;&#13;
I am trying to model pipe with heat flux. One inlet, one outlet and two heat elements. Two inlet speeds and two different material properties for flow (water and air). I use Comsol material library.&lt;br /&gt;&#13;
I know how to use one parameter:&lt;br /&gt;&#13;
Parametric name : inlet&lt;br /&gt;&#13;
Parametric values : {0.5 1.0}&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
But how to use two parameters? And what is &amp;quot;parameter name&amp;quot; for material?&lt;br /&gt;&#13;
I have tried multiple ways... :) Maybe I don't understand syntax properly...&lt;br /&gt;&#13;
Should it parametric name be defined like lib.mat{1}.name='material', ns_mat1 or cc_mat1?&lt;br /&gt;&#13;
How material is defined to parametric values? {'air' 'water'} doesn't work..&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I hope and fear that this has some trivial answer.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Thank for you help,&lt;br /&gt;&#13;
Matti Tähtinen&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
</description>
   <pubDate>Tue, 09 Mar 2010 10:57:50 +0000</pubDate>
   <guid isPermaLink="false">3689.1268132270.9575</guid>
  </item>
 </channel>
</rss>

