12#ifndef BELFEM_CL_MATERIAL_ALLOY_HPP
13#define BELFEM_CL_MATERIAL_ALLOY_HPP
41 const real mInvLog10 = 1.0 / std::log(10.0);
43 bool mComputeTables = true ;
46 Alloy(
const string & aName,
47 const bool aBuildTables =
true );
49 Alloy(
const string & aName,
50 const Cell< std::pair< string, real > > & aComponents,
52 const bool aBuildTables =
true );
113 update_volume_fractions(
const real T );
116 create_component(
const string & aName );
128 populate_rho_database();
134 populate_rho_database_serial() ;
137 save_rho_database(
const std::string & aPath );
140 load_rho_database(
const std::string & aPath );
147 BELFEM_ASSERT( mRhoData !=
nullptr,
"lookup table for rho is not initialized" ) ;
149 real theta = std::clamp( T, mDatabaseTmin, mDatabaseTmax );
150 real log10B = std::log(std::clamp( B, mDatabaseBmin, mDatabaseBmax ) )*mInvLog10 ;
153 return std::exp(mRhoData->evaluate( theta, log10B, angle )) ;
159 BELFEM_ASSERT( mRhoData !=
nullptr,
"lookup table for rho is not initialized" ) ;
161 real theta = std::clamp( T, mDatabaseTmin, mDatabaseTmax );
162 real log10B = std::log(std::clamp( B, mDatabaseBmin, mDatabaseBmax ) )*mInvLog10 ;
165 real y = mRhoData->evaluate( theta, log10B, angle ) ;
166 real dydT = mRhoData->evaluate_derivx( theta, log10B, angle ) ;
167 return std::exp( y ) * dydT ;
175 BELFEM_ASSERT( mRhoData !=
nullptr,
"lookup table for rho is not initialized" ) ;
177 real theta = std::clamp( T, mDatabaseTmin, mDatabaseTmax );
178 real Bc = std::clamp( B, mDatabaseBmin, mDatabaseBmax ) ;
180 real log10B = std::log( Bc )*mInvLog10 ;
183 real y = mRhoData->evaluate( theta, log10B, angle ) ;
184 real dydlogB = mRhoData->evaluate_derivy( theta, log10B, angle ) ;
186 return std::exp( y ) * dydlogB * mInvLog10 / Bc ;
192 BELFEM_ASSERT( mRhoData !=
nullptr,
"lookup table for rho is not initialized" ) ;
194 real theta = std::clamp( T, mDatabaseTmin, mDatabaseTmax );
195 real Bc = std::clamp( B, mDatabaseBmin, mDatabaseBmax ) ;
197 real log10B = std::log( Bc )*mInvLog10 ;
200 real y = mRhoData->evaluate( theta, log10B, angle ) ;
201 real dydbeta = mRhoData->evaluate_derivz( theta, log10B, angle ) ;
203 return std::exp( y ) * dydbeta ;
209 return this->
lambda( T ) * this->
rho( T ) / this->
rho( T, B, beta );
217 real c = this->
rho( T, B, beta );
223 return ( c * ( da*b + a * db ) - a * b * dc ) /( c * c );
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
Precomputed lookup table on a tensor grid; evaluation, derivatives and HDF5 persistence.
Definition cl_Database.hpp:30
virtual real rho(const real T) const
Electrical resistivity (isotropic).
Definition cl_Material.hpp:2038
virtual real lambda(const real T=gTroom) const
Thermal conductivity (isotropic).
Definition cl_Material.hpp:1912
virtual real drhodT(const real T) const
Definition cl_Material.hpp:2049
virtual real dlambdadT(const real T=gTroom) const
Definition cl_Material.hpp:1927
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
Third- or fourth-order tensor container; the constitutive helpers (contraction, rotation,...
Definition cl_Tensor.hpp:43
Alloy(const string &aName, const bool aBuildTables=true)
Definition cl_Material_Alloy.cpp:35
real drhodB(const real T, const real B, const real beta) const override
Definition cl_Material_Alloy.hpp:173
real dlambdadT(const real T, const real B, const real beta) const override
Definition cl_Material_Alloy.hpp:213
real lambda(const real T, const real B, const real beta) const override
Thermal conductivity with magnetoresistance.
Definition cl_Material_Alloy.hpp:207
void set_components(const Cell< string > &aComponents, const Vector< real > &aMassFractions, const real RRR=BELFEM_QUIET_NAN)
Definition cl_Material_Alloy.cpp:126
real drhodT(const real T, const real B, const real beta) const override
Definition cl_Material_Alloy.hpp:157
real drhodbeta(const real T, const real B, const real beta) const override
Definition cl_Material_Alloy.hpp:190
real rho(const real T, const real B, const real beta) const override
Electrical resistivity with magnetoresistance (Kohler's rule).
Definition cl_Material_Alloy.hpp:145
SplineLookupTable(const MaterialType aType, const bool aIsIsotropic=true)
Definition cl_Material_SplineLookupTable.cpp:17
const real pi
circle number
Definition constants.hpp:41
Definition cl_BhCurve.cpp:19
USER GUIDES:
Definition cl_Capacitor.cpp:16
@ RRR
Definition cl_Material.hpp:182
double real
Definition typedefs.hpp:36
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:87