I am solving nonlinear Eddy Current Problem. The Iron reluctivity nu dependents on the flux density norm B0.
Without saturation:
nu =CoefficientFunction([3.8exp(2.17B0B0)+396.2 if mat== “magnet” else 1.0/(1.0mu0)
for mat in mesh.GetMaterials()])
The magnetization curve saturates, e.g., at 1.8 T. How to set this?
Thanks,
Xiaotao
I try this:
def nuf(B0):
if B0 >=1.8:
return 3.8exp(2.171.81.8)+396.2
else:
return 3.8exp(2.17B0B0)+396.2
nu =CoefficientFunction([nuf(B0) if mat== “inner” else 1.0/(1.0*mu0)
for mat in mesh.GetMaterials()])
TypeError ‘>=’ not supported between instances of ‘ngsolve.fem.CoefficientFunction’ and ‘float’
Here is B0.
mesh is 2D
fes = HCurl(mesh, order=2, dirichlet=“b|r|t|l”, nograds=True)
gfu = GridFunction(fes)
gfu.Set(…) # gfu is an in-plane vector
B0=curl(gfu) # B0 has one component