BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Material_WhiteTin.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California, through
4 * Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_CL_MATERIAL_TIN_HPP
13#define BELFEM_CL_MATERIAL_TIN_HPP
14#include "cl_Material_Metal.hpp"
15#include "cl_Bezier.hpp"
16#include "fn_polyval.hpp"
17namespace belfem
18{
19 namespace material
20 {
21 class WhiteTin : public Metal
22 {
23 // debye temperature
24 Cell< Vector< real > > mDebyePolys ;
25 Vector< real > mTDebyeSwitch ;
26
27 Bezier * mThermalExpansion = nullptr ;
28 Vector< real > mThermalExpansionCryo ;
29 Bezier * mDebyeTemperature = nullptr ;
30
31 Cell< Vector< real > > mKohlerLongPolys ;
32 Cell< Vector< real > > mKohlerTransPolys ;
33 Vector< real > mBSKohlerLongSwitch ;
34 Vector< real > mBSKohlerTransSwitch ;
35
36 public:
38 const bool aBuildTables = true );
39 ~WhiteTin() override;
40
41 protected:
42
43 real
44 alpha_custom( const real T ) const override ;
45
46 real
47 debye_custom( const real T ) const override ;
48
49 real
50 kohler( const real B, const real S, const real beta ) const override ;
51
52
53 private:
54
55 void
56 set_constants();
57
58 void
59 create_alpha();
60
61 void
62 create_cp();
63
64 void
65 create_debye();
66
67 void
68 create_kohler();
69 };
70
71 inline real
72 WhiteTin::kohler( const real B, const real S, const real beta ) const
73 {
74 if ( B < BELFEM_EPSILON ) return 0.0 ;
75
76 real BS = B * S ;
77
78 real Along ;
79
80 if ( BS < mBSKohlerLongSwitch( 0 ) )
81 {
82 Along = polyval( mKohlerLongPolys(0), BS );
83 }
84 else if ( BS < mBSKohlerLongSwitch( 1 ) )
85 {
86 Along = std::exp( polyval( mKohlerLongPolys(1), std::log(BS) ) );
87 }
88 else
89 {
90 Along = polyval( mKohlerLongPolys(2), BS );
91 }
92
93 real Atrans ;
94 if ( BS < mBSKohlerTransSwitch( 0 ) )
95 {
96 Atrans = polyval( mKohlerTransPolys(0), BS );
97 }
98 else
99 {
100 Atrans = std::exp( polyval( mKohlerTransPolys(1), std::log(BS) ) );
101 }
102
103 real c = std::cos( beta );
104 real c2 = c*c ;
105 real s2 = 1.0 - c2 ;
106
107 // Pippard's angular interpolation formula
108 return Along * c2 + Atrans * s2 ;
109 }
110 }
111}
112#endif //BELFEM_CL_MATERIAL_TIN_HPP
Definition cl_Bezier.hpp:30
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
Metal(const string &aLabel, const MaterialType aType, const bool aBuildTables=true)
Constructor.
Definition cl_Material_Metal.cpp:33
real debye_custom(const real T) const override
Definition cl_Material_WhiteTin.cpp:195
WhiteTin(const real RRR=BELFEM_QUIET_NAN, const bool aBuildTables=true)
Definition cl_Material_WhiteTin.cpp:26
real alpha_custom(const real T) const override
Definition cl_Material_WhiteTin.cpp:189
real kohler(const real B, const real S, const real beta) const override
Kohler function for magnetoresistance.
Definition cl_Material_WhiteTin.hpp:72
Evaluates a polynomial.
Definition cl_BhCurve.cpp:19
T polyval(const std::vector< T > &coeffs, const T x)
Definition cl_Material_UserDefined.hpp:28
USER GUIDES:
Definition cl_Capacitor.cpp:16
constexpr real BELFEM_EPSILON
Definition typedefs.hpp:90
@ RRR
Definition cl_Material.hpp:182
double real
Definition typedefs.hpp:36
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:87