BELFEM 0.9.3
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Material_Metal.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,
4 * through 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_METAL_HPP
13#define BELFEM_CL_MATERIAL_METAL_HPP
14
15#include <cmath>
17#include "cl_Database.hpp"
18#include "cl_BhCurve.hpp"
19#include "cl_Bezier.hpp"
20#include "fn_polyval.hpp"
21#include "fn_dpolyval.hpp"
22#include "fn_ddpolyval.hpp"
23
24namespace belfem
25{
26 namespace material
27 {
28//------------------------------------------------------------------------------
29
46 class Metal : public SplineLookupTable
47 {
48 // Maximum values and integration limits for Debye integrals
49 real mZ3Max = 0. ;
50 real mZ4Max = 0. ;
51 real mZ5Max = 0. ;
52 real mZ6Max = 0. ;
53 real mZ7Max = 0. ;
54 real mZnMax = 0. ;
55
56 real mJ3Max = 0. ;
57 real mJ4Max = 0. ;
58 real mJ5Max = 0. ;
59 real mJ6Max = 0. ;
60 real mJ7Max = 0. ;
61 real mJnMax = 0. ;
62
63 // we need to store this to avoid log(0)
64 real mInvLog10 = 1.0/std::log( 10. ) ;
65 real mDatabaseTmin = BELFEM_QUIET_NAN ;
66 real mDatabaseTmax = BELFEM_QUIET_NAN ;
67 real mDatabaseBmin = BELFEM_QUIET_NAN ;
68 real mDatabaseBmax = BELFEM_QUIET_NAN ;
69 Database * mRhoData = nullptr ;
70 const BhCurve * mBhCurve = nullptr ;
71
72 // Coefficients for thermal conductivity model
73 Vector< real > mLambdaCoefficients ;
74
75 bool mComputeTables = true ;
76
77 real ( Metal::*mFunJ )( const real Z ) const ;
78
79 protected:
80
81 // Splines for Debye integrals J_n(θ/T)
82 Spline * mSplineJ3 = nullptr ; // ∫₀^Z x³eˣ/(eˣ-1)² dx
83 Spline * mSplineJ4 = nullptr ; // ∫₀^Z x⁴eˣ/(eˣ-1)² dx
84 Spline * mSplineJ5 = nullptr ; // ∫₀^Z x⁵eˣ/(eˣ-1)² dx
85 Spline * mSplineJn = nullptr ;
86
89 Bezier * mCpBezierLow = nullptr ;
90 Bezier * mCpBezierMedium = nullptr ;
91 Bezier * mCpBezierHigh = nullptr ;
92
94 real mK0 = BELFEM_QUIET_NAN ; // isothermal bulk modulus at 0 K [Pa]
95 real mG0 = BELFEM_QUIET_NAN ; // shear modulus at 0 K [Pa]
96 real mDeltaK = BELFEM_QUIET_NAN ; // softening constant of the isothermal bulk modulus
97 real mDeltaG = BELFEM_QUIET_NAN ; // softening constant of the shear modulus
98 real mL0 = BELFEM_QUIET_NAN ; // l( 0 K ), cached: eps( T ) = 3 ln( l( T ) / mL0 )
99
100//------------------------------------------------------------------------------
101 public:
102//------------------------------------------------------------------------------
103
110 Metal( const string & aLabel,
111 const MaterialType aType,
112 const bool aBuildTables = true );
113
115 ~Metal() override;
116
125 void
126 set_RRR( const real RRR ) override ;
127
138 virtual real
139 compute_debye_from_rho( const real T, const real rho, const real theta_guess=BELFEM_QUIET_NAN );
140
151 real
152 compute_debye_from_cp( const real T, const real cp=BELFEM_QUIET_NAN, const real theta_guess=BELFEM_QUIET_NAN );
153
165 real
166 compute_debye_from_cv( const real T, const real cv=BELFEM_QUIET_NAN, const real theta_guess=BELFEM_QUIET_NAN );
167
168 // Bring base class single-parameter versions into scope
169 // (needed because C++ name hiding hides Material::rho(T) when we override rho(T,B,beta))
170 using Material::rho;
171 using Material::lambda;
172 using Material::drhodT;
174
185 real
186 rho( const real T, const real B, const real beta ) const override ;
187
188 real
189 drhodT( const real T, const real B, const real beta ) const override ;
190
191 real
192 drhodB( const real T, const real B, const real beta ) const override ;
193
194 real
195 drhodbeta( const real T, const real B, const real beta ) const override ;
196
206 real
207 lambda( const real T, const real B, const real beta ) const override ;
208
209 real
210 dlambdadT( const real T, const real B, const real beta ) const override ;
211
212 real
213 dlambdadB( const real T, const real B, const real beta ) const override ;
214
215 real
216 dlambdadbeta( const real T, const real B, const real beta ) const override ;
217
218//------------------------------------------------------------------------------
219
225 real
226 l( real T ) const override ;
227
228//------------------------------------------------------------------------------
229
230 void
231 set_bh_curve( const BhCurve * aCurve ) override ;
232
233//------------------------------------------------------------------------------
234 /*
235 * @brief Evaluate property using spline interpolation
236 */
237 real
238 spline_property( const MaterialProperty aProperty, const real aX ) const override ;
239
240//------------------------------------------------------------------------------
241
250 void
251 set_rho_i_ref( const real T_ref, const real rho_i_ref, const real theta=BELFEM_QUIET_NAN );
252
260 real
261 J( const real Z ) const ;
262
268 real
269 J3( const real Z ) const ;
270
276 real
277 J4( const real Z ) const ;
278
284 real
285 J5( const real Z ) const ;
286
292 real
293 Jn( const real Z ) const ;
294
302 real
303 rho_custom(const real T) const override;
304
312 real
313 rho_i_custom( const real T ) const override ;
314
322 real
323 lambda_custom( const real T ) const override ;
324
330 void
331 create_rho();
332
340 void
341 set_lambda_coefficients( const Vector< real > & aCoeffs );
342
348 real
349 group_velocity( const real T ) const;
350
356 real
357 grueneisen( const real T ) const ;
358
365 void
366 grueneisen( const real T, real & gamma, real & c ) const;
367
374 real
375 cp_from_debye( const real T, const real theta ) const ;
376
381 real
382 cv_from_debye( const real T, const real theta ) const ;
383
394 virtual real
395 kohler( const real B, const real S, const real beta ) const ;
396
402 real
403 kohler_find_bs_crit( const real delta_rho_res );
404
405 void
407
408//------------------------------------------------------------------------------
409
410 real
411 H_bhcurve( const real B ) const override ;
412
413 real
414 mu_bhcurve( real H, const real T ) const override ;
415
416 void
417 dmudH_bhcurve( const real H, real & mu, real & dmudH ) const override ;
418
419 const Vector< real > &
420 lambda_coefficients() const ;
421
422 void
423 set_table_flags( const bool aFlag ) override ;
424
425//------------------------------------------------------------------------------
426 protected:
427//------------------------------------------------------------------------------
428
434 Spline *
435 create_J_spline( const real aExponent );
436
437 real
438 rho_table( const real T, const real B, const real beta ) const override ;
439
440 real
441 drhodT_table( const real T, const real B, const real beta ) const override ;
442
443 real
444 drhodB_table( const real T, const real B, const real beta ) const override ;
445
446 real
447 drhodbeta_table( const real T, const real B, const real beta ) const override ;
448
449 real
450 rho_kohler( const real T, const real B, const real beta ) const override ;
451
452 real
453 drhodT_kohler( const real T, const real B, const real beta ) const override ;
454
455 real
456 drhodB_kohler( const real T, const real B, const real beta ) const override ;
457
458 real
459 drhodbeta_kohler( const real T, const real B, const real beta ) const override ;
460
461 real
462 cp_custom( const real T) const override;
463
464 real
465 dcpdT_custom( const real T) const override;
466
467 real
468 d2cpdT2_custom( const real T) const override;
469
470 void
472
473 void
475
476 void
477 create_cp(
478 const Vector< real > & Px,
479 const Vector< real > & Py,
480 const Vector< real > & Qx,
481 const Vector< real > & Qy,
482 const Vector< real > & Rx = {},
483 const Vector< real > & Ry = {} );
484
485 real
486 E_custom( const real T ) const override ;
487
488 real
489 nu_custom( const real T ) const override ;
490
495 real
496 eps( const real T ) const ;
497
528 void
529 create_mech( const real E2, const real nu2, const real T2, const real deltaK, const real deltaG );
530
531//------------------------------------------------------------------------------
532 private:
533//------------------------------------------------------------------------------
534
539 real
540 invert_debye( const real T, const real y, const real theta_guess,
541 real ( Metal::*aFunction )( const real, const real ) const );
542
543 void
544 save_rho_database( const std::string & aPath );
545
546 void
547 load_rho_database( const std::string & aPath );
548
556 real
557 fun_debye_from_rho( const real T, const real rho, const real theta );
558
559 void
560 populate_rho_database_serial();
561
562 void
563 populate_rho_database( Mesh * aMesh, Vector< real > & aRho );
564
565 };
566
567 inline real Metal::J3( const real Z ) const
568 {
569 BELFEM_ASSERT( mSplineJ3 != nullptr, "lookup table for J3 is not initialized" ) ;
570
571 if ( Z > mZ3Max ) return mJ3Max ;
572 return mSplineJ3->eval( Z ) ;
573 }
574
575 inline real Metal::J4( const real Z ) const
576 {
577 BELFEM_ASSERT( mSplineJ4 != nullptr, "lookup table for J4 is not initialized" ) ;
578
579 if ( Z > mZ4Max ) return mJ4Max ;
580 return mSplineJ4->eval( Z ) ;
581 }
582
583 inline real Metal::J5( const real Z ) const
584 {
585 BELFEM_ASSERT( mSplineJ5 != nullptr, "lookup table for J5 is not initialized" ) ;
586
587 if ( Z > mZ5Max ) return mJ5Max ;
588 return mSplineJ5->eval( Z ) ;
589 }
590
591 inline real Metal::Jn( const real Z ) const
592 {
593 BELFEM_ASSERT( mSplineJn != nullptr, "lookup table for Jn is not initialized" ) ;
594
595 if ( Z > mZnMax ) return mJnMax ;
596 return mSplineJn->eval( Z ) ;
597 }
598
599 inline real
600 Metal::J( const real Z ) const
601 {
602 return ( this->*mFunJ )( Z );
603 }
604
605 inline real
606 Metal::rho_custom(const real T) const
607 {
608 return this->rho_i( T ) + this->constant_property( MaterialProperty::rho_0 );
609 }
610
611 inline real
612 Metal::rho( const real T, const real B, const real beta ) const
613 {
614 return (this->*mFunctionRhoKohler)( T, B, beta );
615 }
616
617 inline real
618 Metal::rho_table( const real T, const real B, const real beta ) const
619 {
620 BELFEM_ASSERT( mRhoData != nullptr, "lookup table for rho is not initialized" ) ;
621
622 real theta = std::clamp( T, mDatabaseTmin, mDatabaseTmax );
623 real log10B = std::log(std::clamp( B, mDatabaseBmin, mDatabaseBmax ) )*mInvLog10 ;
624 real angle = beta < 0 ? beta + constant::pi : beta > constant::pi ? beta - constant::pi : beta;
625
626 return std::exp(mRhoData->evaluate( theta, log10B, angle )) ;
627 }
628
629 inline real
630 Metal::drhodT( const real T, const real B, const real beta ) const
631 {
632 return (this->*mFunctiondRhoKohlerdT)( T, B, beta );
633 }
634
635 inline real
636 Metal::drhodB( const real T, const real B, const real beta ) const
637 {
638 return (this->*mFunctiondRhoKohlerdB)( T, B, beta );
639 }
640
641 inline real
642 Metal::drhodbeta( const real T, const real B, const real beta ) const
643 {
644 return (this->*mFunctiondRhoKohlerdbeta)( T, B, beta );
645 }
646
647 inline real
648 Metal::drhodT_table( const real T, const real B, const real beta ) const
649 {
650 BELFEM_ASSERT( mRhoData != nullptr, "lookup table for rho is not initialized" ) ;
651
652 real theta = std::clamp( T, mDatabaseTmin, mDatabaseTmax );
653 real log10B = std::log(std::clamp( B, mDatabaseBmin, mDatabaseBmax ) )*mInvLog10 ;
654 real angle = beta < 0 ? beta + constant::pi : beta > constant::pi ? beta - constant::pi : beta;
655
656 real y = mRhoData->evaluate( theta, log10B, angle ) ;
657 real dydT = mRhoData->evaluate_derivx( theta, log10B, angle ) ;
658 return std::exp( y ) * dydT ;
659 }
660
661 inline real
662 Metal::drhodB_table( const real T, const real B, const real beta ) const
663 {
664 BELFEM_ASSERT( mRhoData != nullptr, "lookup table for rho is not initialized" ) ;
665
666 real theta = std::clamp( T, mDatabaseTmin, mDatabaseTmax );
667 real Bc = std::clamp( B, mDatabaseBmin, mDatabaseBmax ) ;
668
669 real log10B = std::log( Bc )*mInvLog10 ;
670 real angle = beta < 0 ? beta + constant::pi : beta > constant::pi ? beta - constant::pi : beta;
671
672 real y = mRhoData->evaluate( theta, log10B, angle ) ;
673 real dydlogB = mRhoData->evaluate_derivy( theta, log10B, angle ) ;
674
675 return std::exp( y ) * dydlogB *mInvLog10 / Bc ;
676
677 }
678
679 inline real
680 Metal::drhodbeta_table( const real T, const real B, const real beta ) const
681 {
682 BELFEM_ASSERT( mRhoData != nullptr, "lookup table for rho is not initialized" ) ;
683
684 real theta = std::clamp( T, mDatabaseTmin, mDatabaseTmax );
685 real Bc = std::clamp( B, mDatabaseBmin, mDatabaseBmax ) ;
686
687 real log10B = std::log( Bc )*mInvLog10 ;
688 real angle = beta < 0 ? beta + constant::pi : beta > constant::pi ? beta - constant::pi : beta;
689
690 real y = mRhoData->evaluate( theta, log10B, angle ) ;
691 real dydbeta = mRhoData->evaluate_derivz( theta, log10B, angle ) ;
692
693 return std::exp( y ) * dydbeta ;
694
695 }
696
697 inline real
698 Metal::lambda( real T, const real B, const real beta ) const
699 {
700 return this->lambda( T ) * this->rho( T ) / this->rho( T, B, beta );
701 }
702
703 inline real
704 Metal::dlambdadT( real T, const real B, const real beta ) const
705 {
706 real a = this->lambda( T ) ;
707 real b = this->rho( T ) ;
708 real c = this->rho( T, B, beta );
709
710 real da = this->dlambdadT( T );
711 real db = this->drhodT( T );
712 real dc = this->drhodT( T, B, beta );
713
714 return ( c * ( da*b + a * db ) - a * b * dc ) /( c * c );
715 }
716
717 // lambda( T, B, beta ) = lambda(T) * rho(T) / rho(T,B,beta):
718 // only the denominator depends on B and beta
719 inline real
720 Metal::dlambdadB( const real T, const real B, const real beta ) const
721 {
722 real a = this->lambda( T ) ;
723 real b = this->rho( T ) ;
724 real c = this->rho( T, B, beta );
725
726 return - a * b * this->drhodB( T, B, beta ) / ( c * c );
727 }
728
729 inline real
730 Metal::dlambdadbeta( const real T, const real B, const real beta ) const
731 {
732 real a = this->lambda( T ) ;
733 real b = this->rho( T ) ;
734 real c = this->rho( T, B, beta );
735
736 return - a * b * this->drhodbeta( T, B, beta ) / ( c * c );
737 }
738
739 inline real
740 Metal::H_bhcurve( const real B ) const
741 {
742 return mBhCurve->H( B );
743 }
744
745 inline real
746 Metal::mu_bhcurve( real H, const real T ) const
747 {
748 return mBhCurve->mu( H );
749 }
750
751 inline void
753 {
754 mBhCurve->dmudH( H, mu, dmudH );
755 }
756
757 inline
759 {
760 return mLambdaCoefficients;
761 }
762
763 inline real
764 Metal::cp_custom( const real T ) const
765 {
766 if ( T < mTCpSwitch( 0 ) )
767 {
768 return polyval( mCpPolys( 0 ), T );
769 }
770 if ( T < mTCpSwitch( 1 ) )
771 {
772 return std::exp( polyval( mCpPolys( 1 ), std::log( T ) ) );
773 }
774 if ( T < mTCpSwitch( 2 ) )
775 {
776 return std::exp( mCpBezierLow->y( std::log( T ) ) );
777 }
778 if ( T < mTCpSwitch( 3 ) )
779 {
780 return std::exp( mCpBezierMedium->y( std::log( T ) ) );
781 }
782 if ( mCpBezierHigh != nullptr && T < mTCpSwitch( mTCpSwitch.length() - 1 ) )
783 {
784 return std::exp( mCpBezierHigh->y( std::log( T ) ) );
785 }
786 return polyval( mCpPolys( 2 ), T );
787 }
788
789 inline real
790 Metal::dcpdT_custom( const real T) const
791 {
792 // Subclasses that manage cp themselves ( YBCO, HastelloyC276 )
793 // override cp_custom but inherit this function; without the
794 // Bezier machinery, fall back to the finite difference the
795 // base class provides
796 if ( mCpBezierLow == nullptr )
797 {
798 return Material::dcpdT_custom( T );
799 }
800
801 if ( T < mTCpSwitch( 0 ) )
802 {
803 return dpolyval( mCpPolys( 0 ), T );
804 }
805 real x = std::log( T );
806 if ( T < mTCpSwitch( 1 ) )
807 {
808 return std::exp( polyval( mCpPolys( 1 ), x ) ) * dpolyval( mCpPolys( 1 ), x ) / T;
809 }
810 if ( T < mTCpSwitch( 2 ) )
811 {
812 return std::exp( mCpBezierLow->y( x ) ) * mCpBezierLow->dydx( x ) / T ;
813 }
814 if ( T < mTCpSwitch( 3 ) )
815 {
816
817 return std::exp( mCpBezierMedium->y( x ) ) * mCpBezierMedium->dydx( x ) / T ;
818 }
819 if ( mCpBezierHigh != nullptr && T < mTCpSwitch( mTCpSwitch.length() - 1 ) )
820 {
821 return std::exp( mCpBezierHigh->y( x ) ) * mCpBezierHigh->dydx( x ) / T ;
822 }
823
824 // the extrapolation above T3 is linear in T, not in log-log space
825 return dpolyval( mCpPolys( 2 ), T );
826 }
827
828 inline real
830 {
831 if ( mCpBezierLow == nullptr )
832 {
833 return Material::d2cpdT2_custom( T );
834 }
835 if ( T < mTCpSwitch( 0 ) )
836 {
837 return ddpolyval( mCpPolys( 0 ), T );
838 }
839 real x = std::log( T );
840 // with y = ln( cp ) over x = ln( T ):
841 // d2cp/dT2 = cp * ( y'' + y'^2 - y' ) / T^2
842 if ( T < mTCpSwitch( 1 ) )
843 {
844 real y = polyval( mCpPolys( 1 ), x );
845 real dy = dpolyval( mCpPolys( 1 ), x );
846 return std::exp( y ) * ( ddpolyval( mCpPolys( 1 ), x ) + dy*dy - dy ) / ( T * T );
847 }
848 if ( T < mTCpSwitch( 2 ) )
849 {
850 real dy = mCpBezierLow->dydx( x );
851 return std::exp( mCpBezierLow->y( x ) )
852 * ( mCpBezierLow->d2ydx2( x ) + dy*dy - dy ) / ( T * T );
853 }
854 if ( T < mTCpSwitch( 3 ) )
855 {
856 real dy = mCpBezierMedium->dydx( x );
857 return std::exp( mCpBezierMedium->y( x ) )
858 * ( mCpBezierMedium->d2ydx2( x ) + dy*dy - dy ) / ( T * T );
859 }
860 if ( mCpBezierHigh != nullptr && T < mTCpSwitch( mTCpSwitch.length() - 1 ) )
861 {
862 real dy = mCpBezierHigh->dydx( x );
863 return std::exp( mCpBezierHigh->y( x ) )
864 * ( mCpBezierHigh->d2ydx2( x ) + dy*dy - dy ) / ( T * T );
865 }
866
867 return ddpolyval( mCpPolys( 2 ), T );
868 }
869
870 inline real
871 Metal::eps( const real T ) const
872 {
873 BELFEM_ASSERT( std::isfinite( mL0 ),
874 "elastic constants not assigned for %s - call create_mech() first",
875 this->label().c_str() );
876
877 return 3.0 * std::log( this->l( T ) / mL0 );
878 }
879
880 inline real
881 Metal::E_custom( const real T ) const
882 {
883 real e = this->eps( T );
884 real K = mK0 * std::exp( -mDeltaK * e );
885 real G = mG0 * std::exp( -mDeltaG * e );
886 return 9.0 * K * G / ( 3.0 * K + G );
887 }
888
889 inline real
890 Metal::nu_custom( const real T ) const
891 {
892 real e = this->eps( T );
893 real K = mK0 * std::exp( -mDeltaK * e );
894 real G = mG0 * std::exp( -mDeltaG * e );
895 return ( 3.0 * K - 2.0 * G ) / ( 6.0 * K + 2.0 * G );
896 }
897
898 }
899}
900
901#endif // BELFEM_CL_MATERIAL_METAL_HPP
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Definition cl_Bezier.hpp:30
real dydx(const real aX) const
derivative of Y with respect to X
Definition cl_Bezier.cpp:241
real d2ydx2(const real aX) const
second derivative of Y with respect to X
Definition cl_Bezier.cpp:264
real y(const real aX) const
y-coordinate as funciton of the x-coordinate
Definition cl_Bezier.cpp:187
A bounds-checked wrapper around std::vector.
Definition cl_Cell.hpp:45
Precomputed lookup table on a tensor grid; evaluation, derivatives and HDF5 persistence.
Definition cl_Database.hpp:30
virtual real H(const real B) const
Magnetic field strength from flux density.
Definition cl_Material.hpp:2029
virtual real K(real T=gTroom) const
Bulk modulus.
Definition cl_Material.hpp:2128
virtual real rho(const real T) const
Electrical resistivity (isotropic).
Definition cl_Material.hpp:1931
real n(const real normB, const real angleNxB, const real T) const
Direct evaluation of the n-value as a function of , and .
Definition powerlaws.hpp:992
virtual void dmudH(const real H, real &mu, real &dmudH) const
Magnetic permeability and its derivative.
Definition cl_Material.hpp:2057
virtual real lambda(const real T=gTroom) const
Thermal conductivity (isotropic).
Definition cl_Material.hpp:1806
virtual real cp(const real T=gTroom) const
Specific heat capacity.
Definition cl_Material.hpp:1738
virtual real drhodT(const real T) const
Definition cl_Material.hpp:1941
real(Material::*) mFunctiondRhoKohlerdB(const real T, const real normB, const real angle) const
Definition cl_Material.hpp:395
real(Material::*) mFunctiondRhoKohlerdT(const real T, const real normB, const real angle) const
Definition cl_Material.hpp:394
virtual real rho_i(const real T) const
Intrinsic (phonon) electrical resistivity of a metal, ρ = ρ_i(T) + ρ_0.
Definition cl_Material.hpp:2208
const string & label() const
Definition cl_Material.hpp:1581
virtual real G(real T=gTroom) const
Shear modulus.
Definition cl_Material.hpp:2120
real constant_property(const MaterialProperty aProperty) const
Definition cl_Material.hpp:1683
real(Material::*) mFunctionRhoKohler(const real T, const real normB, const real angle) const
Definition cl_Material.hpp:393
virtual real dcpdT_custom(const real T) const
Definition cl_Material.cpp:499
real(Material::*) mFunctiondRhoKohlerdbeta(const real T, const real normB, const real angle) const
Definition cl_Material.hpp:396
virtual real d2cpdT2_custom(const real T) const
Definition cl_Material.cpp:506
virtual real dlambdadT(const real T=gTroom) const
Definition cl_Material.hpp:1821
virtual real mu(const real H, const real T=BELFEM_QUIET_NAN) const
Magnetic permeability.
Definition cl_Material.hpp:2043
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
Cubic spline on a uniform grid, C2, with natural, parabolic or clamped boundary conditions.
Definition cl_Spline.hpp:45
real eval(const real aX) const
interpolate the function
Definition cl_Spline.hpp:461
size_t length() const
get the length of the vector
Definition cl_AR_Vector.hpp:235
B-H curve for ferromagnetic materials.
Definition cl_BhCurve.hpp:61
real mL0
Definition cl_Material_Metal.hpp:98
real drhodB_kohler(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.cpp:789
Vector< real > mTCpSwitch
Definition cl_Material_Metal.hpp:88
real drhodbeta_kohler(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.cpp:812
Spline * mSplineJ3
Definition cl_Material_Metal.hpp:82
real mDeltaK
Definition cl_Material_Metal.hpp:96
real drhodB(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.hpp:636
real dlambdadT(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.hpp:704
real cp_custom(const real T) const override
Definition cl_Material_Metal.hpp:764
real dlambdadbeta(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.hpp:730
real J5(const real Z) const
Debye integral J₅(Z) = ∫₀^Z x⁵eˣ/(eˣ-1)² dx.
Definition cl_Material_Metal.hpp:583
real rho_custom(const real T) const override
Total resistivity at zero field (overrides base class).
Definition cl_Material_Metal.hpp:606
virtual real compute_debye_from_rho(const real T, const real rho, const real theta_guess=BELFEM_QUIET_NAN)
Compute Debye temperature from measured resistivity.
Definition cl_Material_Metal.cpp:562
void set_rho_i_ref(const real T_ref, const real rho_i_ref, const real theta=BELFEM_QUIET_NAN)
Set reference intrinsic resistivity for Bloch-Grüneisen model.
Definition cl_Material_Metal.cpp:389
real drhodT(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.hpp:630
real lambda(const real T, const real B, const real beta) const override
Thermal conductivity with magnetoresistance.
Definition cl_Material_Metal.hpp:698
void create_mech(const real E2, const real nu2, const real T2, const real deltaK, const real deltaG)
Elastic moduli in the quasi-harmonic approximation: a modulus depends on the volume,...
Definition cl_Material_Metal.cpp:1123
real drhodbeta_table(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.hpp:680
real J4(const real Z) const
Debye integral J₄(Z) = ∫₀^Z x⁴eˣ/(eˣ-1)² dx.
Definition cl_Material_Metal.hpp:575
real rho_kohler(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.cpp:742
real compute_debye_from_cp(const real T, const real cp=BELFEM_QUIET_NAN, const real theta_guess=BELFEM_QUIET_NAN)
Compute Debye temperature from specific heat capacity.
Definition cl_Material_Metal.cpp:527
Spline * mSplineJn
Definition cl_Material_Metal.hpp:85
void set_RRR(const real RRR) override
Set residual resistivity ratio.
Definition cl_Material_Metal.cpp:222
real J3(const real Z) const
Debye integral J₃(Z) = ∫₀^Z x³eˣ/(eˣ-1)² dx.
Definition cl_Material_Metal.hpp:567
real lambda_custom(const real T) const override
Thermal conductivity at zero field.
Definition cl_Material_Metal.cpp:648
Cell< Vector< real > > mCpPolys
Definition cl_Material_Metal.hpp:87
real kohler_find_bs_crit(const real delta_rho_res)
Find critical B·S for given relative resistivity increase.
Definition cl_Material_Metal.cpp:846
real mK0
quasi-harmonic elastic constants ( Metal::create_mech ); K0, G0 at 0 K, the deltas dimensionless
Definition cl_Material_Metal.hpp:94
real drhodB_table(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.hpp:662
real J(const real Z) const
Debye integral Jₙ(Z) = ∫₀^Z xⁿeˣ/(eˣ-1)² dx with n the Bloch–Grüneisen exponent ( 5 by default,...
Definition cl_Material_Metal.hpp:600
real nu_custom(const real T) const override
Definition cl_Material_Metal.hpp:890
real drhodT_table(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.hpp:648
real compute_debye_from_cv(const real T, const real cv=BELFEM_QUIET_NAN, const real theta_guess=BELFEM_QUIET_NAN)
Compute Debye temperature from the specific heat at constant volume.
Definition cl_Material_Metal.cpp:542
void set_lambda_coefficients(const Vector< real > &aCoeffs)
Set thermal conductivity model coefficients.
Definition cl_Material_Metal.cpp:639
void dmudH_bhcurve(const real H, real &mu, real &dmudH) const override
Definition cl_Material_Metal.hpp:752
real cv_from_debye(const real T, const real theta) const
Specific heat at constant volume from Debye temperature ( Sommerfeld + Debye, no dilation term ).
Definition cl_Material_Metal.cpp:600
void create_cp(const Vector< real > &Px, const Vector< real > &Py, const Vector< real > &Qx, const Vector< real > &Qy, const Vector< real > &Rx={}, const Vector< real > &Ry={})
Definition cl_Material_Metal.cpp:82
const Vector< real > & lambda_coefficients() const
Definition cl_Material_Metal.hpp:758
real mDeltaG
Definition cl_Material_Metal.hpp:97
real spline_property(const MaterialProperty aProperty, const real aX) const override
Definition cl_Material_Metal.cpp:381
void populate_rho_database()
Definition cl_Material_Metal.cpp:886
real dcpdT_custom(const real T) const override
Definition cl_Material_Metal.hpp:790
real eps(const real T) const
logarithmic volumetric thermal strain from 0 K, eps( T ) = 3 int_0^T alpha dT = 3 ln( l( T ) / l( 0 )...
Definition cl_Material_Metal.hpp:871
real l(real T) const override
Relative length after thermal expansion.
Definition cl_Material_Metal.cpp:369
void set_bloch_gruen_parameter(const real n)
Definition cl_Material_Metal.cpp:71
real dlambdadB(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.hpp:720
real E_custom(const real T) const override
Definition cl_Material_Metal.hpp:881
real mG0
Definition cl_Material_Metal.hpp:95
virtual real kohler(const real B, const real S, const real beta) const
Kohler function for magnetoresistance.
Definition cl_Material_Metal.cpp:734
real rho(const real T, const real B, const real beta) const override
Electrical resistivity with magnetoresistance (Kohler's rule).
Definition cl_Material_Metal.hpp:612
real drhodbeta(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.hpp:642
real rho_i_custom(const real T) const override
Intrinsic resistivity (Bloch-Grüneisen model).
Definition cl_Material_Metal.cpp:427
Spline * create_J_spline(const real aExponent)
Create spline for Debye integral J_n(Z).
Definition cl_Material_Metal.cpp:307
void set_kohler_dependencies()
Definition cl_Material_Metal.cpp:834
real group_velocity(const real T) const
Phonon group velocity.
Definition cl_Material_Metal.cpp:670
real mu_bhcurve(real H, const real T) const override
Definition cl_Material_Metal.hpp:746
Spline * mSplineJ5
Definition cl_Material_Metal.hpp:84
real rho_table(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.hpp:618
real d2cpdT2_custom(const real T) const override
Definition cl_Material_Metal.hpp:829
Metal(const string &aLabel, const MaterialType aType, const bool aBuildTables=true)
Constructor.
Definition cl_Material_Metal.cpp:34
Bezier * mCpBezierHigh
Definition cl_Material_Metal.hpp:91
void create_rho()
Initialize resistivity properties.
Definition cl_Material_Metal.cpp:414
Bezier * mCpBezierMedium
Definition cl_Material_Metal.hpp:90
Spline * mSplineJ4
Definition cl_Material_Metal.hpp:83
real H_bhcurve(const real B) const override
Definition cl_Material_Metal.hpp:740
real Jn(const real Z) const
Debye integral for arbitrary n.
Definition cl_Material_Metal.hpp:591
Bezier * mCpBezierLow
Definition cl_Material_Metal.hpp:89
real drhodT_kohler(const real T, const real B, const real beta) const override
Definition cl_Material_Metal.cpp:758
real cp_from_debye(const real T, const real theta) const
Specific heat from Debye temperature.
Definition cl_Material_Metal.cpp:613
real grueneisen(const real T) const
Grüneisen parameter.
Definition cl_Material_Metal.cpp:685
void set_table_flags(const bool aFlag) override
Definition cl_Material_Metal.cpp:1117
void set_bh_curve(const BhCurve *aCurve) override
Assign a B-H curve to this material.
Definition cl_Material_Metal.cpp:1109
SplineLookupTable(const MaterialType aType, const bool aIsIsotropic=true)
Definition cl_Material_SplineLookupTable.cpp:17
Evaluates the second derivative of a polynomial.
Evaluates the first derivative of a polynomial.
Evaluates a polynomial.
T ddpolyval(const Vector< T > &aCoeffs, const T aX)
Evaluates the second derivative of a polynomial at one point.
Definition fn_ddpolyval.hpp:46
const real pi
circle number
Definition constants.hpp:41
Definition cl_BhCurve.cpp:19
T dpolyval(const std::vector< T > &coeffs, const T x)
Definition cl_Material_UserDefined.hpp:46
T polyval(const std::vector< T > &coeffs, const T x)
Definition cl_Material_UserDefined.hpp:28
USER GUIDES:
Definition cl_Capacitor.cpp:16
MaterialProperty
All material properties that can be defined.
Definition cl_Material.hpp:153
@ rho_0
Definition cl_Material.hpp:183
double real
Definition typedefs.hpp:36
MaterialType
Material classification based on physical behavior.
Definition cl_Material.hpp:113
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:86