BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Material_BhSplineCurve.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_BHSPLINECURVE_HPP
13#define BELFEM_CL_MATERIAL_BHSPLINECURVE_HPP
14
15#include "cl_BhCurve.hpp"
16#include "cl_Spline.hpp"
17namespace belfem
18{
19 namespace material
20 {
21 class BhSplineCurve : public BhCurve
22 {
23 Spline * mNuSpline = nullptr ;
24 Spline * mMuSpline = nullptr ;
25
26 real mBsat = BELFEM_QUIET_NAN ;
27 real mHsat = BELFEM_QUIET_NAN ;
28 real mMsat = BELFEM_QUIET_NAN ;
29
30//------------------------------------------------------------------------------
31 public:
32//------------------------------------------------------------------------------
33
34 BhSplineCurve(const string & aPath, const string & aLabel);
35
36//------------------------------------------------------------------------------
37
38 ~BhSplineCurve() override ;
39
40//------------------------------------------------------------------------------
49 real
50 nu( const real B ) const override ;
51//------------------------------------------------------------------------------
52
61 real
62 mu( const real H ) const override ;
63
64//------------------------------------------------------------------------------
65
78 void
79 dmudH( const real H, real & mu, real & dmudH ) const override ;
80
81//------------------------------------------------------------------------------
82 private:
83//------------------------------------------------------------------------------
84
85 void
86 load_data( const string & aPath, const string & aLabel );
87
88//------------------------------------------------------------------------------
89 };
90
91//------------------------------------------------------------------------------
92
93 inline real
94 BhSplineCurve::nu( const real B ) const
95 {
96 if ( B < mBsat )
97 {
98 return mNuSpline->eval( B ) * constant::nu0 ;
99 }
100 else
101 {
102 return ( B * constant::nu0 - mMsat ) / B ;
103 }
104 }
105
106//------------------------------------------------------------------------------
107
108 inline real
109 BhSplineCurve::mu( const real H ) const
110 {
111 if ( H < mHsat )
112 {
113 return constant::mu0 / mMuSpline->eval( H ) ;
114 }
115 else
116 {
117 return ( mMsat + H ) / H * constant::mu0 ;
118 }
119 }
120
121//------------------------------------------------------------------------------
122
123 inline void
125 {
126 if ( H < mHsat )
127 {
128 index_t k = mMuSpline->find_col( H );
129 real f = mMuSpline->eval( H, k );
130 real df = mMuSpline->deval( H, k );
131
132 mu = constant::mu0 / f ;
133 dmudH = - mu * df / f;
134 }
135 else
136 {
137 mu = ( mMsat + H ) / H * constant::mu0 ;
138 dmudH = -mMsat * constant::mu0 / ( H * H );
139 }
140 }
141
142//------------------------------------------------------------------------------
143 }
144}
145#endif //BELFEM_CL_MATERIAL_BHSPLINECURVE_HPP
Cubic spline on a uniform grid, C2, with natural, parabolic or clamped boundary conditions.
Definition cl_Spline.hpp:45
BhCurve(const string &aPath, const string &aLabel)
Constructor - records the database path and group label.
Definition cl_BhCurve.cpp:20
real H(const real B) const
Magnetic field intensity from flux density.
Definition cl_BhCurve.hpp:160
real B(const real H) const
Magnetic flux density from field intensity.
Definition cl_BhCurve.hpp:154
real mu(const real H) const override
Permeability μ(H) = B/H.
Definition cl_Material_BhSplineCurve.hpp:109
real nu(const real B) const override
Reluctivity ν(B) = H/B.
Definition cl_Material_BhSplineCurve.hpp:94
void dmudH(const real H, real &mu, real &dmudH) const override
Permeability and its derivative with respect to H.
Definition cl_Material_BhSplineCurve.hpp:124
BhSplineCurve(const string &aPath, const string &aLabel)
Definition cl_Material_BhSplineCurve.cpp:23
const real mu0
magnetic constant in V*s/(A*m) ( recommended value ) http://physics.nist.gov/cgi-bin/cuu/Value?...
Definition constants.hpp:73
const real nu0
inverse of magnetic constant in (A*m)/(V*s)
Definition constants.hpp:80
Definition cl_BhCurve.cpp:19
USER GUIDES:
Definition cl_Capacitor.cpp:16
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:87