Skip to content

Commit

Permalink
Merge branch 'main' of github.com:upb-lea/materialdatabase
Browse files Browse the repository at this point in the history
  • Loading branch information
gituser789 committed May 2, 2024
2 parents ed45126 + cfbeef9 commit 87e3183
Show file tree
Hide file tree
Showing 21 changed files with 847 additions and 591 deletions.
1 change: 1 addition & 0 deletions materialdatabase/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""init.py."""
from materialdatabase.material_data_base_functions import *
from materialdatabase.material_data_base_classes import *
from materialdatabase.enumerations import *
Expand Down
1 change: 1 addition & 0 deletions materialdatabase/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Constants."""
import numpy as np

# vacuum permeability
Expand Down
2 changes: 2 additions & 0 deletions materialdatabase/dtos.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Dataclass for storing material curves."""
from dataclasses import dataclass
import numpy as np

Expand All @@ -10,6 +11,7 @@ class MaterialCurve:
This dataclass can be loaded into a calculation, by only choosing the material.
All other parameters are bound to this material.
"""

material_name: str
material_mu_r_abs: float
material_flux_density_vec: np.ndarray
Expand Down
94 changes: 59 additions & 35 deletions materialdatabase/enumerations.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
"""Enumerations for easier usage."""
from enum import Enum


# Following Enums must always be consistent with the FEM Magnetics Toolbox (FEMMT)
class MaterialDataSource(str, Enum):
"""Sets the source from where data is taken.
"""
"""Sets the source from where data is taken."""

Custom = "custom"
Measurement = "measurements"
ManufacturerDatasheet = "manufacturer_datasheet"


class MeasurementSetup(str, Enum):
"""Sets the source from where data is taken.
"""
"""Sets the setup of the measurement."""

LEA_MTB = "LEA_MTB"
LEA_MTB_small_signal = "LEA_MTB_small_signal"
LEA_LK = "LEA_LK"


class MeasurementMethod(str, Enum):
"""Sets the source from where data is taken.
"""
"""Sets the method of the measurement."""

ImpedanceAnalyzer = "Impedance Analyzer"
Calorimetric = "Calorimetric"
Electric = "Electric"
Expand All @@ -29,39 +30,38 @@ class MeasurementMethod(str, Enum):


class Company(str, Enum):
"""Sets the source from where data is taken.
"""
"""Sets the name of the company."""

UPB = "Paderborn University"


class Manufacturer(str, Enum):
"""Sets the source from where data is taken.
"""
"""Sets the name of the manufacturer."""

TDK = "TDK"
Ferroxcube = "Ferroxcube"
DMEGC = "DMEGC"
SUMIDA = "Sumida"


class MeasurementDataType(str, Enum):
"""Sets the type of measurement data.
"""
"""Sets the type of the measurement data."""

ComplexPermeability = "complex_permeability"
ComplexPermittivity = "complex_permittivity"
Steinmetz = "Steinmetz"


class MeasurementDevice(str, Enum):
"""Sets the type of Measurement Device
"""
"""Sets the type of the measurement device."""

lecroy = "LeCroy_HDO4104"
wayne_kerr = "Wayne_Kerr_6500B"
zimmer = "ZES_Zimmer_LMG640"


class PlotLabels(str, Enum):
"""Labels for possible plots
"""
"""Labels for axes of possible plots."""

time = "time in s"
time_ms = "time in ms"
Expand All @@ -71,16 +71,20 @@ class PlotLabels(str, Enum):
frequency_kHz = "frequency in kHz"
frequency_MHz = "frequency in MHz"

powerloss_density = r"powerloss density in mW/cm^3"
powerloss_density_mW = r"powerloss density in mW/cm^3"
powerloss_density_kW = r"powerloss density in kW/m^3"

h_field = "magnetic field strength in A/m"
b_field = "magnetic flux density in T"
e_field = "electric field strength in V/m"
d_field = r"electric flux density in As/m^2"

current = "voltage in V"
voltage = "current in A"
power = "power in W"
current_A = "voltage in A"
current_mA = "voltage in mA"
voltage_V = "current in V"
voltage_mV = "current in mV"
power_W = "power in W"
power_mW = "power in mW"

mu_ampl = r"rel. permeability amplitude $\mu_\mathrm{r}}$"
mu_angle = r"rel. permeability angle $\mu_\mathrm{r}}$ in degree"
Expand All @@ -89,8 +93,8 @@ class PlotLabels(str, Enum):


class CuboidCodeNames(str, Enum):
"""Probe Codes of Permittivity Measurement Probe
"""
"""Probe-Codes of permittivity measurement probes."""

# 3F46
D966 = "C25,16x2,04x15,55"
T227 = "C25,05x4,05x15,78"
Expand All @@ -113,12 +117,13 @@ class CuboidCodeNames(str, Enum):

@classmethod
def has_member_key(cls, key):
"""Check if key is part of class."""
return key in cls.__members__


class ToroidCodeNames(str, Enum):
"""Probe Codes of Permeability Measurement Probe
"""
"""Probe-Codes of permeability measurement probes."""

# 3F46
A461 = "R36x32x16"
C293 = "R24x18x15"
Expand All @@ -137,12 +142,12 @@ class ToroidCodeNames(str, Enum):

@classmethod
def has_member_key(cls, key):
"""Check if key is part of class."""
return key in cls.__members__


class Material(str, Enum):
"""Sets the name of the core material as enums.
"""
"""Sets the name of the core material as enums."""

TEST = "TEST" # FOR TESTING STUFF
_3F46 = "3F46"
Expand All @@ -158,20 +163,24 @@ class Material(str, Enum):


class ToroidDirectoryName(str, Enum):
"""Sets the type of Permeability Measurement Probe
"""
Sets the type of Permeability Measurement Probe.
d_out: outer diameter of toroid in mm
d_in: innter diameter of toroid in mm
h: height of toroid in mm
N1: primary turns number
N2: secondary turns number
"""

N87_1 = "R24,6x20,25x20,5_A00"
DMR96A_1 = '???'
DMR96A_2 = 'R_25.0x21.0x15.0x4x4'


class CuboidDirectoryName(str, Enum):
"""Sets the type of Permittivity Measurement Probe
"""
Sets the type of Permittivity Measurement Probe.
string with:
a x b x c
Expand All @@ -182,14 +191,17 @@ class CuboidDirectoryName(str, Enum):
(a and b can be exchanged, because A = a*b)
"""

_3F46_thin = "C_25.16x2.04x15.55"
DMR96A_2 = "C_25x2x15"
# DMR96A_2 = 'R_25.0x21.0x15.0x4x4'


class HeaderMeasurementData(str, Enum):
"""Names for the header of the dataframes for the post-processing data
e.g. data of the permeability angle gets the header "permeability angle"
"""
Names for the header of the dataframes for the post-processing files(Magnetic-TestBench).
e.g. data of the permeability angle gets the header "permeability angle"
"""

frequency = "frequency"
Expand All @@ -210,17 +222,29 @@ class HeaderMeasurementData(str, Enum):
permittivity_angle = "permittivity angle"

self_inductance = "self inductance"
prim_leakage_inductance = "primary leakage inductance"
sec_leakage_inductance = "secondary leakage inductance"
prim_leak_inductance = "primary leakage inductance"
sec_leak_inductance = "secondary leakage inductance"

voltage = "voltage"
current = "current"
power = "power"

impedance_ampl = "impedance amplitude"
impedance_angle = "impedance angle"

impedance_ampl_prim_open = "primary open impedance amplitude"
impedance_angle_prim_open = "primary open impedance angle"

impedance_ampl_prim_short = "primary short impedance amplitude"
impedance_angle_prim_short = "primary short impedance angle"

impedance_ampl_sec_open = "secondary open impedance amplitude"
impedance_angle_sec_open = "secondary open impedance angle"


class ProbeDimensions(str, Enum):
"""Sets the name for the dimensions of a probe
"""
"""Sets the name for the dimensions of a probe."""

height = "height"
cross_section = "cross section"
volume = "volume"
Expand All @@ -234,4 +258,4 @@ class ProbeDimensions(str, Enum):
prim_winding = "primary winding"
sec_winding = "secondary winding"

l_mag = "l_mag"
l_mag = "lmag"
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Script to get permeability data by LEA_LK."""
from materialdatabase.material_data_base_functions import *

location = "C:/Users/tpiepe/sciebo/Exchange_FEMMT/05_Materials/data/2022_10_10_Ferrite_mu_eps_Data_Keuck/"
Expand All @@ -9,5 +10,4 @@

b_ref, mu_r, mu_phi_deg = get_permeability_data_from_lea_lk(location, f, T, "N49")

b_ref, mu_r, mu_phi_deg = process_permeability_data(b_ref, mu_r, mu_phi_deg,
smooth_data=True, crop_data=False, plot_data=True)
b_ref, mu_r, mu_phi_deg = process_permeability_data(b_ref, mu_r, mu_phi_deg, smooth_data=True, crop_data=False, plot_data=True)
9 changes: 5 additions & 4 deletions materialdatabase/helper_functions/get_property_from_LEA_LK.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Script to get the property from LEA_LK."""
from materialdatabase.material_data_base_functions import *
from matplotlib import pyplot as plt
from scipy.signal import savgol_filter as savgol
Expand All @@ -8,10 +9,10 @@

print(filename)
for f in [200000, 300000]:
b_hys, p_hys = get_permeability_property_from_lea_lk(path_to_parent_folder=location, sub_folder_name="Core_Loss",
quantity="p_hys", frequency=f, material_name="N49", temperature=30)
b_phi, mu_phi_deg = get_permeability_property_from_lea_lk(path_to_parent_folder=location, sub_folder_name="mu_phi_Plot",
quantity="mu_phi", frequency=f, material_name="N49", temperature=30)
b_hys, p_hys = get_permeability_property_from_lea_lk(path_to_parent_folder=location, sub_folder_name="Core_Loss", quantity="p_hys", frequency=f,
material_name="N49", temperature=30)
b_phi, mu_phi_deg = get_permeability_property_from_lea_lk(path_to_parent_folder=location, sub_folder_name="mu_phi_Plot", quantity="mu_phi", frequency=f,
material_name="N49", temperature=30)
if len(b_phi) != len(b_hys):
print("invalid")
break
Expand Down
Loading

0 comments on commit 87e3183

Please sign in to comment.