├── .clang-format ├── .gitignore ├── BUILD.md ├── CMakeLists.txt ├── LICENSE.md ├── README.md ├── data ├── advanced_core_materials.ndjson ├── bobbins.ndjson ├── core_materials.ndjson ├── core_shapes.ndjson ├── cores.ndjson ├── cores_stock.ndjson ├── insulation_materials.ndjson ├── wire_materials.ndjson └── wires.ndjson ├── docs ├── inputs.md ├── magnetic.md └── magnetic │ ├── coil.md │ ├── core.md │ └── wire.md ├── samples ├── inputs │ ├── designRequirements │ │ ├── basicRequirements.json │ │ └── completeRequirements.json │ └── operatingPointExcitation │ │ └── triangular_equidistant.json └── magnetic │ ├── bobbin │ └── bobbin_E19_5.json │ ├── coil │ └── inductor_42_turns.json │ ├── core │ ├── core_E_19_8_5_N87_substractive.json │ ├── core_E_55_21_N97_additive.json │ ├── core_E_55_28_21_3C95_additive.json │ ├── core_PQ_35_35_N97_additive.json │ ├── core_PQ_35_35_N97_substractive.json │ ├── core_T_40_24_16_N97.json │ ├── material │ │ ├── Ferroxcube_3C97_roshen.json │ │ └── Ferroxcube_3C97_steinmetz.json │ └── shape │ │ ├── shape_custom_PQ.json │ │ └── shape_standard_PQ_20_16.json │ ├── insulation │ └── material │ │ ├── bakelite.json │ │ └── kapton_hn.json │ └── wire │ ├── foil │ └── foil_0.02_0.0001.json │ ├── litz │ ├── Litz_20x0.8.json │ └── TXXL550_44FXXX-2(MWXX).json │ ├── material │ └── copper.json │ ├── rectangular │ └── rectangular_0.0014_0.004.json │ └── round │ ├── 0.000140.json │ └── D29A01TXX-1.5.json ├── schemas ├── MAS.json ├── inputs.json ├── inputs │ ├── designRequirements.json │ ├── operatingConditions.json │ ├── operatingPoint.json │ ├── operatingPointExcitation.json │ └── topologies │ │ └── flyback.json ├── magnetic.json ├── magnetic │ ├── bobbin.json │ ├── coil.json │ ├── core.json │ ├── core │ │ ├── gap.json │ │ ├── material.json │ │ ├── piece.json │ │ ├── shape.json │ │ └── spacer.json │ ├── insulation │ │ ├── material.json │ │ └── wireCoating.json │ ├── wire.json │ └── wire │ │ ├── basicWire.json │ │ ├── foil.json │ │ ├── litz.json │ │ ├── material.json │ │ ├── planar.json │ │ ├── rectangular.json │ │ └── round.json ├── outputs.json ├── outputs │ └── coreLossesOutput.json └── utils.json └── tests ├── Test.cpp └── TestData.cpp /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: WebKit 2 | Language: Cpp 3 | AlignAfterOpenBracket: AlwaysBreak 4 | BreakBeforeBraces: Custom 5 | BraceWrapping: 6 | AfterClass: true 7 | AfterControlStatement: true 8 | AfterEnum: true 9 | AfterFunction: true 10 | AfterNamespace: true 11 | AfterStruct: true 12 | AfterUnion: true 13 | BeforeCatch: true 14 | BeforeElse: true 15 | IndentBraces: false 16 | BreakConstructorInitializersBeforeComma: false 17 | Cpp11BracedListStyle: true 18 | ColumnLimit: 140 19 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 20 | ExperimentalAutoDetectBinPacking: true 21 | UseTab: Never 22 | TabWidth: 4 23 | IndentWidth: 4 24 | Standard: Cpp11 25 | PointerAlignment: Middle 26 | MaxEmptyLinesToKeep: 2 27 | KeepEmptyLinesAtTheStartOfBlocks: false 28 | AllowShortFunctionsOnASingleLine: InlineOnly 29 | AlwaysBreakTemplateDeclarations: true 30 | IndentCaseLabels: true 31 | SpaceAfterTemplateKeyword: true 32 | SpaceBeforeCpp11BracedList: false 33 | SortIncludes: true 34 | IndentPPDirectives: AfterHash 35 | ReflowComments: false 36 | AlignEscapedNewlinesLeft: false 37 | AlignEscapedNewlines: DontAlign 38 | AlignTrailingComments: false 39 | 40 | # Not changed: 41 | AccessModifierOffset: -4 42 | AlignConsecutiveAssignments: false 43 | AlignOperands: false 44 | AllowAllParametersOfDeclarationOnNextLine: true 45 | AllowShortBlocksOnASingleLine: false 46 | AllowShortCaseLabelsOnASingleLine: false 47 | AllowShortIfStatementsOnASingleLine: false 48 | AllowShortLoopsOnASingleLine: false 49 | AlwaysBreakAfterDefinitionReturnType: None 50 | AlwaysBreakBeforeMultilineStrings: false 51 | BinPackArguments: false 52 | BinPackParameters: false 53 | BreakBeforeBinaryOperators: All 54 | BreakBeforeTernaryOperators: true 55 | CommentPragmas: '^ IWYU pragma:' 56 | ConstructorInitializerIndentWidth: 4 57 | ContinuationIndentWidth: 4 58 | DerivePointerAlignment: false 59 | DisableFormat: false 60 | IndentWidth: 4 61 | IndentWrappedFunctionNames: false 62 | MacroBlockBegin: '' 63 | MacroBlockEnd: '' 64 | NamespaceIndentation: Inner 65 | ObjCBlockIndentWidth: 4 66 | ObjCSpaceAfterProperty: true 67 | ObjCSpaceBeforeProtocolList: true 68 | PenaltyBreakBeforeFirstCallParameter: 19 69 | PenaltyBreakComment: 300 70 | PenaltyBreakFirstLessLess: 120 71 | PenaltyBreakString: 1000 72 | PenaltyExcessCharacter: 1000000 73 | PenaltyReturnTypeOnItsOwnLine: 60 74 | SpaceAfterCStyleCast: false 75 | SpaceBeforeAssignmentOperators: true 76 | SpaceBeforeParens: ControlStatements 77 | SpaceInEmptyParentheses: false 78 | SpacesBeforeTrailingComments: 1 79 | SpacesInContainerLiterals: true 80 | SpacesInCStyleCastParentheses: false 81 | SpacesInParentheses: false 82 | SpacesInSquareBrackets: false 83 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # emacs files 2 | *~ 3 | *\# 4 | .tramp_history 5 | 6 | # vim cache files 7 | *.swp 8 | 9 | # auto generated files 10 | *.logrt 11 | 12 | /build 13 | /build_* 14 | /build-* 15 | 16 | # callgrind files 17 | callgrind.out.* 18 | 19 | # ignore kdevelop files 20 | *.kdev4 21 | *.kdev_include_paths 22 | 23 | # ignore sublime project files 24 | *.sublime-* 25 | 26 | # Qt Creator files 27 | *.user 28 | 29 | # ignore perf output 30 | */perf.data 31 | 32 | # ignore build files 33 | CMakeCache.txt 34 | CMakeFiles 35 | Makefile 36 | cmake_install.cmake 37 | CTestTestfile.cmake 38 | *.a 39 | *.o 40 | cmake-build-* 41 | 42 | # Python cache 43 | *.pyc 44 | __pycache__ 45 | *.pytest_cache 46 | 47 | CPackConfig.cmake 48 | CPackSourceConfig.cmake 49 | 50 | *-preprocessed.xml 51 | 52 | core 53 | !core/ 54 | vgcore* 55 | 56 | *.deb 57 | *.build 58 | *.upload 59 | *.changes 60 | build-stamp 61 | configure-stamp 62 | 63 | *.bin 64 | *.mrk 65 | *.mrk2 66 | *.mrk3 67 | 68 | .dupload.conf 69 | 70 | # Netbeans project files 71 | nbproject/* 72 | 73 | # JetBrains project files 74 | .idea 75 | 76 | # Microsoft Visual Studio Code 77 | .vscode 78 | 79 | config-preprocessed.xml 80 | 81 | # Protobuf 82 | *.pb.cpp 83 | *.pb.h 84 | 85 | # Ignore symlink to private repository 86 | /private 87 | 88 | # Gulp dependencies used to minify website 89 | node_modules 90 | public 91 | website/docs 92 | website/presentations 93 | website/package-lock.json 94 | .DS_Store 95 | */.DS_Store 96 | 97 | # cquery cache 98 | /.cquery-cache 99 | 100 | # ccls cache 101 | /.ccls-cache 102 | 103 | # clangd cache 104 | /.clangd 105 | /.cache 106 | 107 | /compile_commands.json 108 | 109 | # Toolchains 110 | /cmake/toolchain/* 111 | 112 | # pytest-profiling 113 | /prof 114 | 115 | *.iml 116 | 117 | # data store 118 | /programs/server/data 119 | /programs/server/metadata 120 | /programs/server/store 121 | 122 | *.egg-info 123 | *.so -------------------------------------------------------------------------------- /BUILD.md: -------------------------------------------------------------------------------- 1 | 2 | ## Build steps 3 | 4 | 1. Create a build directory: 5 | 6 | ``` 7 | $ mkdir build && cd build 8 | ``` 9 | 10 | 2. Configure the CMake project (Using Ninja in this example): 11 | 12 | ``` 13 | $ cmake .. -G "Ninja" 14 | ``` 15 | 16 | 4. Build it: 17 | 18 | ``` 19 | $ cmake --build . 20 | ``` 21 | 22 | 5. Run the application: 23 | 24 | ``` 25 | $ ./MAS_tests 26 | ``` 27 | 6. Create Python package 28 | 29 | ``` 30 | python3 -m pip install -e ../ -vvv 31 | ``` 32 | 33 | 34 | wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - 35 | sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' 36 | sudo apt install cmake 37 | sudo apt install ninja-build 38 | npm install -g quicktype 39 | sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test 40 | sudo apt install -y gcc-11 g++-11 41 | sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10 42 | sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 10 43 | 44 | sudo apt-get install libglfw3-dev libgles2-mesa-dev 45 | 46 | 47 | quicktype -l c++ -s schema ../schemas/MAS.json -S ../schemas/magnetic.json -S ../schemas/magnetic/core.json -S ../schemas/magnetic/coil.json -S ../schemas/utils.json -S ../schemas/magnetic/core/gap.json -S ../schemas/magnetic/core/shape.json -S ../schemas/magnetic/core/material.json -S ../schemas/magnetic/insulation/material.json -S ../schemas/magnetic/insulation/wireCoating.json -S ../schemas/magnetic/bobbin.json -S ../schemas/magnetic/core/piece.json -S ../schemas/magnetic/core/spacer.json -S ../schemas/magnetic/wire/basicWire.json -S ../schemas/magnetic/wire/round.json -S ../schemas/magnetic/wire/rectangular.json -S ../schemas/magnetic/wire/foil.json -S ../schemas/magnetic/wire/litz.json -S ../schemas/magnetic/wire/planar.json -S ../schemas/magnetic/wire/material.json -S ../schemas/magnetic/wire.json -S ../schemas/utils.json -S ../schemas/magnetic/insulation/wireCoating.json -S ../schemas/magnetic/insulation/material.json -S ../schemas/inputs.json -S ../schemas/outputs.json -S ../schemas/outputs/coreLossesOutput.json -S ../schemas/inputs/designRequirements.json -S ../schemas/inputs/operatingConditions.json -S ../schemas/inputs/operatingPoint.json -S ../schemas/inputs/operatingPointExcitation.json -o ../outputs/MAS.hpp --namespace OpenMagnetics --source-style single-source --type-style pascal-case --member-style underscore-case --enumerator-style upper-underscore-case --no-boost 48 | 49 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18.0) 2 | 3 | project(MAS_tests) 4 | 5 | SET(CMAKE_CXX_STANDARD 20) 6 | SET(CMAKE_CXX_STANDARD_REQUIRED ON) 7 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") 8 | 9 | SET(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -Wno-switch") 10 | 11 | option(BUILD_SHARED_LIBS "Build tests" ON) 12 | option(BUILD_TESTS "Build tests" OFF) 13 | option(BUILD_EXAMPLES "Build examples" OFF) 14 | option(UTPP_INCLUDE_TESTS_IN_BUILD "Build tests" OFF) 15 | 16 | include(FetchContent) 17 | 18 | FetchContent_Declare(UnitTest++ 19 | GIT_REPOSITORY https://github.com/unittest-cpp/unittest-cpp.git 20 | GIT_TAG tags/v2.0.0) 21 | 22 | FetchContent_Declare(json 23 | GIT_REPOSITORY https://github.com/nlohmann/json/ 24 | GIT_TAG tags/v3.11.2) 25 | 26 | FetchContent_Declare(json-schema-validator 27 | GIT_REPOSITORY https://github.com/pboettch/json-schema-validator.git 28 | GIT_TAG origin/main) 29 | 30 | FetchContent_MakeAvailable(UnitTest++ json json-schema-validator) 31 | 32 | SET(CMAKE_CXX_FLAGS "-Wall -Wextra") 33 | 34 | include_directories("${CMAKE_BINARY_DIR}/_deps/unittest++-src/UnitTest++/") 35 | include_directories("${CMAKE_BINARY_DIR}/_deps/json-src/include/nlohmann/") 36 | 37 | file(GLOB MAS_sources 38 | "tests/*.cpp") 39 | 40 | add_executable(MAS_tests ${MAS_sources}) 41 | target_link_libraries(MAS_tests nlohmann_json::nlohmann_json nlohmann_json_schema_validator UnitTest++) 42 | 43 | 44 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | BSD 4-Clause "Original" or "Old" License 2 | 3 | Copyright (c) 2023, OpenMagnetics 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. All advertising materials mentioning features or use of this software must 16 | display the following acknowledgement: This product includes software developed by OpenMagnetics. 17 | 18 | 4. Neither the name of the copyright holder nor the names of its 19 | contributors may be used to endorse or promote products derived from 20 | this software without specific prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Magnetic Agnostic Structure (MAS) 2 | 3 | What I present here is the initial version of a common language that can **unambiguously describe a magnetic component**. The aim of this project is to provide a format that can be **written and understood by any human**, that can be **shared**, **copied**, **versioned**, and **stored** efficiently; that different software tools can read it and produce an equal result, be they Analytical tools, Circuit simulators, Finite Element or CAD software. A format can automatically produce a technical drawing, a 3D model, a temperature estimation, a magnetic field plot, or a list of assembly steps, without leaving a detail to interpretation. 4 | 5 | This first prototype I called Magnetic Agnostic Structure, because it defines a magnetic independently of its kind or application, and because being an Engineer, I like puns, and its acronym is MAS, which means "more" or "plus" in my mother tongue, Spanish. 6 | 7 | I would like to start with some clarifications, or "design decisions" , I took along the way, and explain why I took them. I also think they are a nice way of introducing the reasoning behind the MAS format. 8 | 9 | A magnetic component is just a piece of iron with copper wires around it without an application. The excitation defines the magnetic as much as the construction: the same component can be used as a transformer in a LLC or as an inductor in a Flyback. Some coupled inductors can be used as a common mode choke. Of course, the performance is not going to be the same, as normally one component is optimized for an application, but that is beside my point. What I want to highlight is that the operating point (excitation and conditions) is as important as the construction, and they must be equally defined. 10 | 11 | For that reason, I decided for my specification to cover both, but separate, and I called them inputs and magnetic. One input can excite many magnetics, and one magnetic can work with many different inputs. 12 | 13 | Another design decision I took was to support indirection (also called dereferencing). This is a fancy term used mainly in programming, but the used is a logical one: when a property needs to be defined (let’s say the shape of the core) the property can be defined directly in the document (by including all the data about that shape: dimensions, family, etc.) or just a name (just say we are using shape ETD 49). Of course, in the second case, that reference needs to be defined somewhere accessible (in a manufacturer datasheet, in the standard, or in another database).It might be weird, but we will clarify it with further examples later. But why would I want to do that? Well, because it allows us to use components that already exist (RM 12, TDK N87, Litz 800x0.1) together with custom definitions (a custom shape, a custom wire, or a custom material). It even allows us to define and reuse our custom components.It allows us to create a scalable system. 14 | 15 | The last decision I took was the format of the files. It needs to be a structured format that is readable and editable easily by a human, that can be processed by a generic software, that can be stored in a database, downloaded, or even printed; and ideally that could enforce certain templates, in order to maintain the format itself. 16 | 17 | I decided to go with JSON (JavaScript Object Notation, pronounced /ˈdʒeɪsən/; also /ˈdʒeɪˌsɒn/) because it supports lists (used for listing the different windings in a magnetic) and dictionaries (a key-value part, for example: "shape": "ETD49"), it has no strange keywords around, so it is really easy to read, it is supported by any programming language and software, it can be efficiently stored in most modern databases; and my favorite part, it has a declarative language (called JSON Schema: https://json-schema.org) that defines the structure of a given JSON, so it is possible to establish that a JSON defining a core must have a material and a shape, or otherwise it is wrong. 18 | 19 | So we already have some foundational steps: we are going to define inputs and magnetics, we can define custom parts, name them, and reuse them; and we can define rules to enforce our format. It sounds like a good start to me. 20 | 21 | ## Inputs 22 | As explained in the [Inputs Section] (https://github.com/OpenMagnetics/MAS/blob/main/docs/inputs.md) 23 | 24 | ## Magnetic 25 | As explained in the [Magnetic Section] (https://github.com/OpenMagnetics/MAS/blob/main/docs/magnetic.md) 26 | 27 | ## Outputs 28 | As explained in the [Outputs Section] (TBD) 29 | 30 | 31 | ```mermaid 32 | classDiagram 33 | 34 | class MAS { 35 | 36 | -Inputs inputs 37 | -Magnetic magnetic 38 | -Outputs outputs 39 | 40 | +get_*() 41 | +set_*() 42 | } 43 | MAS ..> Inputs : Dependency 44 | MAS ..> Magnetic : Dependency 45 | MAS ..> Outputs : Dependency 46 | 47 | class Inputs { 48 | 49 | -DesignRequirements design_requirements; 50 | -List~OperatingPoint~ operating_points; 51 | 52 | +get_*() 53 | +set_*() 54 | } 55 | 56 | class Magnetic { 57 | 58 | -String name 59 | -MagneticCore core 60 | -Coil coil 61 | -List distributors_info; 62 | -MagneticManufacturerInfo manufacturer_info; 63 | 64 | +get_*() 65 | +set_*() 66 | } 67 | 68 | class Outputs { 69 | -Dict core_losses 70 | -Dict leakage_inductance 71 | -Dict magnetizing_inductance 72 | -Dict winding_losses 73 | -Dict winding_window_magnetic_strength_field 74 | 75 | +get_*() 76 | +set_*() 77 | } 78 | 79 | ``` 80 | -------------------------------------------------------------------------------- /data/insulation_materials.ndjson: -------------------------------------------------------------------------------- 1 | {"name": "ETFE", "composition": "Ethylene Tetrafluoroethylene", "aliases": ["Tefzel ETFE"], "manufacturer": "Chemours", "meltingPoint": 220, "temperatureClass": 155, "thermalConductivity": 0.24, "specificHeat": 1172, "relativePermittivity": 2.7, "dielectricStrength": [{"value": 160000000, "thickness": 0.000025, "temperature": 23}], "resistivity": [{"value": 1e15, "temperature": 170}]} 2 | {"name": "FEP", "composition": "Fluorinated Polyethylene", "aliases": ["Teflon FEP"], "manufacturer": "Chemours", "meltingPoint": 255, "temperatureClass": 155, "thermalConductivity": 0.195, "specificHeat": 1172, "relativePermittivity": 2.0, "dielectricStrength": [{"value": 260000000, "thickness": 0.000025, "temperature": 23}, {"value": 70000000, "thickness": 0.0005, "temperature": 23}], "resistivity": [{"value": 1e16, "temperature": -40}, {"value": 1e16, "temperature": 240}]} 3 | {"name": "PFA", "composition": "Perfluoroalkoxy", "aliases": ["Teflon PFA"], "manufacturer": "Chemours", "meltingPoint": 302, "temperatureClass": 180, "thermalConductivity": 0.195, "specificHeat": 1172, "relativePermittivity": 2.0, "dielectricStrength": [{"value": 260000000, "thickness": 0.000025, "temperature": 23}], "resistivity": [{"value": 1e15, "temperature": -40}, {"value": 1e15, "temperature": 240}]} 4 | {"name": "Kapton HN", "composition": "Polyimide", "aliases": [], "manufacturer": "DuPont", "meltingPoint": 520, "temperatureClass": 180, "thermalConductivity": 0.2, "specificHeat": 1090, "relativePermittivity": 3.4, "dielectricStrength": [{"value": 303000000, "thickness": 0.000025, "temperature": 23}, {"value": 240000000, "thickness": 0.000050, "temperature": 23}, {"value": 201000000, "thickness": 0.000075, "temperature": 23}, {"value": 154000000, "thickness": 0.000125, "temperature": 23}], "resistivity": [{"value": 1.5e15}]} 5 | {"name": "Tecroll 10B", "composition": "Polyester", "aliases": [], "manufacturer": "Royal Diamond", "temperatureClass": 130, "thermalConductivity": 0.13, "specificHeat": 1300, "relativePermittivity": 3, "dielectricStrength": [{"value": 75000000, "thickness": 0.00006}], "resistivity": [{"value": 1e16}]} 6 | {"name": "Tecroll 11B", "composition": "Polyester", "aliases": [], "manufacturer": "Royal Diamond", "temperatureClass": 130, "thermalConductivity": 0.13, "specificHeat": 1300, "relativePermittivity": 3, "dielectricStrength": [{"value": 75000000, "thickness": 0.00006}], "resistivity": [{"value": 1e16}]} 7 | {"name": "371F", "composition": "Polyester", "aliases": [], "manufacturer": "Royal Diamond", "temperatureClass": 130, "thermalConductivity": 0.13, "specificHeat": 1300, "relativePermittivity": 3, "dielectricStrength": [{"value": 83333333, "thickness": 0.00006}], "resistivity": [{"value": 1e16}]} 8 | {"name": "Tecroll 71 SL", "composition": "Polyimide", "aliases": [], "manufacturer": "Royal Diamond", "temperatureClass": 180, "thermalConductivity": 0.2, "specificHeat": 1090, "relativePermittivity": 3.4, "dielectricStrength": [{"value": 116666666, "thickness": 0.00006}], "resistivity": [{"value": 1.5e15}]} 9 | {"name": "Tecroll 46 AC", "composition": "Polyester", "aliases": [], "manufacturer": "Royal Diamond", "temperatureClass": 130, "thermalConductivity": 0.13, "specificHeat": 1300, "relativePermittivity": 3, "dielectricStrength": [{"value": 32000000, "thickness": 0.00014}], "resistivity": [{"value": 1e16}]} 10 | {"name": "Polyurethane 155", "composition": "Polyurethane", "aliases": [], "manufacturer": "MWS Wire", "temperatureClass": 155, "relativePermittivity": 3.7, "dielectricStrength": [{"value": 25000000, "thickness": 0.0001}], "resistivity": [{"value": 1e16}]} -------------------------------------------------------------------------------- /data/wire_materials.ndjson: -------------------------------------------------------------------------------- 1 | {"name": "copper", "permeability": 0.999994, "resistivity": {"referenceValue": 0.00000001678, "referenceTemperature": 20, "temperatureCoefficient": 0.004041}, "thermalConductivity": [{"temperature": -73, "value": 413}, {"temperature": 0, "value": 401}, {"temperature": 127, "value": 392}, {"temperature": 327, "value": 383}, {"temperature": 527, "value": 371}, {"temperature": 727, "value": 357}, {"temperature": 927, "value": 342}]} 2 | {"name": "aluminium", "permeability": 1.000022, "resistivity": {"referenceValue": 0.0000000265, "referenceTemperature": 20, "temperatureCoefficient": 0.00429}, "thermalConductivity": [{"temperature": -73, "value": 237}, {"temperature": 0, "value": 236}, {"temperature": 127, "value": 240}, {"temperature": 327, "value": 232}, {"temperature": 527, "value": 220}]} -------------------------------------------------------------------------------- /docs/magnetic.md: -------------------------------------------------------------------------------- 1 | # Magnetic 2 | I am going to separate into different specifications (and therefore files or entries in the database) anything that has to do with input to the system (operating points and requirements) from the physical system itself (the magnetic component). This first chapter describes how a magnetic can be described. 3 | 4 | It is a common practice of magnetics manufacturers to decouple cores (including gaps) and windings, having collections of compatible cores and wound bobbins, which allows having a multitude of different magnetics by combining them. 5 | 6 | I have followed the same principle for separating the different parts of the magnetic component, choosing to define the core and winding as two (almost) independent objects. Cores and windings can be defined by themselves and linked together, supporting even having magnetic cores with more than one winding window, and placing different windings in each one. 7 | 8 | ## Name 9 | This name references the magnetic component and can be used to refer to it. This field can contain any valid string of characters, and can hold the manufacturer's reference or a description of a custom magnetic. 10 | 11 | ## Core 12 | As defined in the [Core Section] (https://github.com/OpenMagnetics/MAS/blob/main/docs/magnetic/core.md) 13 | 14 | ## Coil 15 | As defined in the [Coil Section] (https://github.com/OpenMagnetics/MAS/blob/main/docs/magnetic/coil.md) 16 | 17 | ```mermaid 18 | classDiagram 19 | 20 | class Magnetic { 21 | 22 | -String name 23 | -MagneticCore core 24 | -Coil coil 25 | -List distributors_info; 26 | -MagneticManufacturerInfo manufacturer_info; 27 | 28 | +get_*() 29 | +set_*() 30 | 31 | } 32 | 33 | Magnetic ..> MagneticCore : Dependency 34 | Magnetic ..> Coil : Dependency 35 | Magnetic ..> DistributorInfo : Dependency 36 | Magnetic ..> MagneticManufacturerInfo : Dependency 37 | 38 | class MagneticCore { 39 | 40 | -String name 41 | -FunctionalDescription functional_description 42 | -List~Piece~ geometrical_description 43 | -ProcessedDescription processed_description 44 | -ManufacturingInfo manufacturing_info 45 | 46 | +process_data() 47 | +process_gap() 48 | +get_*() 49 | +set_*() 50 | } 51 | 52 | class Coil { 53 | -Bobbin bobbin; 54 | -List~CoilFunctionalDescription~ functional_description; 55 | -List~Layer~ layers_description; 56 | -List~Section~ sections_description; 57 | -List~Turn~ turns_description; 58 | 59 | +wind_by_sections() 60 | +wind_by_layers() 61 | +wind_by_turns() 62 | +get_*() 63 | +set_*() 64 | } 65 | 66 | class MagneticManufacturerInfo { 67 | -String cost 68 | -String datasheet_url 69 | -String name 70 | -String reference 71 | -String status 72 | -MagneticManufacturerRecommendations recommendations; 73 | 74 | +get_*() 75 | +set_*() 76 | } 77 | class DistributorInfo { 78 | -Double cost; 79 | -String country; 80 | -String distributed_area; 81 | -String email; 82 | -String link; 83 | -String name; 84 | -String phone; 85 | -Double quantity; 86 | -String reference; 87 | -String updated_at; 88 | 89 | +get_*() 90 | +set_*() 91 | } 92 | MagneticManufacturerInfo ..> MagneticManufacturerRecommendations : Dependency 93 | 94 | class MagneticManufacturerRecommendations { 95 | -Double rated_current; 96 | -Double rated_current_temperature_rise; 97 | -Double rated_magnetic_flux; 98 | 99 | +get_*() 100 | +set_*() 101 | } 102 | 103 | ``` 104 | -------------------------------------------------------------------------------- /docs/magnetic/coil.md: -------------------------------------------------------------------------------- 1 | # Coil 2 | Following the same principle as with the core, the coil is defined in an equivalent way as how they are manufactured: The wires are selected, prepared, and wound over a coil former following a series of steps. For this reason the bobbin or coil former is included in this section as part of the coil, which gives the possibility of defining a coil without a specific core, just its bobbin. 3 | The nomenclature of the different elements of the coil used in this document tries to follow the most common practices in the industry, but in order to avoid misinterpretation they will be defined here: 4 | 5 | * Coil: This refers to the whole set of windings, 6 | * Winding: This refers to an individual winding when specifically indicated (e.g.: “primary winding”, “winding 1”) 7 | * Partial Winding: A subset of an individual winding, either a proportion of its turns or a proportion of its parallels; a proportion of both is not supported, and in those rare cases the Turns Description must be used. It contains the following fields: 8 | * Name: Reference name given to the partial winding. 9 | * Winding: Reference to the winding where it belongs to. 10 | * Turns proportion: Number from 0 to 1 indicating the proportion of turns contained in this partial winding. 11 | * Parallel proportion: Number from 0 to 1 indicating the proportion of parallels contained in this partial winding. 12 | * Winding window: This is the space available for placing the turns of any or all windings in a magnetic component. There is usually one per core, but certain kinds of bobbins offer many windows in order to help control the coupling, in which case more than one winding window will be available. 13 | * Physical turn: Any physical turns wound around the bobbin, independent of its series or parallel connection. Current can circulate through it, generating losses and magnetic field. 14 | * Turn: A turn from the magnetic point of view, in the sense that it is connected in series with others and generates inductance. 15 | * Parallel: A physical turn that is connected in parallel with others, and all of them are considered as one from the magnetic point of view. Electrically it divides the current through the magnetic turn they belong to. 16 | * Layer: A group of physical turns that are wound together, one after the other, in a vertical (e.g.: wound inductors) or horizontal (e.g.: planar inductors) fashion. The increment and positioning can be done in one dimension. 17 | * Section: A group of layers (or only one layer) that belong to the same winding (e.g.: primary winding) or a group of similar windings (e.g.: two secondaries wound together in a Center-tapped Full Bridge). The number of sections and their relative placement defines the interleaving of the whole winding. 18 | * Isolation side: Label that defines one individual winding or a group of windings that have a common ground. Windings with different labels imply that they are electrically isolated. 19 | 20 | ```mermaid 21 | classDiagram 22 | 23 | class Coil { 24 | -Bobbin bobbin 25 | -List~CoilFunctionalDescription~ functional_description 26 | -List~Layer~ layers_description 27 | -List~Section~ sections_description 28 | -List~Turn~ turns_description 29 | 30 | +wind_by_sections() 31 | +wind_by_layers() 32 | +wind_by_turns() 33 | +get_*() 34 | +set_*() 35 | } 36 | 37 | Coil ..> Bobbin : Dependency 38 | Coil ..> CoilFunctionalDescription : Dependency 39 | Coil ..> Layer : Dependency 40 | Coil ..> Section : Dependency 41 | Coil ..> Turn : Dependency 42 | 43 | class Bobbin { 44 | -List~Utils~ distributors_info 45 | -BobbinFunctionalDescription functional_description 46 | -ManufacturerInfo manufacturer_info 47 | -String name 48 | -CoreBobbinProcessedDescription processed_description 49 | 50 | +get_*() 51 | +set_*() 52 | } 53 | 54 | class CoilFunctionalDescription { 55 | -IsolationSide isolation_side 56 | -String name 57 | -Int number_parallels 58 | -Int number_turns 59 | -Wire wire 60 | 61 | +get_*() 62 | +set_*() 63 | } 64 | CoilFunctionalDescription ..> IsolationSide : Dependency 65 | 66 | class Section { 67 | -List~Double~ coordinates 68 | -List~Double~ dimensions 69 | -Double filling_factor 70 | -OrientationEnum layers_orientation 71 | -String name 72 | -List~PartialWinding~ partial_windings 73 | 74 | +get_*() 75 | +set_*() 76 | } 77 | Section ..> OrientationEnum : Dependency 78 | Section ..> PartialWinding : Dependency 79 | 80 | class Layer { 81 | -List~Double~ coordinates 82 | -List~Double~ dimensions 83 | -Double filling_factor 84 | -InsulationMaterial insulation_material 85 | -String name 86 | -OrientationEnum orientation 87 | -List~PartialWinding~ partial_windings 88 | -String section 89 | -TurnsAlignmentEnum turns_alignment 90 | -LayersDescriptionType type 91 | 92 | +get_*() 93 | +set_*() 94 | } 95 | Layer ..> TurnsAlignmentEnum : Dependency 96 | Layer ..> OrientationEnum : Dependency 97 | Layer ..> PartialWinding : Dependency 98 | 99 | 100 | class Turn { 101 | -Double angle 102 | -List~Double~ coordinates 103 | -String layer 104 | -Double length 105 | -String name 106 | -TurnOrientation orientation 107 | -String parallel 108 | -String section 109 | -String winding 110 | 111 | +get_*() 112 | +set_*() 113 | } 114 | 115 | Turn ..> TurnOrientation : Dependency 116 | 117 | class PartialWinding { 118 | -List~Double~ parallels_proportion 119 | -String winding; 120 | 121 | +get_*() 122 | +set_*() 123 | 124 | } 125 | 126 | class IsolationSide { 127 | <> 128 | DENARY 129 | DUODENARY 130 | NONARY 131 | OCTONARY 132 | PRIMARY 133 | QUATERNARY 134 | QUINARY 135 | SECONDARY 136 | SENARY 137 | SEPTENARY 138 | TERTIARY 139 | UNDENARY 140 | } 141 | 142 | class TurnsAlignmentEnum { 143 | <> 144 | CENTERED 145 | INNER_OR_TOP 146 | OUTER_OR_BOTTOM 147 | SPREAD 148 | } 149 | 150 | class OrientationEnum { 151 | <> 152 | HORIZONTAL 153 | RADIAL 154 | VERTICAL 155 | } 156 | 157 | class TurnOrientation { 158 | <> 159 | CLOCKWIRE 160 | COUNTER_CLOCKWISE 161 | } 162 | 163 | ``` 164 | 165 | Additionally, four levels or descriptions are used, each one more detailed than the previous one. The reason for this is to provide the freedom to choose the necessary level of detail needed for a given application. A core losses model might only use the basic Functional Description, with the number of turns; a leakage inductance model might use a Section Description to study the interleaving; a temperature model or a Finite Element simulation might use a Layer Description to predict the temperature rise; and finally winding losses model or a automatic tool for creating assembly instructions might use the Turn Description to accurately predict the losses or generate the assembly steps. 166 | ## Name 167 | This name references the whole winding and can be used to refer to it from any number of magnetic components. This field can contain any valid string of characters. 168 | ## Bobbin 169 | As it was explained before, the bobbin is optionally included in this section, the winding, instead of the core, as it is the part where the wires are wound, allowing combining different cores for the same winding. 170 | If this is not present, the winding is described only as a 2D entity, and can only be fully described once the core has been chosen. 171 | This field can be of two types, either a string containing the reference of the bobbin used, or the description of the bobbin itself. In the second case it contains the following fields: 172 | 173 | * Name: Reference name for this bobbin. 174 | * Type: The type of a bobbin. It can be either: 175 | * Standard 176 | * Custom 177 | * Family: Family of core shape that this bobbin is compatible with 178 | * Manufacturer Info: Dictionary/Map with the information about the manufacturer, including name, status of the material, internal reference, or cost. 179 | * Shape: The name of a magnetic shape that this bobbin belongs to 180 | * Family Subtype: The subtype of the shape this bobbin belongs to, in case there are more than one. 181 | * Dimensions: The dimensions of a bobbin, keys must be as defined in EN 62317 182 | 183 | ## Functional Description 184 | This level or description is intended to hold the minimum information that can describe the winding of a magnetic component, although only in simple cases completely. It is intended for applications with simple windings or where detailed information is not needed, as is the case of an inductance or core losses model. 185 | The structure consists of a list of elements, where each element describes one individual winding (e.g.: primary, secondary, auxiliary). A simple inductor will have one element, a simple transformer two, and any extra winding for additional outputs will be additional elements in the list. 186 | Each of these windings will contain the following fields: 187 | * Name: Reference name of the winding (e.g.: primary). 188 | * Isolation Side: Reference label for the isolation side, as defined previously. 189 | * Number Parallels: Number of parallels in this winding, as defined previously. 190 | * Number Turns: Number of turns in this winding, as defined previously. 191 | * Wire: Wire used in this winding. As defined in the [Wire Section] (https://github.com/OpenMagnetics/MAS/blob/main/docs/magnetic/wire.md) 192 | 193 | 194 | Example of Coil Functional Description of an inductor: 195 | ``` 196 | { 197 | "name": "MyInductor", 198 | "functionalDescription":[ 199 | { 200 | "name": "MyWinding", 201 | "numberTurns": 42, 202 | "numberParallels": 2, 203 | "isolationSide": "primary", 204 | "wire": "Litz 450x01" 205 | } 206 | ] 207 | } 208 | ``` 209 | 210 | 211 | Example of Winding Functional Description of a transformer: 212 | ``` 213 | { 214 | "name": "MyTransformer", 215 | "functionalDescription":[ 216 | { 217 | "name": "Primary", 218 | "numberTurns": 42, 219 | "numberParallels": 2, 220 | "isolationSide": "primary", 221 | "wire": "Litz 450x01" 222 | }, 223 | { 224 | "name": "Secondary", 225 | "numberTurns": 23, 226 | "numberParallels": 1, 227 | "isolationSide": "secondary", 228 | "wire": "Solid Round 32AWG" 229 | } 230 | ] 231 | } 232 | ``` 233 | 234 | ## Sections Description 235 | This level or description is an increment to the previous one, adding more detail to the Functional level. It describes the coil with a granularity of sections (as described above). 236 | 237 | If we represented the winding window of the core as a 2D rectangle, we would see the cross section of the wires as circles or rectangles (depending on the type of the wire). If we grouped the physical turns that belong to the same winding and only that one with encircling rectangles, these rectangles would represent the sections of our designs. A simple inductor will have only one section, and non-interleaved simple transformer will have two sections, and a transformer with primary and secondary interleaved once will have four sections. 238 | 239 | Each of these sections contains a part or the whole of the winding they belong to, and, together with the excitation, this level of detail is enough to calculate the leakage inductance with simple models, or the winding losses according to Dowell’s model. 240 | 241 | It consists on a list of sections, each element containing the following fields: 242 | 243 | * Name: Reference name of the section 244 | * Layers Orientation: Way in which the layers are oriented inside the section. It can be one of the following: 245 | * Horizontal 246 | * Vertical 247 | * Radial 248 | * Partial Windings: List of partial windings in this section 249 | * Dimensions: Dimensions of the rectangle defining the section 250 | * Coordinates: The coordinates of the center of the section, referred to the center of the main column of the core. 251 | 252 | 253 | ## Layers Description 254 | As the previous case, this description is an incremental step to either the Functional or Section Description. Although it is still not enough to fully describe the whole coil, it has enough information for certain analytical models, like capacitance or temperature rise. 255 | 256 | It breaks down each of the sections into layers, allowing defining them as insulation or wiring layers. For wiring layers it contains how many turns and parallels go into each one, for insulation layers, the material used. In both cases its dimension and coordinates must be specified. 257 | 258 | It consists on a list of layer, each element containing the following fields: 259 | 260 | * Name: Reference name of the layer. 261 | * Type: Type of the layer. It can be either: 262 | * Wiring 263 | * Insulation 264 | * Section (optional): Reference of the section this layer belongs to, if the Section Description exists. 265 | * Orientation: Way in which the layer is oriented. It can be one of the following: 266 | * Horizontal 267 | * Vertical 268 | * Radial 269 | * Partial Windings: List of partial windings in this layer. 270 | * Insulation Material: Insulation material used in the layer 271 | * Dimensions: Dimensions of the rectangle defining the layer 272 | * Coordinates: The coordinates of the center of the layer, referred to the center of the main column of the core. 273 | 274 | ## Turns Description 275 | This is the deepest and most detailed level of description for the coil of a magnetic component. It consists of describing each of the physical turns existing in all the individual windings, including their exact position inside the winding window. 276 | 277 | It is useful for advanced Finite Element Simulation or advanced analytical models, like 2D winding losses, where the proximity effect from each physical turn into all the others is taken into account. 278 | 279 | It can be used together with all the previous Descriptions or just with the Functional one. It consists of a list of individual physical turns, each element containing the following fields: 280 | 281 | * Name: Reference name of the physical turn. 282 | * Winding: The winding reference where the physical turn belongs to. 283 | * Parallel: The reference of the parallel that this physical turn belongs to, in case there is more than one. 284 | * Layer (optional): The reference of the layer that this physical turn belongs to. 285 | * Section: (optional): The reference of the section that this physical turn belongs to. 286 | * Turns Alignment: Way in which the turns are aligned inside the layer. It can be one of the following: 287 | * Inner or top 288 | * Outer or bottom 289 | * Spread 290 | * Centered 291 | * Orientation: Way in which the physical turn is wound, it can be either: 292 | * Clockwire 293 | * Counter Clockwise 294 | * Length (optional): The length of the physical turn, referred from the center of its cross section. 295 | * Angle: The angle that the physical turn does, useful for partial turns. 296 | * Coordinates: The coordinates of the center of the physical turn, referred to the center of the main column. 297 | -------------------------------------------------------------------------------- /docs/magnetic/wire.md: -------------------------------------------------------------------------------- 1 | # Wire 2 | As is the philosophy of the whole MAS format, the wire definition and usage tries to resemble reality as much as possible by making its definition independent of the winding where it is used. 3 | This allows the user to have a collection of defined wires that are ready to be used in any magnetic component, or even have the collection from other users or manufacturers. 4 | The wire structure is designed to be able to describe any kind of wire, from Litz wires to planar PCB tracks. It contains some fields that are common for all kinds of wires and some specific ones. The common field are: 5 | 6 | * Name: Reference name of the wire. 7 | * Type: Type of the wire. It can be one of the following: 8 | * Round: Solid round wire, defined by its conducting diameter. 9 | * Rectangular: Rectangular solid wire, defined by its conducting height and width. This wire can represent from strip wire to PCB tracks. 10 | * Foil: Solid foil wire, defined by its conducting height and width (or thickness). 11 | * Litz: Stranded wire made of other kinds of wires. 12 | * Standard (optional): Standard where the wire is defined (e.g.: IEC 60317 or NEMA MW 1000C) 13 | * Manufacturer Info: Dictionary/Map with the information about the manufacturer, including name, status of the material, internal reference, or cost. 14 | * Material: Conductive material of the wire, usually Copper. 15 | * Number Conductors: The number of conductors in the wire. The conductors are isolated from one another in the case of Litz type, and non-isolated for the rest. 16 | * Coating: The coating field covers anything that insulation material that goes around the wire and has the following fields: 17 | * Type: Type of the coating. Can be 18 | * Bare 19 | * Enamelled 20 | * Insulated 21 | * Served 22 | * Taped 23 | * Extruded 24 | * Maximum Thickness: The maximum thickness of the insulation around the wire. 25 | * Material: Name of the material used or a dictionary/map with its properties, like rating, thermal conductivity, or dielectric strength. 26 | * Grade: The grade of the insulation around the wire. 27 | * Number Layers: The number of layers of the insulation around the wire. 28 | * Thickness Layers: The thickness of the layers of the insulation around the wire. 29 | * Breakdown Voltage: Minimum voltage that causes a portion of an insulator to experience electrical breakdown and become electrically conductive. 30 | 31 | Additionally, depending on the type, more fields are needed, and are described in the following subsections. 32 | 33 | ```mermaid 34 | classDiagram 35 | 36 | class Wire { 37 | -InsulationWireCoating coating 38 | -DimensionWithTolerance conducting_diameter 39 | -DimensionWithTolerance conducting_height 40 | -DimensionWithTolerance conducting_width 41 | -ManufacturerInfo manufacturer_info 42 | -WireMaterial material 43 | -String name 44 | -Double number_conductors 45 | -DimensionWithTolerance outer_diameter 46 | -DimensionWithTolerance outer_height 47 | -DimensionWithTolerance outer_width 48 | -WireStandard standard 49 | -String standard_name 50 | -String type 51 | -Wire strand 52 | 53 | +get_*() 54 | +set_*() 55 | } 56 | Wire ..> InsulationWireCoating : Dependency 57 | Wire ..> WireMaterial : Dependency 58 | Wire ..> WireStandard : Dependency 59 | Wire ..> Wire : Dependency 60 | 61 | class InsulationWireCoating { 62 | 63 | -Double breakdown_voltage 64 | -Int grade 65 | -InsulationMaterial material 66 | -Int number_layers 67 | -DimensionWithTolerance thickness 68 | -Double thickness_layers 69 | -InsulationWireCoatingType type 70 | 71 | +get_*() 72 | +set_*() 73 | } 74 | 75 | InsulationWireCoating ..> InsulationMaterial : Dependency 76 | InsulationWireCoating ..> InsulationWireCoatingType : Dependency 77 | 78 | class InsulationMaterial { 79 | 80 | -InsulationMaterialComposition composition 81 | -DielectricStrengthElement dielectric_strength 82 | -String manufacturer 83 | -String name 84 | -Rating rating 85 | -Double thermal_conductivity 86 | 87 | +get_*() 88 | +set_*() 89 | } 90 | InsulationMaterial ..> InsulationMaterialComposition : Dependency 91 | 92 | class InsulationWireCoatingType { 93 | <> 94 | BARE 95 | ENAMELLED 96 | EXTRUDED 97 | INSULATED 98 | SERVED 99 | TAPED 100 | } 101 | 102 | class WireMaterial { 103 | 104 | -String name 105 | -Double permeability 106 | -Resistivity resistivity 107 | -List~ThermalConductivityElement~ thermal_conductivity 108 | 109 | +get_*() 110 | +set_*() 111 | } 112 | WireMaterial ..> Resistivity : Dependency 113 | 114 | class Resistivity { 115 | 116 | -Double reference_temperature 117 | -Double reference_value 118 | -Double temperature_coefficient 119 | 120 | +get_*() 121 | +set_*() 122 | } 123 | 124 | class WireStandard { 125 | <> 126 | IEC_60317 127 | JIS_C3202 128 | NEMA_MW_1000_C 129 | } 130 | 131 | class InsulationMaterialComposition { 132 | <> 133 | AIR 134 | BAKELITE 135 | NYLON 136 | PAPER 137 | POLYIMIDE 138 | POLYSTYRENE 139 | TEFLON 140 | } 141 | 142 | ``` 143 | 144 | 145 | ## Round wire 146 | This type of wire represents the most commonly used one, the solid round wire, with one or several conductors inside, but without insulation between them. 147 | 148 | This wire needs the following extra fields: 149 | * Conducting Diameter: Diameter of the conductive part of the wire. 150 | * Outer Diameter: Total diameter of the wire, including the conductive part and its coating. 151 | 152 | Example of solid round wire with grade 1 coating: 153 | ``` 154 | { 155 | "type": "round", 156 | "material": "copper", 157 | "numberConductors": 1, 158 | "conductingDiameter": { 159 | "nominal": 0.000140 160 | }, 161 | "outerDiameter": { 162 | "minimum": 0.000151, 163 | "maximum": 0.000160 164 | }, 165 | "coating":{ 166 | "type": "enamelled", 167 | "maximumThickness": 0.00002, 168 | "grade": 1, 169 | "breakdownVoltage": 1600 170 | } 171 | } 172 | ``` 173 | 174 | Example of solid round with Double Insulation: 175 | ``` 176 | { 177 | "type": "round", 178 | "material": "copper", 179 | "numberConductors": 1, 180 | "conductingDiameter": { 181 | "nominal": 0.000287 182 | }, 183 | "outerDiameter": { 184 | "maximum": 0.000439 185 | }, 186 | "coating": { 187 | "type": "insulated", 188 | "material": { 189 | "composition": "teflon", 190 | "name": "Tefzel ETFE", 191 | "manufacturer": "Dupont", 192 | "manufacturerPartNumber": "D29A01TXX-1.5", 193 | "dielectricStrength":[ 194 | { 195 | "value": 1800, 196 | "thickness": 0.003175 197 | } 198 | ], 199 | "rating": { 200 | "temperature": 180, 201 | "voltage": 600 202 | } 203 | }, 204 | "numberLayers": 2, 205 | "thicknessLayers": 3.81e-5, 206 | "breakdownVoltage": 4500 207 | } 208 | } 209 | ``` 210 | 211 | ## Rectangular wire 212 | This type of wire represents any wire with rectangular or square cross sectional shape, with the only exception of the foil wires. This includes strip wires, square wires, and the PCB tracks of the planar magnetics. 213 | 214 | This kind of wire needs the following extra fields: 215 | * Conducting Width: Dimension of the conductive part of the wire in the horizontal direction (x-axis or A dimension of the core). 216 | * Conducting Height: Dimension of the conductive part of the wire in the vertical direction (x-axis or B dimension of the core). 217 | * Outer Width: Total width of the wire, including the conductive part and its coating. 218 | * Outer Height: Total height of the wire, including the conductive part and its coating. 219 | 220 | Example of solid rectangular wire: 221 | ``` 222 | { 223 | "type": "rectangular", 224 | "material": "copper", 225 | "numberConductors": 1, 226 | "conductingWidth": { 227 | "minimum": 0.00393, 228 | "nominal": 0.004, 229 | "maximum": 0.00407 230 | }, 231 | "conductingHeight": { 232 | "minimum": 0.00135, 233 | "nominal": 0.0014, 234 | "maximum": 0.00145 235 | }, 236 | "outerWidth": { 237 | "nominal": 0.00405 238 | }, 239 | "outerThickness": { 240 | "minimum": 0.00138, 241 | "maximum": 0.00161 242 | }, 243 | "coating":{ 244 | "type": "enamelled", 245 | "maximumThickness": 0.00016, 246 | "grade": 1, 247 | "breakdownVoltage": 1600 248 | } 249 | } 250 | ``` 251 | 252 | Foil wire 253 | This type of wire represents a kind of rectangular wire that is really thin in one of its dimensions, typically smaller than 0.1 mm. It usually comes without coating, as the wire is cut from large sheets of copper. 254 | This wire needs the following extra fields: 255 | * Conducting Width: Dimension of the conductive part of the wire in the horizontal direction (x-axis or A dimension of the core). 256 | * Conducting Height: Dimension of the conductive part of the wire in the vertical direction (x-axis or B dimension of the core). 257 | * Outer Width: Total width of the wire, including the conductive part and its coating, if present. 258 | * Outer Height: Total height of the wire, including the conductive part and its coating, if present. 259 | 260 | Example of foil wire: 261 | ``` 262 | { 263 | "type": "foil", 264 | "material": "copper", 265 | "numberConductors": 1, 266 | "conductingHeight": { 267 | "minimum": 0.0193, 268 | "nominal": 0.02, 269 | "maximum": 0.0207 270 | }, 271 | "conductingWidth": { 272 | "nominal": 0.0001 273 | }, 274 | "outerHeight": { 275 | "minimum": 0.0193, 276 | "nominal": 0.02, 277 | "maximum": 0.0207 278 | }, 279 | "outerThickness": { 280 | "nominal": 0.0001 281 | }, 282 | "coating":{ 283 | "type": "bare" 284 | } 285 | } 286 | ``` 287 | 288 | ## Litz wire 289 | Litz wires are a kind of wires that are made by twisting and bundling together other wires (here called strands), commonly solid round wires with small diameters, although some studies are also creating Litz wires with rectangular or PCB tracks. This twisting allows each individual wire to take every possible position along the center axis of the wire, which guarantees a balanced current in all the strands. 290 | 291 | This wire needs the following extra fields: 292 | * Strand: The reference name of the solid wire used in the strands, or the fields describing it. 293 | * Outer Diameter: Total diameter of the wire, including the conductive part and its coating. 294 | 295 | Example of Litz wire: 296 | ``` 297 | { 298 | "type": "litz", 299 | "numberConductors": 20, 300 | "manufacturer": "Elektrisola", 301 | "strand": { 302 | "type": "round", 303 | "material": "copper", 304 | "numberConductors": 1, 305 | "conductingDiameter": { 306 | "nominal": 0.00008 307 | }, 308 | "outerDiameter": { 309 | "minimum": 0.000095, 310 | "maximum": 0.000101 311 | }, 312 | "coating":{ 313 | "type": "enamelled", 314 | "maximumThickness": 0.0000105, 315 | "grade": 2, 316 | "breakdownVoltage": 850 317 | } 318 | }, 319 | "outerDiameter": { 320 | "minimum": 0.540, 321 | "maximum": 0.574 322 | }, 323 | "coating": { 324 | "type": "served", 325 | "serving": "single" 326 | } 327 | } 328 | ``` 329 | -------------------------------------------------------------------------------- /samples/inputs/designRequirements/basicRequirements.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basicRequirements", 3 | "magnetizingInductance": { 4 | "minimum": 42e-6 5 | }, 6 | "turnsRatios": [ 7 | {"nominal": 4} 8 | ] 9 | } -------------------------------------------------------------------------------- /samples/inputs/designRequirements/completeRequirements.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "completeRequirements", 3 | "magnetizingInductance": { 4 | "minimum": 42e-6 5 | }, 6 | "turnsRatios": [ 7 | {"nominal": 4} 8 | ], 9 | "leakageInductance": [ 10 | {"maximum": 2e-6} 11 | ], 12 | "strayCapacitance": [ 13 | {"maximum": 100e-9} 14 | ], 15 | "operatingTemperature": { 16 | "maximum": 123 17 | }, 18 | "insulation": { 19 | "altitude": { 20 | "maximum": 3000, 21 | "minimum": -50 22 | }, 23 | "cti": "Group II", 24 | "pollutionDegree": "P3", 25 | "overvoltageCategory": "OVC-III", 26 | "insulationType": "Double", 27 | "standards": ["IEC 60664-1"] 28 | }, 29 | "market": "Military", 30 | "topology": "Flyback Converter", 31 | "maximumWeight": 3, 32 | "maximumDimensions": {"width": 0.1, "height": 0.05, "depth": 0.04}, 33 | "terminalType": ["SMT", "Flying Lead"] 34 | } -------------------------------------------------------------------------------- /samples/inputs/operatingPointExcitation/triangular_equidistant.json: -------------------------------------------------------------------------------- 1 | { 2 | "frequency": 100000, 3 | "current": { 4 | "waveform": { 5 | "data": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.4, 0.3, 0.2, 0.1] 6 | }, 7 | "processed": { 8 | "label": "Triangular", 9 | "peakToPeak": 0.5, 10 | "offset": 0, 11 | "dutyCycle": 0.5 12 | } 13 | }, 14 | "voltage": { 15 | "waveform": { 16 | "data": [-10, 10, 10, 10, 10, 10, -10, -10, -10, -10] 17 | }, 18 | "processed": { 19 | "label": "Rectangular", 20 | "peakToPeak": 20, 21 | "offset": 0, 22 | "dutyCycle": 0.5 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /samples/magnetic/bobbin/bobbin_E19_5.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Bobbin E19/5", 3 | "functionalDescription": { 4 | "type": "standard", 5 | "family": "e", 6 | "familySubtype": "Basic", 7 | "shape": "E19/5", 8 | "dimensions": { 9 | "c": {"minimum": 0.00535}, 10 | "e": {"maximum": 0.01400}, 11 | "f": {"minimum": 0.00485}, 12 | "k": {"minimum": 0.01400}, 13 | "l2": {"maximum": 0.01060}, 14 | "s1": {"minimum": 0.00080}, 15 | "s2": {"minimum": 0.00080} 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/magnetic/coil/inductor_42_turns.json: -------------------------------------------------------------------------------- 1 | { 2 | "bobbin": { 3 | "processedDescription": { 4 | "wallThickness": 0.001, 5 | "columnThickness": 0.001, 6 | "columnDepth": 0.005, 7 | "columnShape": "round", 8 | "windingWindows": [{ 9 | "height": 0.01, 10 | "width": 0.01, 11 | "coordinates": [0.01, 0, 0] 12 | }] 13 | } 14 | }, 15 | "functionalDescription":[ 16 | { 17 | "name": "MyWinding", 18 | "numberTurns": 42, 19 | "numberParallels": 2, 20 | "connections": [{"pinName": "1"}, {"pinName": "2"}], 21 | "isolationSide": "primary", 22 | "wire": "Dummy" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /samples/magnetic/core/core_E_19_8_5_N87_substractive.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core_E_19_8_5_N87_substractive", 3 | "functionalDescription": { 4 | "type": "two-piece set", 5 | "material": "N87", 6 | "shape": "E 19/8/5", 7 | "gapping": [{ 8 | "type": "subtractive", 9 | "length": 0.0005 10 | }, 11 | { 12 | "type": "residual", 13 | "length": 0.00001 14 | },{ 15 | "type": "residual", 16 | "length": 0.00001 17 | }], 18 | "numberStacks": 1 19 | } 20 | } -------------------------------------------------------------------------------- /samples/magnetic/core/core_E_55_21_N97_additive.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core_E_55_21_N97_additive", 3 | "functionalDescription": { 4 | "type": "two-piece set", 5 | "material": "N97", 6 | "shape": "E 55/21", 7 | "gapping": [{ 8 | "type": "additive", 9 | "length": 0.001 10 | },{ 11 | "type": "residual", 12 | "length": 0.00001 13 | },{ 14 | "type": "residual", 15 | "length": 0.00001 16 | }], 17 | "numberStacks": 2 18 | } 19 | } -------------------------------------------------------------------------------- /samples/magnetic/core/core_E_55_28_21_3C95_additive.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core_E_55_28_21_3C95_additive", 3 | "functionalDescription": { 4 | "type": "two-piece set", 5 | "material": "3C95", 6 | "shape": "E 55/28/21", 7 | "gapping": [{ 8 | "type": "additive", 9 | "length": 0.001 10 | },{ 11 | "type": "residual", 12 | "length": 0.00001 13 | },{ 14 | "type": "residual", 15 | "length": 0.00001 16 | }], 17 | "numberStacks": 3 18 | } 19 | } -------------------------------------------------------------------------------- /samples/magnetic/core/core_PQ_35_35_N97_additive.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core_PQ_35_35_N97_additive", 3 | "functionalDescription": { 4 | "type": "two-piece set", 5 | "material": "N97", 6 | "shape": "PQ 35/35", 7 | "gapping": [{ 8 | "type": "additive", 9 | "length": 0.001 10 | },{ 11 | "type": "residual", 12 | "length": 0.00001 13 | },{ 14 | "type": "residual", 15 | "length": 0.00001 16 | }], 17 | "numberStacks": 2 18 | }, 19 | "geometricalDescription": [ 20 | { 21 | "type": "half set", 22 | "material": "N97", 23 | "shape": "PQ 35/35", 24 | "coordinates": [0, -0.0355, -0.01], 25 | "rotation": [0, 0, 0] 26 | }, 27 | { 28 | "type": "half set", 29 | "material": "N97", 30 | "shape": "PQ 35/35", 31 | "coordinates": [0, 0.0355, -0.01], 32 | "rotation": [0, 0, 0] 33 | }, 34 | { 35 | "type": "spacer", 36 | "insulationMaterial": "plastic", 37 | "dimensions": [0.02, 0.001, 0.02], 38 | "coordinates": [0, 0, 0] 39 | }, 40 | { 41 | "type": "half set", 42 | "material": "N97", 43 | "shape": "PQ 35/35", 44 | "coordinates": [0, -0.0355, 0.01], 45 | "rotation": [0, 0, 0] 46 | }, 47 | { 48 | "type": "half set", 49 | "material": "N97", 50 | "shape": "PQ 35/35", 51 | "coordinates": [0, 0.0355, 0.01], 52 | "rotation": [0, 0, 0] 53 | } 54 | ] 55 | } -------------------------------------------------------------------------------- /samples/magnetic/core/core_PQ_35_35_N97_substractive.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core_PQ_35_35_N97_substractive", 3 | "functionalDescription": { 4 | "type": "two-piece set", 5 | "material": "N97", 6 | "shape": "PQ 35/35", 7 | "gapping": [{ 8 | "type": "subtractive", 9 | "length": 0.001 10 | },{ 11 | "type": "residual", 12 | "length": 0.00001 13 | },{ 14 | "type": "residual", 15 | "length": 0.00001 16 | }], 17 | "numberStacks": 2 18 | }, 19 | "geometricalDescription": [ 20 | { 21 | "type": "half set", 22 | "material": "N97", 23 | "shape": "PQ 35/35", 24 | "coordinates": [0, -0.035, -0.01], 25 | "rotation": [0, 0, 0] 26 | }, 27 | { 28 | "type": "half set", 29 | "material": "N97", 30 | "shape": "PQ 35/35", 31 | "coordinates": [0, 0.035, -0.01], 32 | "rotation": [0, 0, 0], 33 | "machining": [ 34 | { 35 | "length": 0.001, 36 | "coordinates": [0, 0, 0] 37 | } 38 | ] 39 | }, 40 | { 41 | "type": "half set", 42 | "material": "N97", 43 | "shape": "PQ 35/35", 44 | "coordinates": [0, -0.035, 0.01], 45 | "rotation": [0, 0, 0] 46 | }, 47 | { 48 | "type": "half set", 49 | "material": "N97", 50 | "shape": "PQ 35/35", 51 | "coordinates": [0, 0.035, 0.01], 52 | "rotation": [0, 0, 0], 53 | "machining": [ 54 | { 55 | "length": 0.001, 56 | "coordinates": [0, 0, 0] 57 | } 58 | ] 59 | } 60 | ] 61 | } -------------------------------------------------------------------------------- /samples/magnetic/core/core_T_40_24_16_N97.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core_T_40_24_16_N97", 3 | "functionalDescription": { 4 | "type": "toroidal", 5 | "material": "N97", 6 | "shape": "T 40/24/16", 7 | "gapping": [], 8 | "numberStacks": 1 9 | } 10 | } -------------------------------------------------------------------------------- /samples/magnetic/core/material/Ferroxcube_3C97_roshen.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "commercial", 3 | "material": "ferrite", 4 | "name": "3C97", 5 | "manufacturerInfo": { 6 | "name": "Ferroxcube" 7 | }, 8 | "permeability": { 9 | "initial":{ 10 | "value": 3000, 11 | "tolerance": 0.20, 12 | "temperature": 25, 13 | "magneticFluxDensityPeak": 0.00025 14 | } 15 | }, 16 | "saturation": [ 17 | { 18 | "magneticFluxDensity": 0.3912714191587269, 19 | "magneticField": 80, 20 | "temperature": 25 21 | }, 22 | { 23 | "magneticFluxDensity": 0.35221929492417337, 24 | "magneticField": 75, 25 | "temperature": 100 26 | } 27 | ], 28 | "remanence": [ 29 | { 30 | "magneticFluxDensity": 0.13258847770214024, 31 | "magneticField": 0, 32 | "temperature": 25 33 | }, 34 | { 35 | "magneticFluxDensity": 0.05772561749292473, 36 | "magneticField": 0, 37 | "temperature": 100 38 | } 39 | ], 40 | "coerciveForce": [ 41 | { 42 | "magneticFluxDensity": 0, 43 | "magneticField": 14.418946774162618, 44 | "temperature": 25 45 | }, 46 | { 47 | "magneticFluxDensity": 0, 48 | "magneticField": 8.669621596391217, 49 | "temperature": 100 50 | } 51 | ], 52 | "resistivity": [ 53 | { 54 | "value": 5, 55 | "temperature": 25 56 | } 57 | ], 58 | "volumetricLosses": { 59 | "default": [ 60 | { 61 | "method": "roshen" 62 | } 63 | ] 64 | } 65 | } 66 | 67 | 68 | -------------------------------------------------------------------------------- /samples/magnetic/core/material/Ferroxcube_3C97_steinmetz.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "commercial", 3 | "material": "ferrite", 4 | "name": "3C97", 5 | "manufacturerInfo": { 6 | "name": "Ferroxcube" 7 | }, 8 | "permeability": { 9 | "initial": { 10 | "value": 3000 11 | } 12 | }, 13 | "saturation": [ 14 | { 15 | "magneticFluxDensity": 0.35221929492417337, 16 | "magneticField": 75, 17 | "temperature": 100 18 | } 19 | ], 20 | "resistivity": [ 21 | { 22 | "value": 5, 23 | "temperature": 25 24 | } 25 | ], 26 | "volumetricLosses": { 27 | "default": [ 28 | { 29 | "method": "steinmetz", 30 | "ranges": [ 31 | { 32 | "minimumFrequency": 20000, 33 | "maximumFrequency": 150000, 34 | "k": 42.36588301, 35 | "alpha": 1.16, 36 | "beta": 2.8, 37 | "ct0": 0.0000635519, 38 | "ct1": 0.01100719, 39 | "ct2": 1.465 40 | } 41 | ] 42 | } 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /samples/magnetic/core/shape/shape_custom_PQ.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "custom", 3 | "family": "pq", 4 | "dimensions": { 5 | "A": 0.0209, 6 | "B": 0.0082, 7 | "C": 0.0144, 8 | "D": 0.0053, 9 | "E": 0.0184, 10 | "F": 0.009, 11 | "G": 0.013, 12 | "J": 0.0048, 13 | "L": 0.0105 14 | } 15 | } -------------------------------------------------------------------------------- /samples/magnetic/core/shape/shape_standard_PQ_20_16.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "standard", 3 | "name": "PQ 20/16", 4 | "family": "pq" 5 | } -------------------------------------------------------------------------------- /samples/magnetic/insulation/material/bakelite.json: -------------------------------------------------------------------------------- 1 | { 2 | "composition": "bakelite", 3 | "name": "bakelite", 4 | "thermalConductivity": 0.19, 5 | "dielectricStrength": [ 6 | { 7 | "value": 24e6 8 | } 9 | ] 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/magnetic/insulation/material/kapton_hn.json: -------------------------------------------------------------------------------- 1 | { 2 | "composition": "polyimide", 3 | "name": "Kapton HN", 4 | "manufacturer": "DuPont", 5 | "thermalConductivity": 0.2, 6 | "dielectricStrength": [ 7 | { 8 | "value": 303e6, 9 | "thickness": 25e-6, 10 | "humidity": 0.5 11 | }, 12 | { 13 | "value": 240e6, 14 | "thickness": 50e-6, 15 | "humidity": 0.5 16 | }, 17 | { 18 | "value": 205e6, 19 | "thickness": 75e-6, 20 | "humidity": 0.5 21 | }, 22 | { 23 | "value": 154e6, 24 | "thickness": 125e-6, 25 | "humidity": 0.5 26 | }, 27 | { 28 | "value": 339e6, 29 | "thickness": 25e-6, 30 | "humidity": 0 31 | }, 32 | { 33 | "value": 315e6, 34 | "thickness": 25e-6, 35 | "humidity": 0.3 36 | }, 37 | { 38 | "value": 280e6, 39 | "thickness": 25e-6, 40 | "humidity": 0.8 41 | }, 42 | { 43 | "value": 268e6, 44 | "thickness": 25e-6, 45 | "humidity": 1 46 | } 47 | ] 48 | } 49 | 50 | 51 | -------------------------------------------------------------------------------- /samples/magnetic/wire/foil/foil_0.02_0.0001.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "foil", 3 | "material": "copper", 4 | "numberConductors": 1, 5 | "conductingHeight": { 6 | "minimum": 0.0193, 7 | "nominal": 0.02, 8 | "maximum": 0.0207 9 | }, 10 | "conductingWidth": { 11 | "nominal": 0.0001 12 | }, 13 | "outerHeight": { 14 | "minimum": 0.0193, 15 | "nominal": 0.02, 16 | "maximum": 0.0207 17 | }, 18 | "outerWidth": { 19 | "nominal": 0.0001 20 | }, 21 | "coating":{ 22 | "type": "bare" 23 | } 24 | } -------------------------------------------------------------------------------- /samples/magnetic/wire/litz/Litz_20x0.8.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "litz", 3 | "numberConductors": 20, 4 | "manufacturerInfo": {"name": "Elektrisola"}, 5 | "strand": { 6 | "type": "round", 7 | "material": "copper", 8 | "numberConductors": 1, 9 | "conductingDiameter": { 10 | "nominal": 0.00008 11 | }, 12 | "outerDiameter": { 13 | "minimum": 0.000095, 14 | "maximum": 0.000101 15 | }, 16 | "coating":{ 17 | "type": "enamelled", 18 | "thickness": { 19 | "maximum": 0.0000105 20 | }, 21 | "grade": 2, 22 | "breakdownVoltage": 850 23 | } 24 | }, 25 | "outerDiameter": { 26 | "minimum": 0.540, 27 | "maximum": 0.574 28 | }, 29 | "coating": { 30 | "type": "served", 31 | "serving": "single" 32 | } 33 | } -------------------------------------------------------------------------------- /samples/magnetic/wire/litz/TXXL550_44FXXX-2(MWXX).json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "litz", 3 | "numberConductors": 550, 4 | "manufacturerInfo": { 5 | "name": "Rubadue", 6 | "reference": "TXXL550/44FXXX-3(MWXX)" 7 | }, 8 | "strand": { 9 | "type": "round", 10 | "material": "copper", 11 | "numberConductors": 1, 12 | "conductingDiameter": { 13 | "nominal": 5.08e-5 14 | }, 15 | "outerDiameter": { 16 | "nominal": 6.35e-5 17 | }, 18 | "coating":{ 19 | "type": "enamelled", 20 | "thickness": { 21 | "maximum": 2.54e-6 22 | }, 23 | "grade": 1, 24 | "breakdownVoltage": 1600 25 | } 26 | }, 27 | "outerDiameter": { 28 | "maximum": 0.00220726 29 | }, 30 | "coating": { 31 | "type": "insulated", 32 | "material": { 33 | "composition": "teflon", 34 | "name": "FEP", 35 | "manufacturer": "Rubadue", 36 | "dielectricStrength":[ 37 | { 38 | "value": 260e6, 39 | "thickness": 0.0000254 40 | }, 41 | { 42 | "value": 70e6, 43 | "thickness": 0.005 44 | } 45 | ], 46 | "rating": { 47 | "temperature": 155, 48 | "voltage": 1000 49 | } 50 | }, 51 | "numberLayers": 3, 52 | "thicknessLayers": 7.62e-5 53 | } 54 | } -------------------------------------------------------------------------------- /samples/magnetic/wire/material/copper.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "copper", 3 | "permeability": 0.999994, 4 | "resistivity": { 5 | "referenceValue": 1.678e-08, 6 | "referenceTemperature": 20.0, 7 | "temperatureCoefficient": 0.004041 8 | }, 9 | "thermalConductivity": [ 10 | { 11 | "value": 413, 12 | "temperature": -73 13 | }, 14 | { 15 | "value": 401, 16 | "temperature": 0 17 | }, 18 | { 19 | "value": 392, 20 | "temperature": 127 21 | }, 22 | { 23 | "value": 383, 24 | "temperature": 327 25 | }, 26 | { 27 | "value": 371, 28 | "temperature": 527 29 | }, 30 | { 31 | "value": 357, 32 | "temperature": 727 33 | }, 34 | { 35 | "value": 342, 36 | "temperature": 927 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /samples/magnetic/wire/rectangular/rectangular_0.0014_0.004.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "rectangular", 3 | "material": "copper", 4 | "numberConductors": 1, 5 | "conductingHeight": { 6 | "minimum": 0.00393, 7 | "nominal": 0.004, 8 | "maximum": 0.00407 9 | }, 10 | "conductingWidth": { 11 | "minimum": 0.00135, 12 | "nominal": 0.0014, 13 | "maximum": 0.00145 14 | }, 15 | "outerHeight": { 16 | "nominal": 0.00405 17 | }, 18 | "outerWidth": { 19 | "minimum": 0.00138, 20 | "maximum": 0.00161 21 | }, 22 | "coating":{ 23 | "type": "enamelled", 24 | "thickness": { 25 | "maximum": 0.00016 26 | }, 27 | "grade": 1, 28 | "breakdownVoltage": 1600 29 | } 30 | } -------------------------------------------------------------------------------- /samples/magnetic/wire/round/0.000140.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "round", 3 | "material": "copper", 4 | "numberConductors": 1, 5 | "conductingDiameter": { 6 | "nominal": 0.000140 7 | }, 8 | "outerDiameter": { 9 | "minimum": 0.000151, 10 | "maximum": 0.000160 11 | }, 12 | "coating":{ 13 | "type": "enamelled", 14 | "thickness": { 15 | "maximum": 0.00002 16 | }, 17 | "grade": 1, 18 | "breakdownVoltage": 1600 19 | } 20 | } -------------------------------------------------------------------------------- /samples/magnetic/wire/round/D29A01TXX-1.5.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "round", 3 | "material": "copper", 4 | "numberConductors": 1, 5 | "conductingDiameter": { 6 | "nominal": 0.000287 7 | }, 8 | "outerDiameter": { 9 | "maximum": 0.000439 10 | }, 11 | "coating": { 12 | "type": "insulated", 13 | "material": { 14 | "composition": "teflon", 15 | "name": "Tefzel ETFE", 16 | "manufacturer": "Dupont", 17 | "manufacturerPartNumber": "D29A01TXX-1.5", 18 | "dielectricStrength":[ 19 | { 20 | "value": 1800, 21 | "thickness": 0.003175 22 | } 23 | ], 24 | "rating": { 25 | "temperature": 180, 26 | "voltage": 600 27 | } 28 | }, 29 | "numberLayers": 2, 30 | "thicknessLayers": 3.81e-5, 31 | "breakdownVoltage": 4500 32 | } 33 | } -------------------------------------------------------------------------------- /schemas/MAS.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/MAS.json", 4 | "title": "MAS", 5 | "description": "All the data structure used in the Magnetic Agnostic Structure", 6 | "type": "object", 7 | "properties": { 8 | "inputs":{ 9 | "description": "The description of the inputs that can be used to design a Magnetic", 10 | "title": "Inputs", 11 | "$ref": "/schemas/inputs.json" 12 | }, 13 | "magnetic":{ 14 | "description": "The description of a magnetic", 15 | "title": "Magnetic", 16 | "$ref": "/schemas/magnetic.json" 17 | }, 18 | "outputs":{ 19 | "description": "The description of the outputs that are produced after designing a Magnetic", 20 | "title": "Outputs", 21 | "type": "array", 22 | "items": { 23 | "$ref": "/schemas/outputs.json" 24 | }, 25 | } 26 | }, 27 | "required": ["inputs", "magnetic", "outputs"] 28 | } -------------------------------------------------------------------------------- /schemas/inputs.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/inputs.json", 4 | "title": "inputs", 5 | "description": "The description of the inputs that can be used to design a Magnetic", 6 | "type": "object", 7 | "properties": { 8 | "operatingPoints":{ 9 | "description": "Data describing the operating points", 10 | "title": "operatingPoints", 11 | "type": "array", 12 | "items": { 13 | "$ref": "/schemas/inputs/operatingPoint.json" 14 | }, 15 | "minItems": 1 16 | }, 17 | "designRequirements":{ 18 | "description": "Data describing the design requirements", 19 | "title": "designRequirements", 20 | "$ref": "/schemas/inputs/designRequirements.json" 21 | }, 22 | "converterInformation":{ 23 | "title": "converterInformation", 24 | "type": "object", 25 | "properties": { 26 | "supportedTopologies":{ 27 | "type": "object", 28 | "properties": { 29 | "flyback": { 30 | "$ref": "/schemas/inputs/topologies/flyback.json", 31 | } 32 | } 33 | } 34 | }, 35 | } 36 | }, 37 | "required": ["operatingPoints", "designRequirements"], 38 | 39 | "$defs": { 40 | } 41 | } -------------------------------------------------------------------------------- /schemas/inputs/designRequirements.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/inputs/designRequirements.json", 4 | "title": "designRequirements", 5 | "description": "The list of requirement that must comply a given magnetic", 6 | "type": "object", 7 | "properties": { 8 | "name": { 9 | "description": "A label that identifies these Design Requirements", 10 | "type": "string" 11 | }, 12 | "magnetizingInductance": { 13 | "description": "Required values for the magnetizing inductance", 14 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 15 | }, 16 | "turnsRatios": { 17 | "description": "Required turns ratios between primary and the rest of windings", 18 | "type": "array", 19 | "items": { 20 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 21 | }, 22 | "minItems": 0 23 | }, 24 | "minimumImpedance": { 25 | "description": "List of minimum impedance at given frequency in the primary", 26 | "type": "array", 27 | "items": { 28 | "type": "object", 29 | "title": "impedanceAtFrequency", 30 | "properties": { 31 | "impedance": { 32 | "$ref": "#/$defs/impedancePoint" 33 | }, 34 | "frequency": { 35 | "type": "number", 36 | "minimum": 0 37 | } 38 | }, 39 | "required": ["impedance", "frequency"] 40 | }, 41 | "minItems": 1 42 | }, 43 | "leakageInductance": { 44 | "description": "Required values for the leakage inductance", 45 | "type": "array", 46 | "items": { 47 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 48 | }, 49 | "minItems": 0 50 | }, 51 | "strayCapacitance": { 52 | "description": "Required values for the stray capacitance", 53 | "type": "array", 54 | "items": { 55 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 56 | }, 57 | "minItems": 0 58 | }, 59 | "isolationSides": { 60 | "description": "Isolation side where each winding is connected to.", 61 | "type": "array", 62 | "items": { 63 | "$ref": "/schemas/utils.json#/$defs/isolationSide" 64 | }, 65 | "minItems": 1 66 | }, 67 | "operatingTemperature": { 68 | "description": "Required values for the temperature that the magnetic can reach under operating", 69 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 70 | }, 71 | "insulation": { 72 | "title": "insulationRequirements", 73 | "type": "object", 74 | "properties": { 75 | "altitude": { 76 | "description": "Required values for the altitude", 77 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 78 | }, 79 | "cti": { 80 | "description": "Required CTI", 81 | "type": "string", 82 | "enum": ["Group I", "Group II", "Group IIIA", "Group IIIB"] 83 | }, 84 | "pollutionDegree": { 85 | "description": "Required pollution for the magnetic to work under", 86 | "type": "string", 87 | "enum": ["P1", "P2", "P3"] 88 | }, 89 | "overvoltageCategory": { 90 | "description": "Required overvoltage category", 91 | "type": "string", 92 | "enum": ["OVC-I", "OVC-II", "OVC-III", "OVC-IV"] 93 | }, 94 | "insulationType": { 95 | "description": "Required type of insulation", 96 | "type": "string", 97 | "enum": ["Functional", "Basic", "Supplementary", "Double", "Reinforced"] 98 | }, 99 | "mainSupplyVoltage": { 100 | "description": "Voltage RMS of the main supply to which this transformer is connected to.", 101 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 102 | }, 103 | "standards": { 104 | "description": "VList of standards that will be taken into account for insulation.", 105 | "type": "array", 106 | "items": { 107 | "type": "string", 108 | "title": "insulationStandards", 109 | "enum": ["IEC 60664-1", "IEC 61558-1", "IEC 60335-1", "IEC 62368-1"] 110 | }, 111 | "minItems": 1 112 | } 113 | } 114 | }, 115 | "market": { 116 | "description": "Market where the magnetic will end up being used", 117 | "type": "string", 118 | "enum": ["Medical", "Commercial", "Industrial", "Military", "Space"] 119 | }, 120 | "topology": { 121 | "description": "Topology that will use the magnetic", 122 | "type": "string", 123 | "title": "topologies", 124 | "enum": ["Buck Converter", "Boost Converter", "Inverting Buck-Boost Converter", "SEPIC", "Cuk Converter", "Zeta Converter", "Flyback Converter", "Two Switch Flyback Converter", "Active Clamp Forward Converter", "Single Switch Forward Converter", "Two Switch Forward Converter", "Push-Pull Converter", "Weinberg Converter", "Half-Bridge Converter", "Full-Bridge Converter", "Phase-Shifted Full-Bridge Converter"] 125 | 126 | }, 127 | "wiringTechnology": { 128 | "description": "Technology that must be used to create the wiring", 129 | "type": "string", 130 | "enum": ["Wound", "Printed", "Deposition"] 131 | }, 132 | "maximumWeight": { 133 | "description": "Maximum weight for the designed magnetic, in Kg", 134 | "type": "number" 135 | }, 136 | "maximumDimensions": { 137 | "description": "Maximum dimensions, width, height, and depth, for the designed magnetic, in m", 138 | "type": "object", 139 | "properties": { 140 | "width": { 141 | "type": "number" 142 | }, 143 | "height": { 144 | "type": "number" 145 | }, 146 | "depth": { 147 | "type": "number" 148 | } 149 | } 150 | }, 151 | "terminalType": { 152 | "description": "Type of the terminal that must be used, per winding", 153 | "type": "array", 154 | "items": { 155 | "$ref": "/schemas/utils.json#/$defs/connectionType" 156 | } 157 | } 158 | }, 159 | "required": ["magnetizingInductance", "turnsRatios"], 160 | 161 | "$defs": { 162 | "impedancePoint":{ 163 | "description": "Data describing one impendance value", 164 | "title": "impedancePoint", 165 | "type": "object", 166 | "properties": { 167 | "magnitude":{ 168 | "description": "Magnitude of the impedance, in Ohm", 169 | "type": "number", 170 | "minimum": 0 171 | }, 172 | "phase":{ 173 | "type": "number" 174 | }, 175 | "realPart":{ 176 | "type": "number" 177 | }, 178 | "imaginaryPart":{ 179 | "type": "number" 180 | } 181 | }, 182 | "required": ["magnitude"] 183 | } 184 | } 185 | } -------------------------------------------------------------------------------- /schemas/inputs/operatingConditions.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/inputs/operatingConditions.json", 4 | "title": "operatingConditions", 5 | "description": "The description of a magnetic operating conditions", 6 | "type": "object", 7 | "properties": { 8 | "name": { 9 | "description": "A label that identifies this Operating Conditions", 10 | "type": "string" 11 | }, 12 | "ambientTemperature": { 13 | "description": "Temperature of the ambient where the magnetic will operate", 14 | "type": "number", 15 | "minimum": -273.15 16 | }, 17 | "ambientRelativeHumidity": { 18 | "description": "Relative Humidity of the ambient where the magnetic will operate", 19 | "type": "number", 20 | "minimum": 0, 21 | "maximum": 100 22 | }, 23 | "cooling": { 24 | "description": "Relative Humidity of the ambient where the magnetic will operate", 25 | "title": "cooling", 26 | "oneOf": [ 27 | {"$ref": "#/$defs/naturalConvectionCooling"}, 28 | {"$ref": "#/$defs/forcedConvectionCooling"}, 29 | {"$ref": "#/$defs/heatsinkCooling"}, 30 | {"$ref": "#/$defs/coldPlateCooling"} 31 | ] 32 | } 33 | }, 34 | "required": ["ambientTemperature"], 35 | 36 | "$defs": { 37 | "naturalConvectionCooling":{ 38 | "description": "Data describing a natural convection cooling", 39 | "type": "object", 40 | "title": "forcedConvectionCooling", 41 | "properties": { 42 | "temperature": { 43 | "description": "Temperature of the fluid. To be used only if different from ambient temperature", 44 | "type": "number" 45 | }, 46 | "fluid": { 47 | "description": "Name of the fluid used", 48 | "type": "string", 49 | "default": "air" 50 | } 51 | }, 52 | "required": ["temperature"] 53 | }, 54 | "forcedConvectionCooling":{ 55 | "description": "Data describing a forced convection cooling", 56 | "type": "object", 57 | "title": "forcedConvectionCooling", 58 | "properties": { 59 | "velocity": { 60 | "$ref": "/schemas/utils.json#/$defs/velocity" 61 | }, 62 | "flowDiameter": { 63 | "description": "Diameter of the fluid flow, normally defined as a fan diameter", 64 | "type": "number" 65 | }, 66 | "temperature": { 67 | "description": "Temperature of the fluid. To be used only if different from ambient temperature", 68 | "type": "number" 69 | }, 70 | "fluid": { 71 | "description": "Name of the fluid used", 72 | "type": "string", 73 | "default": "air" 74 | } 75 | }, 76 | "required": ["velocity"] 77 | }, 78 | "heatsinkCooling":{ 79 | "description": "Data describing a heatsink cooling", 80 | "type": "object", 81 | "title": "heatsinkCooling", 82 | "properties": { 83 | "thermalResistance": { 84 | "description": "Bulk thermal resistance of the heat sink, in W/K", 85 | "type": "number" 86 | }, 87 | "interfaceThermalResistance": { 88 | "description": "Bulk thermal resistance of the thermal interface used to connect the device to the heatsink, in W/mK", 89 | "type": "number" 90 | }, 91 | "interfaceThickness": { 92 | "description": "Thickness of the thermal interface used to connect the device to the heatsink, in m", 93 | "type": "number" 94 | }, 95 | "dimensions": { 96 | "description": "Dimensions of the cube defining the heatsink", 97 | "$ref": "/schemas/utils.json#/$defs/dimensions" 98 | } 99 | }, 100 | "required": ["thermalResistance"] 101 | }, 102 | "coldPlateCooling":{ 103 | "description": "Data describing a cold plate cooling", 104 | "type": "object", 105 | "title": "heatsinkCooling", 106 | "properties": { 107 | "thermalResistance": { 108 | "description": "Bulk thermal resistance of the cold plate, in W/K", 109 | "type": "number" 110 | }, 111 | "maximumTemperature": { 112 | "description": "Maximum temperature of the cold plate", 113 | "type": "number" 114 | }, 115 | "interfaceThermalResistance": { 116 | "description": "Bulk thermal resistance of the thermal interface used to connect the device to the cold plate, in W/mK", 117 | "type": "number" 118 | }, 119 | "interfaceThickness": { 120 | "description": "Thickness of the thermal interface used to connect the device to the cold plate, in m", 121 | "type": "number" 122 | }, 123 | "dimensions": { 124 | "description": "Dimensions of the cube defining the cold plate", 125 | "$ref": "/schemas/utils.json#/$defs/dimensions" 126 | } 127 | }, 128 | "required": ["maximumTemperature"] 129 | } 130 | } 131 | } -------------------------------------------------------------------------------- /schemas/inputs/operatingPoint.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/inputs/operatingPoint.json", 4 | "title": "operatingPoint", 5 | "description": "Data describing one operating point, including the operating conditions and the excitations for all ports", 6 | "type": "object", 7 | "properties": { 8 | "name":{ 9 | "description": "Name describing this operating point", 10 | "type": "string" 11 | }, 12 | "conditions":{ 13 | "title": "operatingConditions", 14 | "$ref": "/schemas/inputs/operatingConditions.json" 15 | }, 16 | "excitationsPerWinding": { 17 | "title": "excitationsPerWinding", 18 | "type": "array", 19 | "items": { 20 | "title": "OperatingPointExcitationPerWinding", 21 | "description": "Data describing the excitation of the winding", 22 | "$ref": "/schemas/inputs/operatingPointExcitation.json" 23 | }, 24 | "minItems": 1 25 | } 26 | }, 27 | "required": ["conditions", "excitationsPerWinding"], 28 | 29 | "$defs": { 30 | } 31 | } -------------------------------------------------------------------------------- /schemas/inputs/operatingPointExcitation.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/inputs/operatingPointExcitation.json", 4 | "title": "operatingPointExcitation", 5 | "description": "The description of a magnetic operating point", 6 | "type": "object", 7 | "properties": { 8 | "name": { 9 | "description": "A label that identifies this Operating Point", 10 | "type": "string" 11 | }, 12 | "frequency": { 13 | "description": "Frequency of the waveform, common for all electromagnetic parameters, in Hz", 14 | "type": "number", 15 | "minimum": 0 16 | }, 17 | "current":{ 18 | "$ref": "#/$defs/signalDescriptor" 19 | }, 20 | "voltage":{ 21 | "$ref": "#/$defs/signalDescriptor" 22 | }, 23 | "magneticFluxDensity":{ 24 | "$ref": "#/$defs/signalDescriptor" 25 | }, 26 | "magneticFieldStrength":{ 27 | "$ref": "#/$defs/signalDescriptor" 28 | }, 29 | "magnetizingCurrent":{ 30 | "$ref": "#/$defs/signalDescriptor" 31 | } 32 | }, 33 | "anyOf": [ 34 | {"required": ["frequency", "current", "voltage"]}, 35 | {"required": ["frequency", "magneticFluxDensity"]} 36 | ], 37 | 38 | "$defs": { 39 | "waveformLabel": { 40 | "description": "Label of the waveform, if applicable. Used for common waveforms", 41 | "title": "waveformLabel", 42 | "type": "string", 43 | "enum": ["Custom", "Triangular", "Sinusoidal", "Rectangular", "Unipolar Rectangular", "Unipolar Triangular", "Bipolar Rectangular", "Bipolar Triangular", "Flyback Primary", "Flyback Secondary", "Rectangular With Deadtime", "Flyback Secondary With Deadtime", "RectangularDCM", "Secondary Rectangular" , "Secondary Rectangular With Deadtime"] 44 | }, 45 | "signalDescriptor":{ 46 | "description": "Structure definining one electromagnetic parameters: current, voltage, magnetic flux density", 47 | "type": "object", 48 | "title": "signalDescriptor", 49 | "properties": { 50 | "waveform": { 51 | "oneOf": [ 52 | {"$ref": "#/$defs/equidistantWaveform"}, 53 | {"$ref": "#/$defs/compressedWaveform"} 54 | ] 55 | }, 56 | "processed": { 57 | "type": "object", 58 | "properties": { 59 | "label": { 60 | "$ref": "#/$defs/waveformLabel" 61 | }, 62 | "dutyCycle": { 63 | "description": "The duty cycle of the waveform, if applicable", 64 | "type": "number", 65 | "minimum": 0, 66 | "maximum": 1 67 | }, 68 | "deadTime": { 69 | "description": "The dead time after TOn and Toff, in seconds, if applicable", 70 | "type": "number" 71 | }, 72 | "peakToPeak": { 73 | "description": "The peak to peak value of the waveform", 74 | "type": "number", 75 | "minimum": 0 76 | }, 77 | "peak": { 78 | "description": "The maximum positive value of the waveform", 79 | "type": "number", 80 | "minimum": 0 81 | }, 82 | "phase": { 83 | "description": "The phase of the waveform, in degrees", 84 | "type": "number", 85 | "default": 0 86 | }, 87 | "offset": { 88 | "description": "The offset value of the waveform, referred to 0", 89 | "type": "number" 90 | }, 91 | "average": { 92 | "description": "The average value of the waveform, referred to 0", 93 | "type": "number" 94 | }, 95 | "rms": { 96 | "description": "The RMS value of the waveform", 97 | "type": "number", 98 | "minimum": 0 99 | }, 100 | "effectiveFrequency": { 101 | "description": "The effective frequency value of the waveform, according to https://sci-hub.wf/https://ieeexplore.ieee.org/document/750181, Appendix C", 102 | "type": "number", 103 | "minimum": 0 104 | }, 105 | "acEffectiveFrequency": { 106 | "description": "The effective frequency value of the AC component of the waveform, according to https://sci-hub.wf/https://ieeexplore.ieee.org/document/750181, Appendix C", 107 | "type": "number", 108 | "minimum": 0 109 | }, 110 | "thd": { 111 | "description": "The Total Harmonic Distortion of the waveform, according to https://en.wikipedia.org/wiki/Total_harmonic_distortion", 112 | "type": "number" 113 | } 114 | }, 115 | "anyOf": [ 116 | {"required": ["label", "peakToPeak", "offset" ]}, 117 | {"required": ["label", "peak", "offset" ]} 118 | ] 119 | }, 120 | "harmonics": { 121 | "description": "Data containing the harmonics of the waveform, defined by a list of amplitudes and a list of frequencies", 122 | "type": "object", 123 | "properties": { 124 | "amplitudes": { 125 | "description": "List of amplitudes of the harmonics that compose the waveform", 126 | "type": "array", 127 | "items": { 128 | "type": "number" 129 | }, 130 | "uniqueItems": false 131 | }, 132 | "frequencies": { 133 | "description": "List of frequencies of the harmonics that compose the waveform", 134 | "type": "array", 135 | "items": { 136 | "type": "number" 137 | }, 138 | "uniqueItems": true 139 | } 140 | }, 141 | "required": ["amplitudes", "frequencies"] 142 | } 143 | }, 144 | "anyOf": [ 145 | {"required": ["waveform"]}, 146 | {"required": ["processed"]} 147 | ] 148 | }, 149 | "equidistantWaveform":{ 150 | "description": "Data containing the points that define an arbitrary waveform with equidistant points", 151 | "type": "object", 152 | "properties": { 153 | "data": { 154 | "description": "List of values that compose the waveform, at equidistant times form each other", 155 | "type": "array", 156 | "items": { 157 | "type": "number" 158 | }, 159 | "uniqueItems": false 160 | }, 161 | "numberPeriods": { 162 | "description": "The number of periods covered by the data", 163 | "type": "integer", 164 | "minimum": 1, 165 | "default": 1 166 | } 167 | }, 168 | "required": ["data"] 169 | }, 170 | "compressedWaveform":{ 171 | "description": "Data containing the points that define an arbitrary waveform with non-equidistant points paired with their time in the period", 172 | "type": "object", 173 | "properties": { 174 | "data": { 175 | "type": "array", 176 | "items": { 177 | "type": "number" 178 | }, 179 | "uniqueItems": false 180 | }, 181 | "time": { 182 | "type": "array", 183 | "items": { 184 | "type": "number" 185 | }, 186 | "uniqueItems": false 187 | }, 188 | "ancillaryLabel": { 189 | "$ref": "#/$defs/waveformLabel" 190 | } 191 | }, 192 | "required": ["data", "time"] 193 | } 194 | } 195 | } -------------------------------------------------------------------------------- /schemas/inputs/topologies/flyback.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/inputs/topologies/flyback.json", 4 | "title": "flyback", 5 | "description": "The description of a Flyback converter excitation", 6 | "type": "object", 7 | "properties": { 8 | "inputVoltage": { 9 | "description": "The input voltage of the flyback", 10 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 11 | }, 12 | "diodeVoltageDrop": { 13 | "description": "The voltage drop on the diode", 14 | "type": "number" 15 | }, 16 | "maximumDrainSourceVoltage": { 17 | "description": "The maximum drain-source voltage in the selected switch", 18 | "type": "number" 19 | }, 20 | "maximumDutyCycle": { 21 | "description": "The maximum duty cycle in the selected switch", 22 | "type": "number" 23 | }, 24 | "currentRippleRatio": { 25 | "description": "The maximum current ripple allowed in the output", 26 | "type": "number" 27 | }, 28 | "efficiency": { 29 | "description": "The target efficiency", 30 | "type": "number", 31 | "default": 1 32 | }, 33 | "operatingPoints": { 34 | "description": "A list of operating points", 35 | "type": "array", 36 | "items": { 37 | "$ref": "#/$defs/flybackOperatingPoint" 38 | }, 39 | "minItems": 1 40 | } 41 | }, 42 | "required": ["inputVoltage", "diodeVoltageDrop", "currentRippleRatio", "efficiency", "operatingPoints"], 43 | 44 | "$defs": { 45 | "flybackModes": { 46 | "description": "The conduction mode of the Flyback", 47 | "title": "flybackModes", 48 | "type": "string", 49 | "enum": ["Continuous Conduction Mode", "Discontinuous Conduction Mode", "Quasi Resonant Mode", "Boundary Mode Operation"] 50 | }, 51 | "flybackOperatingPoint": { 52 | "description": "The descriptionof one flyback operating point", 53 | "title": "flybackOperatingPoint", 54 | "type": "object", 55 | "properties": { 56 | "outputVoltages": { 57 | "description": "A list of output voltages, one per output", 58 | "type": "array", 59 | "items": { 60 | "type": "number" 61 | }, 62 | "minItems": 1 63 | }, 64 | "outputCurrents": { 65 | "description": "A list of output currents, one per output", 66 | "type": "array", 67 | "items": { 68 | "type": "number" 69 | }, 70 | "minItems": 1 71 | }, 72 | "switchingFrequency": { 73 | "description": "The switching frequency of the operating point", 74 | "type": "number" 75 | }, 76 | "mode": { 77 | "description": "The mode of the operating point", 78 | "$ref": "#/$defs/flybackModes" 79 | }, 80 | "ambientTemperature": { 81 | "description": "The ambient temperature of the operating point", 82 | "type": "number" 83 | } 84 | }, 85 | "required": ["outputVoltages", "outputCurrents", "ambientTemperature"] 86 | } 87 | } 88 | } -------------------------------------------------------------------------------- /schemas/magnetic.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic.json", 4 | "title": "magnetic", 5 | "description": "The description of a magnetic", 6 | "type": "object", 7 | "properties": { 8 | "core":{ 9 | "description": "Data describing the magnetic core.", 10 | "$ref": "/schemas/magnetic/core.json" 11 | }, 12 | "coil":{ 13 | "description": "Data describing the coil", 14 | "$ref": "/schemas/magnetic/coil.json" 15 | }, 16 | "manufacturerInfo": { 17 | "type": "object", 18 | "title": "magneticManufacturerInfo", 19 | "properties": { 20 | "name": { 21 | "description": "The name of the manufacturer of the part", 22 | "type": "string" 23 | }, 24 | "status": { 25 | "description": "The production status of a part according to its manufacturer", 26 | "type": "string", 27 | "enum": ["production", "prototype", "obsolete"] 28 | }, 29 | "reference": { 30 | "description": "The manufacturer's reference of this part", 31 | "type": "string" 32 | }, 33 | "family": { 34 | "description": "The family of a magnetic, as defined by the manufacturer", 35 | "type": "string" 36 | }, 37 | "datasheetUrl": { 38 | "description": "The manufacturer's URL to the datasheet of the product", 39 | "type": "string" 40 | }, 41 | "cost": { 42 | "description": "The manufacturer's price for this part", 43 | "type": "string" 44 | }, 45 | "recommendations": { 46 | "type": "object", 47 | "title": "magneticManufacturerRecommendations", 48 | "properties": { 49 | "ratedCurrent": { 50 | "description": "The manufacturer's rated current for this part", 51 | "type": "number" 52 | }, 53 | "ratedCurrentTemperatureRise": { 54 | "description": "The temperature rise for which the rated current is calculated", 55 | "type": "number" 56 | }, 57 | "ratedMagneticFlux": { 58 | "description": "The manufacturer's rated magnetic flux or volt-seconds for this part", 59 | "type": "number" 60 | }, 61 | "saturationCurrent": { 62 | "description": "The manufacturer's saturation current for this part", 63 | "type": "number" 64 | }, 65 | "saturationCurrentInductanceDrop": { 66 | "description": "Percentage of inductance drop at saturation current", 67 | "type": "number" 68 | }, 69 | } 70 | } 71 | }, 72 | "required": ["name"] 73 | }, 74 | "distributorsInfo": { 75 | "description": "The lists of distributors of the magnetic", 76 | "type": "array", 77 | "items": { 78 | "$ref": "/schemas/utils.json#/$defs/distributorInfo" 79 | }, 80 | "uniqueItems": false 81 | }, 82 | "rotation": { 83 | "description": "The rotation of the magnetic, by default the winding column goes vertical", 84 | "$ref": "/schemas/utils.json#/$defs/rotation" 85 | } 86 | }, 87 | "required": ["core", "coil"] 88 | } -------------------------------------------------------------------------------- /schemas/magnetic/bobbin.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/bobbin.json", 4 | "title": "bobbin", 5 | "description": "The description of a bobbin", 6 | "type": "object", 7 | "properties": { 8 | "name": { 9 | "description": "The name of bobbin", 10 | "type": "string" 11 | }, 12 | "manufacturerInfo": { 13 | "$ref": "/schemas/utils.json#/$defs/manufacturerInfo" 14 | }, 15 | "distributorsInfo": { 16 | "description": "The lists of distributors of the magnetic bobbin", 17 | "type": "array", 18 | "items": { 19 | "$ref": "/schemas/utils.json#/$defs/distributorInfo" 20 | }, 21 | "uniqueItems": false 22 | }, 23 | "functionalDescription":{ 24 | "description": "The data from the bobbin based on its function, in a way that can be used by analytical models.", 25 | "type": "object", 26 | "title": "bobbinFunctionalDescription", 27 | "properties": { 28 | "type": { 29 | "description": "The type of a bobbin", 30 | "type": "string", 31 | "enum": ["standard", "custom"] 32 | }, 33 | "family": { 34 | "description": "The family of a bobbin", 35 | "title": "bobbinFamily", 36 | "type": "string", 37 | "enum": ["u", "e", "etd", "er", "p", "rm", "ep", "pm", "el", "er", "pq", "efd", "ec"] 38 | }, 39 | "shape": { 40 | "description": "The name of a bobbin that this bobbin belongs to", 41 | "type": "string" 42 | }, 43 | "familySubtype": { 44 | "description": "The subtype of the shape, in case there are more than one", 45 | "type": "string" 46 | }, 47 | "dimensions": { 48 | "description": "The dimensions of a bobbin, keys must be as defined in EN 62317", 49 | "type": "object", 50 | "additionalProperties": { 51 | "oneOf": [ 52 | {"$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance"}, 53 | { 54 | "type": "number" 55 | } 56 | ] 57 | } 58 | }, 59 | "pinout": { 60 | "$ref": "#/$defs/pinout" 61 | }, 62 | "connections": { 63 | "description": "List of connections between windings and pins", 64 | "type": "array", 65 | "items": { 66 | "title": "pinWIndingConnection", 67 | "type": "object", 68 | "properties": { 69 | "pin": { 70 | "description": "The name of the connected pin", 71 | "type": "string" 72 | }, 73 | "winding": { 74 | "description": "The name of the connected winding", 75 | "type": "string" 76 | } 77 | } 78 | }, 79 | "minItems": 0, 80 | "uniqueItems": true 81 | } 82 | }, 83 | "required": ["type", "family", "shape", "dimensions"] 84 | }, 85 | "processedDescription":{ 86 | "type": "object", 87 | "title": "coreBobbinProcessedDescription", 88 | "properties": { 89 | "wallThickness": { 90 | "description": "The thicknes of the walls that hold the wire on both sides of the column", 91 | "type": "number", 92 | "minimum": 0 93 | }, 94 | "columnThickness": { 95 | "description": "The thicknes of the central column wall, where the wire is wound, in the X axis", 96 | "type": "number", 97 | "minimum": 0 98 | }, 99 | "columnDepth": { 100 | "description": "The depth of the central column wall, including thickness, in the z axis", 101 | "type": "number", 102 | "minimum": 0 103 | }, 104 | "columnWidth": { 105 | "description": "The width of the central column wall, including thickness, in the x axis", 106 | "type": "number", 107 | "minimum": 0 108 | }, 109 | "columnShape": { 110 | "$ref": "/schemas/utils.json#/$defs/columnShape" 111 | }, 112 | "windingWindows": { 113 | "description": "List of winding windows, all elements in the list must be of the same type", 114 | "title": "windingWindows", 115 | "oneOf": [ 116 | { 117 | "description": "List of rectangular winding windows", 118 | "type": "array", 119 | "items": {"$ref": "/schemas/magnetic/core.json#/$defs/rectangularWindingWindow"}, 120 | "minItems": 1, 121 | "uniqueItems": false 122 | }, 123 | { 124 | "description": "List of radial winding windows", 125 | "type": "array", 126 | "items": {"$ref": "/schemas/magnetic/core.json#/$defs/radialWindingWindow"}, 127 | "minItems": 1, 128 | "uniqueItems": false 129 | } 130 | ] 131 | }, 132 | "pins": { 133 | "description": "List of pins, geometrically defining how and where it is", 134 | "type": "array", 135 | "items": { 136 | "$ref": "#/$defs/pin" 137 | }, 138 | "minItems": 0, 139 | "uniqueItems": true 140 | }, 141 | "coordinates": { 142 | "description": "The coordinates of the center of the bobbin central wall, whre the wires are wound, referred to the center of the main column.", 143 | "$ref": "/schemas/utils.json#/$defs/coordinates" 144 | } 145 | }, 146 | "required": ["columnShape", "wallThickness", "columnThickness", "columnDepth", "windingWindows"] 147 | } 148 | }, 149 | "anyOf": [ 150 | {"required": ["functionalDescription"]}, 151 | {"required": ["processedDescription"]} 152 | ], 153 | "$defs": { 154 | "pin":{ 155 | "description": "Data describing one pin in a bobbin", 156 | "title": "pin", 157 | "type": "object", 158 | "properties": { 159 | "name": { 160 | "description": "Name given to the pin", 161 | "type": "string" 162 | }, 163 | "shape": { 164 | "description": "The shape of the pin", 165 | "title": "pinShape", 166 | "type": "string", 167 | "enum": ["round", "rectangular", "irregular"] 168 | }, 169 | "type": { 170 | "description": "Type of pin", 171 | "type": "string", 172 | "enum": ["smd", "tht"] 173 | }, 174 | "rotation": { 175 | "description": "The rotation of the pin, default is vertical", 176 | "$ref": "/schemas/utils.json#/$defs/rotation" 177 | }, 178 | "dimensions": { 179 | "description": "Dimensions of the rectangle defining the pin", 180 | "$ref": "/schemas/utils.json#/$defs/dimensions" 181 | }, 182 | "coordinates": { 183 | "description": "The coordinates of the center of the pin, referred to the center of the main column", 184 | "$ref": "/schemas/utils.json#/$defs/coordinates" 185 | } 186 | }, 187 | "required": ["shape", "type", "dimensions"] 188 | }, 189 | "pinout":{ 190 | "description": "Data describing the pinout of a bobbin", 191 | "title": "pinout", 192 | "type": "object", 193 | "properties": { 194 | "pitch": { 195 | "description": "The distance between pins, per row, by pin order", 196 | "type": "array", 197 | "items": { 198 | "type": "number" 199 | } 200 | }, 201 | "centralPitch": { 202 | "description": "The distance between central pins", 203 | "type": "number" 204 | }, 205 | "rowDistance": { 206 | "description": "The distance between a row of pins and the center of the bobbin", 207 | "type": "number" 208 | }, 209 | "numberRows": { 210 | "description": "The number of rows of a bobbin, typically 2", 211 | "type": "integer", 212 | "default": 2 213 | }, 214 | "numberPins": { 215 | "description": "The number of pins", 216 | "type": "integer" 217 | }, 218 | "numberPinsPerRow": { 219 | "description": "List of pins per row", 220 | "type": "array", 221 | "items": { 222 | "type": "integer" 223 | } 224 | }, 225 | "pinDescription": { 226 | "$ref": "#/$defs/pin" 227 | } 228 | }, 229 | "required": ["pitch", "rowDistance", "numberPins", "pinDescription"] 230 | } 231 | } 232 | } -------------------------------------------------------------------------------- /schemas/magnetic/coil.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/coil.json", 4 | "title": "coil", 5 | "description": "The description of a magnetic coil", 6 | "type": "object", 7 | "properties": { 8 | "bobbin": { 9 | "title": "BobbinDataOrNameUnion", 10 | "oneOf": [ 11 | {"$ref": "/schemas/magnetic/bobbin.json"}, 12 | { 13 | "description": "The name of the bobbin used in the core", 14 | "type": "string" 15 | } 16 | ] 17 | }, 18 | "functionalDescription":{ 19 | "description": "The data from the coil based on its function, in a way that can be used by analytical models of only Magnetism.", 20 | "title": "coilFunctionalDescription", 21 | "type": "array", 22 | "items": { 23 | "$ref": "#/$defs/winding" 24 | }, 25 | "minItems": 1 26 | }, 27 | "sectionsDescription":{ 28 | "description": "The data from the coil at the section level, in a way that can be used by more advanced analytical and finite element models", 29 | "type": "array", 30 | "items": { 31 | "$ref": "#/$defs/section" 32 | }, 33 | "minItems": 1 34 | }, 35 | "layersDescription":{ 36 | "description": "The data from the coil at the layer level, in a way that can be used by more advanced analytical and finite element models", 37 | "type": "array", 38 | "items": { 39 | "$ref": "#/$defs/layer" 40 | }, 41 | "minItems": 1 42 | }, 43 | "turnsDescription":{ 44 | "description": "The data from the coil at the turn level, in a way that can be used by the most advanced analytical and finite element models", 45 | "type": "array", 46 | "items": { 47 | "$ref": "#/$defs/turn" 48 | }, 49 | "minItems": 1 50 | } 51 | }, 52 | "anyOf": [ 53 | {"required": ["bobbin", "functionalDescription"]}, 54 | {"required": ["bobbin", "functionalDescription", "sectionsDescription"]}, 55 | {"required": ["bobbin", "functionalDescription", "layersDescription"]}, 56 | {"required": ["bobbin", "functionalDescription", "turnsDescription"]} 57 | ], 58 | 59 | "$defs": { 60 | "turn":{ 61 | "description": "Data describing one turn in a magnetic", 62 | "title": "turn", 63 | "type": "object", 64 | "properties": { 65 | "name": { 66 | "description": "Name given to the turn", 67 | "type": "string" 68 | }, 69 | "winding": { 70 | "description": "The name of the winding that this turn belongs to", 71 | "type": "string" 72 | }, 73 | "parallel": { 74 | "description": "The index of the parallel that this turn belongs to", 75 | "type": "integer" 76 | }, 77 | "layer": { 78 | "description": "The name of the layer that this turn belongs to", 79 | "type": "string" 80 | }, 81 | "section": { 82 | "description": "The name of the section that this turn belongs to", 83 | "type": "string" 84 | }, 85 | "orientation": { 86 | "description": "Way in which the turn is wound", 87 | "title": "turnOrientation", 88 | "type": "string", 89 | "enum": ["clockwise", "counterClockwise"] 90 | }, 91 | "length": { 92 | "description": "The length of the turn, referred from the center of its cross section, in m", 93 | "type": "number" 94 | }, 95 | "angle": { 96 | "description": "The angle that the turn does, useful for partial turns, in degrees", 97 | "type": "number", 98 | "default": 360 99 | }, 100 | "dimensions": { 101 | "description": "Dimensions of the rectangle defining the turn", 102 | "$ref": "/schemas/utils.json#/$defs/dimensions" 103 | }, 104 | "rotation": { 105 | "description": "Rotation of the rectangle defining the turn, in degrees", 106 | "type": "number", 107 | "default": 0 108 | }, 109 | "coordinates": { 110 | "description": "The coordinates of the center of the turn, referred to the center of the main column", 111 | "$ref": "/schemas/utils.json#/$defs/coordinates" 112 | }, 113 | "additionalCoordinates": { 114 | "description": "List of additional coordinates of the center of the turn, referred to the center of the main column, in case the turn is not symmetrical, as in toroids", 115 | "type": "array", 116 | "items":{ 117 | "$ref": "/schemas/utils.json#/$defs/coordinates" 118 | } 119 | }, 120 | "coordinateSystem": { 121 | "description": "System in which dimension and coordinates are in", 122 | "title": "coordinateSystem", 123 | "type": "string", 124 | "enum": ["cartesian", "polar"] 125 | } 126 | }, 127 | "required": ["name", "winding", "parallel", "length", "coordinates"] 128 | }, 129 | "layer":{ 130 | "description": "Data describing one layer in a magnetic", 131 | "title": "layer", 132 | "type": "object", 133 | "properties": { 134 | "name": { 135 | "description": "Name given to the layer", 136 | "type": "string" 137 | }, 138 | "type": { 139 | "description": "Type of the layer", 140 | "title": "electricalType", 141 | "type": "string", 142 | "enum": ["conduction", "insulation", "shielding"] 143 | }, 144 | "section": { 145 | "description": "The name of the section that this layer belongs to", 146 | "type": "string" 147 | }, 148 | "orientation": { 149 | "description": "Way in which the layer is oriented inside the section", 150 | "title": "windingOrientation", 151 | "type": "string", 152 | "enum": ["contiguous", "overlapping"] 153 | }, 154 | "turnsAlignment": { 155 | "description": "Way in which the turns are aligned inside the layer", 156 | "title": "coilAlignment", 157 | "type": "string", 158 | "enum": ["inner or top", "outer or bottom", "spread", "centered"], 159 | "default": "centered" 160 | }, 161 | "partialWindings": { 162 | "description": "List of partial windings in this layer", 163 | "type": "array", 164 | "items":{ 165 | "$ref": "#/$defs/partialWinding" 166 | } 167 | }, 168 | "insulationMaterial": { 169 | "description": "In case of insulating layer, the material used", 170 | "oneOf": [ 171 | {"$ref": "/schemas/magnetic/insulation/material.json"}, 172 | { 173 | "description": "The insulating material", 174 | "type": "string" 175 | } 176 | ] 177 | }, 178 | "dimensions": { 179 | "description": "Dimensions of the rectangle defining the layer", 180 | "$ref": "/schemas/utils.json#/$defs/dimensions" 181 | }, 182 | "coordinates": { 183 | "description": "The coordinates of the center of the layer, referred to the center of the main column", 184 | "$ref": "/schemas/utils.json#/$defs/coordinates" 185 | }, 186 | "additionalCoordinates": { 187 | "description": "List of additional coordinates of the center of the layer, referred to the center of the main column, in case the layer is not symmetrical, as in toroids", 188 | "type": "array", 189 | "items":{ 190 | "$ref": "/schemas/utils.json#/$defs/coordinates" 191 | } 192 | }, 193 | "coordinateSystem": { 194 | "description": "System in which dimension and coordinates are in", 195 | "title": "coordinateSystem", 196 | "type": "string", 197 | "enum": ["cartesian", "polar"] 198 | }, 199 | "fillingFactor": { 200 | "description": "How much space in this layer is used by wires compared to the total", 201 | "type": "number", 202 | "minimum": 0 203 | }, 204 | "windingStyle": { 205 | "description": "Defines if the layer is wound by consecutive turns or parallels", 206 | "type": "string", 207 | "enum": ["windByConsecutiveTurns", "windByConsecutiveParallels"] 208 | } 209 | }, 210 | "required": ["name", "type", "orientation", "partialWindings", "dimensions", "coordinates"] 211 | }, 212 | "section":{ 213 | "description": "Data describing one section in a magnetic", 214 | "title": "section", 215 | "type": "object", 216 | "properties": { 217 | "name": { 218 | "description": "Name given to the winding", 219 | "type": "string" 220 | }, 221 | "type": { 222 | "description": "Type of the layer", 223 | "title": "electricalType", 224 | "type": "string", 225 | "enum": ["conduction", "insulation", "shielding"] 226 | }, 227 | "layersOrientation": { 228 | "description": "Way in which the layers are oriented inside the section", 229 | "title": "windingOrientation", 230 | "type": "string", 231 | "enum": ["contiguous", "overlapping"] 232 | }, 233 | "partialWindings": { 234 | "description": "List of partial windings in this section", 235 | "type": "array", 236 | "items":{ 237 | "$ref": "#/$defs/partialWinding" 238 | } 239 | }, 240 | "layersAlignment": { 241 | "description": "Way in which the layers are aligned inside the section", 242 | "title": "coilAlignment", 243 | "type": "string", 244 | "enum": ["inner or top", "outer or bottom", "spread", "centered"], 245 | "default": "centered" 246 | }, 247 | "dimensions": { 248 | "description": "Dimensions of the rectangle defining the section", 249 | "$ref": "/schemas/utils.json#/$defs/dimensions" 250 | }, 251 | "coordinates": { 252 | "description": "The coordinates of the center of the section, referred to the center of the main column", 253 | "$ref": "/schemas/utils.json#/$defs/coordinates" 254 | }, 255 | "coordinateSystem": { 256 | "description": "System in which dimension and coordinates are in", 257 | "title": "coordinateSystem", 258 | "type": "string", 259 | "enum": ["cartesian", "polar"] 260 | }, 261 | "fillingFactor": { 262 | "description": "How much space in this section is used by wires compared to the total", 263 | "type": "number", 264 | "minimum": 0 265 | }, 266 | "windingStyle": { 267 | "description": "Defines if the section is wound by consecutive turns or parallels", 268 | "type": "string", 269 | "enum": ["windByConsecutiveTurns", "windByConsecutiveParallels"] 270 | }, 271 | "margin": { 272 | "description": "Defines the distance in extremes of the section that is reserved to be filled with margin tape. It is an array os two elements from inner or top, to outer or bottom", 273 | "type": "array", 274 | "items":{ 275 | "type": "number" 276 | }, 277 | "minItems": 2, 278 | "maxItems": 2 279 | } 280 | }, 281 | "required": ["name", "type", "layersOrientation", "partialWindings", "dimensions", "coordinates"] 282 | }, 283 | "partialWinding":{ 284 | "description": "Data describing one part of winding, described by a list with the proportion of each parallel in the winding that is contained here", 285 | "title": "partialWinding", 286 | "type": "object", 287 | "properties": { 288 | "winding": { 289 | "description": "The name of the winding that this part belongs to", 290 | "type": "string" 291 | }, 292 | "parallelsProportion": { 293 | "description": "Number of parallels in winding", 294 | "type": "array", 295 | "items": { 296 | "description": "Proportion of turns that are contained in this part for the parallel in this index", 297 | "type": "number", 298 | "minimum": 0, 299 | "maximum": 1 300 | }, 301 | "uniqueItems": false 302 | }, 303 | "connections": { 304 | "description": "Array on two elements, representing the input and output connection for this partial winding", 305 | "type": "array", 306 | "items": { 307 | "$ref": "#/$defs/connection" 308 | }, 309 | "minItems": 2, 310 | "maxItems": 2, 311 | "uniqueItems": true 312 | } 313 | }, 314 | "required": ["winding", "parallelsProportion"] 315 | }, 316 | "winding":{ 317 | "description": "Data describing one winding associated with a magnetic", 318 | "type": "object", 319 | "properties": { 320 | "name": { 321 | "description": "Name given to the winding", 322 | "type": "string" 323 | }, 324 | "numberTurns": { 325 | "description": "Number of turns in winding", 326 | "type": "integer", 327 | "exclusiveMinimum": 0 328 | }, 329 | "numberParallels": { 330 | "description": "Number of parallels in winding", 331 | "type": "integer", 332 | "exclusiveMinimum": 0 333 | }, 334 | "isolationSide": { 335 | "$ref": "/schemas/utils.json#/$defs/isolationSide" 336 | }, 337 | "wire": { 338 | "title": "WireDataOrNameUnion", 339 | "oneOf": [ 340 | {"$ref": "/schemas/magnetic/wire.json"}, 341 | { 342 | "description": "The name of the wire", 343 | "type": "string" 344 | } 345 | ] 346 | }, 347 | "connections": { 348 | "description": "Array on elements, representing the all the pins this winding is connected to", 349 | "type": "array", 350 | "items": { 351 | "$ref": "#/$defs/connection" 352 | }, 353 | "minItems": 2, 354 | "uniqueItems": true 355 | } 356 | }, 357 | "required": ["name", "numberTurns", "numberParallels", "isolationSide", "wire"] 358 | }, 359 | "connection": { 360 | "description": "Data describing the connection of the a wire", 361 | "type": "object", 362 | "properties": { 363 | "type": { 364 | "$ref": "/schemas/utils.json#/$defs/connectionType" 365 | }, 366 | "metric": { 367 | "description": "Metric of the terminal, if applicable", 368 | "type": "integer" 369 | }, 370 | "pinName": { 371 | "description": "Name of the pin where it is connected, if applicable", 372 | "type": "string" 373 | }, 374 | "length": { 375 | "description": "Length of the connection, counted from the exit of the last turn until the terminal, in m", 376 | "type": "number" 377 | } 378 | } 379 | } 380 | } 381 | } -------------------------------------------------------------------------------- /schemas/magnetic/core.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/core.json", 4 | "title": "magneticCore", 5 | "description": "The description of a magnetic core", 6 | "type": "object", 7 | "properties": { 8 | "name": { 9 | "description": "The name of core", 10 | "type": "string" 11 | }, 12 | "manufacturerInfo": { 13 | "$ref": "/schemas/utils.json#/$defs/manufacturerInfo" 14 | }, 15 | "distributorsInfo": { 16 | "description": "The lists of distributors of the magnetic core", 17 | "type": "array", 18 | "items": { 19 | "$ref": "/schemas/utils.json#/$defs/distributorInfo" 20 | }, 21 | "uniqueItems": false 22 | }, 23 | "functionalDescription":{ 24 | "description": "The data from the core based on its function, in a way that can be used by analytical models.", 25 | "type": "object", 26 | "title": "coreFunctionalDescription", 27 | "properties": { 28 | "type": { 29 | "description": "The type of core", 30 | "title": "coreType", 31 | "type": "string", 32 | "enum": ["two-piece set", "piece and plate", "toroidal", "closed shape"] 33 | }, 34 | "material": { 35 | "title": "CoreMaterialDataOrNameUnion", 36 | "oneOf": [ 37 | {"$ref": "/schemas/magnetic/core/material.json"}, 38 | { 39 | "description": "The name of the material used in the core", 40 | "type": "string" 41 | } 42 | ] 43 | }, 44 | "shape": { 45 | "title": "CoreShapeDataOrNameUnion", 46 | "oneOf": [ 47 | {"$ref": "/schemas/magnetic/core/shape.json"}, 48 | { 49 | "description": "The name of the shape used in the core", 50 | "type": "string" 51 | } 52 | ] 53 | }, 54 | "gapping": { 55 | "description": "The lists of gaps in the magnetic core", 56 | "type": "array", 57 | "items": { 58 | "$ref": "/schemas/magnetic/core/gap.json" 59 | }, 60 | "uniqueItems": false 61 | }, 62 | "numberStacks": { 63 | "description": "The number of stacked cores", 64 | "type": "integer", 65 | "minimum": 1 66 | }, 67 | "coating": { 68 | "description": "The coating of the core", 69 | "type": "string", 70 | "enum": ["epoxy", "parylene"] 71 | } 72 | }, 73 | "required": ["type", "material", "shape", "gapping"] 74 | }, 75 | "processedDescription":{ 76 | "description": "The data from the core after been processed, and ready to use by the analytical models", 77 | "type": "object", 78 | "title": "coreProcessedDescription", 79 | "properties": { 80 | "effectiveParameters": { 81 | "$ref": "#/$defs/effectiveParameters" 82 | }, 83 | "width": { 84 | "description": "Total width of the core", 85 | "type": "number", 86 | "exclusiveMinimum": 0 87 | }, 88 | "height": { 89 | "description": "Total height of the core", 90 | "type": "number", 91 | "exclusiveMinimum": 0 92 | }, 93 | "depth": { 94 | "description": "Total depth of the core", 95 | "type": "number", 96 | "exclusiveMinimum": 0 97 | }, 98 | "thermalResistance": { 99 | "description": "Parameter describing steady state temperature rise versus dissipated power within a given device.", 100 | "type": "number", 101 | "exclusiveMinimum": 0 102 | }, 103 | "windingWindows": { 104 | "description": "List of winding windows, all elements in the list must be of the same type", 105 | "title": "windingWindows", 106 | "oneOf": [ 107 | { 108 | "description": "List of rectangular winding windows", 109 | "type": "array", 110 | "items": {"$ref": "#/$defs/rectangularWindingWindow"}, 111 | "minItems": 1, 112 | "uniqueItems": false 113 | }, 114 | { 115 | "description": "List of radial winding windows", 116 | "type": "array", 117 | "items": {"$ref": "#/$defs/radialWindingWindow"}, 118 | "minItems": 1, 119 | "uniqueItems": false 120 | } 121 | ] 122 | }, 123 | "columns": { 124 | "description": "List of columns in the core", 125 | "type": "array", 126 | "items": {"$ref": "#/$defs/columnData"}, 127 | "minItems": 1, 128 | "uniqueItems": false 129 | } 130 | }, 131 | "required": ["effectiveParameters", "width", "height", "depth", "windingWindows", "columns"] 132 | }, 133 | "geometricalDescription":{ 134 | "description": "List with data from the core based on its geometrical description, in a way that can be used by CAD models.", 135 | "title": "coreGeometricalDescription", 136 | "type": "array", 137 | "items": { 138 | "$ref": "#/$defs/coreGeometricalDescriptionElement" 139 | }, 140 | "uniqueItems": true 141 | } 142 | }, 143 | "required": ["functionalDescription"], 144 | 145 | "$defs": { 146 | "coreGeometricalDescriptionElement":{ 147 | "description": "The data from the core based on its geometrical description, in a way that can be used by CAD models.", 148 | "title": "coreGeometricalDescriptionElement", 149 | "oneOf": [ 150 | {"$ref": "/schemas/magnetic/core/piece.json"}, 151 | {"$ref": "/schemas/magnetic/core/spacer.json"} 152 | ] 153 | }, 154 | "effectiveParameters":{ 155 | "description": "Effective data of the magnetic core", 156 | "type": "object", 157 | "properties": { 158 | "effectiveLength": { 159 | "description": "This is the equivalent length that the magnetic flux travels through the core.", 160 | "type": "number", 161 | "exclusiveMinimum": 0 162 | }, 163 | "effectiveArea": { 164 | "description": "This is the equivalent section that the magnetic flux traverses, because the shape of the core is not uniform and its section changes along the path", 165 | "type": "number", 166 | "exclusiveMinimum": 0 167 | }, 168 | "minimumArea": { 169 | "description": "This is the minimum area seen by the magnetic flux along its path", 170 | "type": "number", 171 | "exclusiveMinimum": 0 172 | }, 173 | "effectiveVolume": { 174 | "description": "This is the product of the effective length by the effective area, and represents the equivalent volume that is magnetized by the field", 175 | "type": "number", 176 | "exclusiveMinimum": 0 177 | } 178 | }, 179 | "required": ["effectiveLength", "effectiveArea", "minimumArea", "effectiveVolume"] 180 | }, 181 | "rectangularWindingWindow":{ 182 | "description": "It is the area between the winding column and the closest lateral column, and it represents the area where all the wires of the magnetic will have to fit, and equivalently, where all the current must circulate once, in the case of inductors, or twice, in the case of transformers", 183 | "type": "object", 184 | "properties": { 185 | "shape": { 186 | "description": "Shape of the winding window", 187 | "title": "windingWindowShape", 188 | "type": "string", 189 | "const": "rectangular" 190 | }, 191 | "width": { 192 | "description": "Horizontal width of the winding window", 193 | "type": "number", 194 | "exclusiveMinimum": 0 195 | }, 196 | "height": { 197 | "description": "Vertical height of the winding window", 198 | "type": "number", 199 | "exclusiveMinimum": 0 200 | }, 201 | "area": { 202 | "description": "Area of the winding window", 203 | "type": "number", 204 | "exclusiveMinimum": 0 205 | }, 206 | "coordinates": { 207 | "description": "The coordinates of the center of the winding window, referred to the center of the main column. In the case of half-sets, the center will be in the top point, where it would join another half-set", 208 | "$ref": "/schemas/utils.json#/$defs/coordinates" 209 | }, 210 | "sectionsOrientation": { 211 | "description": "Way in which the sections are oriented inside the winding window", 212 | "title": "windingOrientation", 213 | "type": "string", 214 | "enum": ["contiguous", "overlapping"] 215 | }, 216 | "sectionsAlignment": { 217 | "description": "Way in which the sections are aligned inside the winding window", 218 | "title": "coilAlignment", 219 | "type": "string", 220 | "enum": ["inner or top", "outer or bottom", "spread", "centered"] 221 | } 222 | }, 223 | "required": ["width", "height"] 224 | }, 225 | "radialWindingWindow":{ 226 | "description": "It is the area between the delimited between a height from the surface of the toroidal core at a given angle, and it represents the area where all the wires of the magnetic will have to fit, and equivalently, where all the current must circulate once, in the case of inductors, or twice, in the case of transformers", 227 | "type": "object", 228 | "properties": { 229 | "shape": { 230 | "description": "Shape of the winding window", 231 | "title": "windingWindowShape", 232 | "type": "string", 233 | "const": "round" 234 | }, 235 | "angle": { 236 | "description": "Total angle of the window", 237 | "type": "number", 238 | "exclusiveMinimum": 0 239 | }, 240 | "radialHeight": { 241 | "description": "Radial height of the winding window", 242 | "type": "number", 243 | "exclusiveMinimum": 0 244 | }, 245 | "area": { 246 | "description": "Area of the winding window", 247 | "type": "number", 248 | "exclusiveMinimum": 0 249 | }, 250 | "coordinates": { 251 | "description": "The coordinates of the point of the winding window where the middle height touches the main column, referred to the center of the main column. In the case of half-sets, the center will be in the top point, where it would join another half-set", 252 | "$ref": "/schemas/utils.json#/$defs/coordinates" 253 | }, 254 | "sectionsOrientation": { 255 | "description": "Way in which the sections are oriented inside the winding window", 256 | "title": "windingOrientation", 257 | "type": "string", 258 | "enum": ["contiguous", "overlapping"] 259 | } 260 | }, 261 | "required": ["angle", "radialHeight"] 262 | }, 263 | "columnData":{ 264 | "description": "Data describing a column of the core", 265 | "type": "object", 266 | "properties": { 267 | "type": { 268 | "description": "Name of the column", 269 | "type": "string", 270 | "enum": ["central", "lateral"] 271 | }, 272 | "shape": { 273 | "title": "ColumnShape", 274 | "$ref": "/schemas/utils.json#/$defs/columnShape" 275 | }, 276 | "area": { 277 | "description": "Area of the section column, normal to the magnetic flux direction", 278 | "type": "number", 279 | "exclusiveMinimum": 0 280 | }, 281 | "width": { 282 | "description": "Width of the column", 283 | "type": "number", 284 | "exclusiveMinimum": 0 285 | }, 286 | "depth": { 287 | "description": "Depth of the column", 288 | "type": "number", 289 | "exclusiveMinimum": 0 290 | }, 291 | "minimumWidth": { 292 | "description": "Minimum width of the column, if irregular", 293 | "type": "number", 294 | "exclusiveMinimum": 0 295 | }, 296 | "minimumDepth": { 297 | "description": "Minimum depth of the column, if irregular", 298 | "type": "number", 299 | "exclusiveMinimum": 0 300 | }, 301 | "height": { 302 | "description": "Height of the column", 303 | "type": "number", 304 | "exclusiveMinimum": 0 305 | }, 306 | "coordinates": { 307 | "description": "The coordinates of the center of the column, referred to the center of the main column. In the case of half-sets, the center will be in the top point, where it would join another half-set", 308 | "$ref": "/schemas/utils.json#/$defs/coordinates" 309 | } 310 | }, 311 | "required": ["type", "shape", "width", "depth", "height", "area", "coordinates"] 312 | } 313 | } 314 | } -------------------------------------------------------------------------------- /schemas/magnetic/core/gap.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/core/gap.json", 4 | "title": "core/gap", 5 | "description": "A gap for the magnetic cores", 6 | "type": "object", 7 | "properties": { 8 | "type": { 9 | "description": "The type of a gap", 10 | "title": "GapType", 11 | "type": "string", 12 | "enum": ["additive", "subtractive", "residual"], 13 | "default": "subtractive" 14 | }, 15 | "length": { 16 | "description": "The length of the gap", 17 | "type": "number", 18 | "exclusiveMinimum": 0 19 | }, 20 | "coordinates": { 21 | "description": "The coordinates of the center of the gap, referred to the center of the main column", 22 | "type": "array", 23 | "items": { 24 | "type": "number" 25 | }, 26 | "minItems": 3, 27 | "maxItems": 3 28 | }, 29 | "shape": { 30 | "$ref": "/schemas/utils.json#/$defs/columnShape" 31 | }, 32 | "distanceClosestNormalSurface": { 33 | "description": "The distance where the closest perpendicular surface is. This usually is half the winding height", 34 | "type": "number", 35 | "minimum": 0 36 | }, 37 | "distanceClosestParallelSurface": { 38 | "description": "The distance where the closest parallel surface is. This usually is the opposite side of the winnding window", 39 | "type": "number", 40 | "minimum": 0 41 | }, 42 | "area": { 43 | "description": "Geometrical area of the gap", 44 | "type": "number", 45 | "exclusiveMinimum": 0 46 | }, 47 | "sectionDimensions": { 48 | "description": "Dimension of the section normal to the magnetic flux", 49 | "type": "array", 50 | "items": { 51 | "type": "number" 52 | }, 53 | "minItems": 2, 54 | "maxItems": 2 55 | } 56 | }, 57 | "required": ["length", "type"] 58 | } -------------------------------------------------------------------------------- /schemas/magnetic/core/piece.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/core/piece.json", 4 | "title": "core/piece", 5 | "description": "Data describing the a piece of a core", 6 | "type": "object", 7 | "properties": { 8 | "type": { 9 | "description": "The type of piece", 10 | "type": "string", 11 | "enum": ["half set", "toroidal", "plate", "sheet", "closed"] 12 | }, 13 | "material": { 14 | "title": "CoreMaterialDataOrNameUnion", 15 | "oneOf": [ 16 | {"$ref": "/schemas/magnetic/core/material.json"}, 17 | { 18 | "description": "The name of the material used in the piece", 19 | "type": "string" 20 | } 21 | ] 22 | }, 23 | "shape": { 24 | "title": "CoreShapeDataOrNameUnion", 25 | "oneOf": [ 26 | {"$ref": "/schemas/magnetic/core/shape.json"}, 27 | { 28 | "description": "The name of the shape used in the piece", 29 | "type": "string" 30 | } 31 | ] 32 | }, 33 | "coordinates": { 34 | "description": "The coordinates of the top of the piece, referred to the center of the main column", 35 | "$ref": "/schemas/utils.json#/$defs/coordinates" 36 | }, 37 | "rotation": { 38 | "description": "The rotation of the top of the piece from its original state, referred to the center of the main column", 39 | "$ref": "/schemas/utils.json#/$defs/rotation" 40 | }, 41 | "machining": { 42 | "type": "array", 43 | "items": { 44 | "$ref": "#/$defs/machining" 45 | }, 46 | "uniqueItems": true 47 | } 48 | }, 49 | "required": ["type", "material", "shape", "coordinates", "rotation"], 50 | 51 | "$defs": { 52 | "machining":{ 53 | "description": "Data describing the machining applied to a piece", 54 | "title": "machining", 55 | "type": "object", 56 | "properties": { 57 | "length": { 58 | "description": "Length of the machining", 59 | "type": "number", 60 | "exclusiveMinimum": 0 61 | }, 62 | "coordinates": { 63 | "description": "The coordinates of the start of the machining, referred to the top of the main column of the piece", 64 | "$ref": "/schemas/utils.json#/$defs/coordinates" 65 | } 66 | }, 67 | "required": ["length", "coordinates"] 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /schemas/magnetic/core/shape.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/core/shape.json", 4 | "title": "core/shape", 5 | "description": "A shape for the magnetic cores", 6 | "type": "object", 7 | "properties": { 8 | "type": { 9 | "description": "The type of a magnetic shape", 10 | "type": "string", 11 | "enum": ["standard", "custom"] 12 | }, 13 | "family": { 14 | "description": "The family of a magnetic shape", 15 | "title": "CoreShapeFamily", 16 | "type": "string", 17 | "enum": ["u", "ur", "e", "etd", "p", "rm", "ep", "epx", "lp", "pm", "el", "er", "pq", "efd", "elp", "planar e", "planar er", "planar el", "ec", "eq", "ui", "pqi", "ut", "t", "drum", "rod", "ei", "h", "c"] 18 | }, 19 | "magneticCircuit": { 20 | "description": "Describes if the magnetic circuit of the shape is open, and can be combined with others; or closed, and has to be used by itself", 21 | "type": "string", 22 | "enum": ["open", "closed"] 23 | }, 24 | "name": { 25 | "description": "The name of a magnetic shape", 26 | "type": "string" 27 | }, 28 | "aliases": { 29 | "description": "Alternative names of a magnetic shape", 30 | "type": "array", 31 | "items": { 32 | "type": "string" 33 | } 34 | }, 35 | "familySubtype": { 36 | "description": "The subtype of the shape, in case there are more than one", 37 | "type": "string" 38 | }, 39 | "dimensions": { 40 | "description": "The dimensions of a magnetic shape, keys must be as defined in EN 62317", 41 | "type": "object", 42 | "additionalProperties": { 43 | "oneOf": [ 44 | {"$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance"}, 45 | { 46 | "type": "number" 47 | } 48 | ] 49 | } 50 | } 51 | }, 52 | "required": ["type", "family"] 53 | } -------------------------------------------------------------------------------- /schemas/magnetic/core/spacer.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/core/spacer.json", 4 | "title": "core/spacer", 5 | "description": "Data describing the spacer used to separate cores in additive gaps", 6 | "type": "object", 7 | "properties": { 8 | "type": { 9 | "description": "The type of spacer", 10 | "type": "string", 11 | "enum": ["spacer"] 12 | }, 13 | "insulationMaterial": { 14 | "description": "Material of the spacer", 15 | "title": "InsulationMaterialDataOrNameUnion", 16 | "oneOf": [ 17 | {"$ref": "/schemas/magnetic/insulation/material.json"}, 18 | { 19 | "description": "The name of the material used in the insulation", 20 | "type": "string" 21 | } 22 | ] 23 | }, 24 | "dimensions": { 25 | "description": "Dimensions of the cube defining the spacer", 26 | "$ref": "/schemas/utils.json#/$defs/dimensions" 27 | }, 28 | "coordinates": { 29 | "description": "The coordinates of the center of the gap, referred to the center of the main column", 30 | "$ref": "/schemas/utils.json#/$defs/coordinates" 31 | } 32 | }, 33 | "required": ["type", "insulationMaterial", "dimensions", "coordinates"] 34 | } -------------------------------------------------------------------------------- /schemas/magnetic/insulation/material.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/insulation/material.json", 4 | "title": "insulation/material", 5 | "description": "A material for insulation", 6 | "type": "object", 7 | "properties": { 8 | "composition": { 9 | "description": "The composition of a insulation material", 10 | "type": "string" 11 | }, 12 | "name": { 13 | "description": "The name of a insulation material", 14 | "type": "string" 15 | }, 16 | "aliases": { 17 | "description": "Alternative names of the material", 18 | "type": "array", 19 | "items": { 20 | "type": "string" 21 | } 22 | }, 23 | "manufacturer": { 24 | "description": "The manufacturer of the insulation material", 25 | "type": "string" 26 | }, 27 | "dielectricStrength":{ 28 | "type": "array", 29 | "items": { 30 | "$ref": "#/$defs/dieletricStrengthPoint" 31 | }, 32 | "minItems": 1 33 | }, 34 | "relativePermittivity": { 35 | "description": "The dielectric constant of the insulation material", 36 | "type": "number", 37 | "exclusiveMinimum": 0 38 | }, 39 | "thermalConductivity": { 40 | "description": "The thermal conductivity of the insulation material, in W / (m * K)", 41 | "type": "number", 42 | "exclusiveMinimum": 0 43 | }, 44 | "specificHeat": { 45 | "description": "The specific heat of the insulation material, in J / (Kg * K)", 46 | "type": "number", 47 | "exclusiveMinimum": 0 48 | }, 49 | "temperatureClass": { 50 | "description": "The temperature class of the insulation material, in Celsius", 51 | "type": "number", 52 | "exclusiveMinimum": 0 53 | }, 54 | "meltingPoint": { 55 | "description": "The melting temperature of the insulation material, in Celsius", 56 | "type": "number", 57 | "exclusiveMinimum": 0 58 | }, 59 | "resistivity": { 60 | "description": "Resistivity value according to manufacturer", 61 | "type": "array", 62 | "items": { 63 | "$ref": "/schemas/utils.json#/$defs/resistivityPoint" 64 | }, 65 | "minItems": 1, 66 | "uniqueItems": true 67 | } 68 | }, 69 | "required": ["name", "dielectricStrength"], 70 | 71 | "$defs": { 72 | "dieletricStrengthPoint": { 73 | "description": "data for describing one point of dieletric strength", 74 | "type": "object", 75 | "properties": { 76 | "value": { 77 | "description": "Dieletric strength value, in V / m", 78 | "type": "number", 79 | "exclusiveMinimum": 0 80 | }, 81 | "thickness": { 82 | "description": "Thickness of the material", 83 | "type": "number", 84 | "exclusiveMinimum": 0 85 | }, 86 | "temperature": { 87 | "description": "Temperature for the field value, in Celsius ", 88 | "type": "number" 89 | }, 90 | "humidity": { 91 | "description": "Humidity for the field value, in proportion over 1", 92 | "type": "number", 93 | "minimum": 0, 94 | "maximum": 1 95 | } 96 | }, 97 | "required": ["value"] 98 | } 99 | } 100 | } -------------------------------------------------------------------------------- /schemas/magnetic/insulation/wireCoating.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/insulation/wireCoating.json", 4 | "title": "insulation/wireCoating", 5 | "description": "A coating for a wire", 6 | "type": "object", 7 | "properties": { 8 | "type": { 9 | "description": "The type of the coating", 10 | "type": "string", 11 | "enum": ["bare", "enamelled", "insulated", "served", "taped", "extruded"] 12 | }, 13 | "thickness": { 14 | "description": "The maximum thickness of the insulation around the wire, in m", 15 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 16 | }, 17 | "material": { 18 | "oneOf": [ 19 | {"$ref": "/schemas/magnetic/insulation/material.json"}, 20 | { 21 | "description": "The name of the material used in the insulation", 22 | "type": "string" 23 | } 24 | ] 25 | }, 26 | "grade": { 27 | "description": "The grade of the insulation around the wire", 28 | "type": "integer", 29 | "exclusiveMinimum": 0 30 | }, 31 | "temperatureRating": { 32 | "description": "The maximum temperature that the wire coating can withstand", 33 | "type": "number", 34 | "exclusiveMinimum": 0 35 | }, 36 | "numberLayers": { 37 | "description": "The number of layers of the insulation around the wire", 38 | "type": "integer", 39 | "exclusiveMinimum": 0 40 | }, 41 | "thicknessLayers": { 42 | "description": "The thickness of the layers of the insulation around the wire, in m", 43 | "type": "number", 44 | "exclusiveMinimum": 0 45 | }, 46 | "breakdownVoltage": { 47 | "description": "The minimum voltage that causes a portion of an insulator to experience electrical breakdown and become electrically conductive, in V", 48 | "type": "number", 49 | "exclusiveMinimum": 0 50 | } 51 | }, 52 | "allOf": [ 53 | { 54 | "if": { 55 | "properties": { "type": { "const": "bare" } } 56 | }, 57 | "then": { 58 | "required": ["type"] 59 | } 60 | }, 61 | { 62 | "if": { 63 | "properties": { "type": { "const": "insulated" } } 64 | }, 65 | "then": { 66 | "required": ["type", "material", "numberLayers", "thicknessLayers"] 67 | } 68 | }, 69 | { 70 | "if": { 71 | "properties": { "type": { "const": "enamelled" } } 72 | }, 73 | "then": { 74 | "required": ["type", "grade"] 75 | } 76 | } 77 | ] 78 | } -------------------------------------------------------------------------------- /schemas/magnetic/wire.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/wire.json", 4 | "description": "The description of a magnet wire", 5 | "anyOf": [ 6 | {"$ref": "/schemas/magnetic/wire/round.json"}, 7 | {"$ref": "/schemas/magnetic/wire/foil.json"}, 8 | {"$ref": "/schemas/magnetic/wire/rectangular.json"}, 9 | {"$ref": "/schemas/magnetic/wire/litz.json"}, 10 | {"$ref": "/schemas/magnetic/wire/planar.json"} 11 | ], 12 | 13 | "$defs": { 14 | "wireType": { 15 | "description": "The type of wire", 16 | "title": "wireType", 17 | "type": "string", 18 | "enum": ["round", "litz", "rectangular", "foil", "planar"] 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /schemas/magnetic/wire/basicWire.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/wire/basicWire.json", 4 | "title": "wire/basicWire", 5 | "description": "The description of a basic magnet wire", 6 | "type": "object", 7 | "properties": { 8 | "name": { 9 | "description": "The name of wire", 10 | "type": "string" 11 | }, 12 | "type": { 13 | "$ref": "/schemas/magnetic/wire.json#/$defs/wireType" 14 | }, 15 | "standard": { 16 | "description": "The standard of wire", 17 | "title": "wireStandard", 18 | "type": "string", 19 | "enum": ["IEC 60317", "NEMA MW 1000 C", "IPC-6012"] 20 | }, 21 | "standardName": { 22 | "description": "Name according to the standard of wire", 23 | "type": "string" 24 | }, 25 | "manufacturerInfo": { 26 | "$ref": "/schemas/utils.json#/$defs/manufacturerInfo" 27 | }, 28 | "conductingArea": { 29 | "description": "The conducting area of the wire, in m². Used for some rectangular shapes where the area is smaller than expected due to rounded corners", 30 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 31 | }, 32 | "numberConductors": { 33 | "description": "The number of conductors in the wire", 34 | "type": "integer" 35 | }, 36 | "material": { 37 | "title": "WireMaterialDataOrNameUnion", 38 | "oneOf": [ 39 | {"$ref": "/schemas/magnetic/wire/material.json"}, 40 | { 41 | "description": "The name of the material used in the wire", 42 | "type": "string" 43 | } 44 | ] 45 | }, 46 | "coating": { 47 | "title": "CoatingDataOrNameUnion", 48 | "oneOf": [ 49 | {"$ref": "/schemas/magnetic/insulation/wireCoating.json"}, 50 | { 51 | "description": "The name of the coating used in the wire", 52 | "type": "string" 53 | } 54 | ] 55 | } 56 | }, 57 | "required": [ "type" ], 58 | 59 | "$defs": { 60 | } 61 | } -------------------------------------------------------------------------------- /schemas/magnetic/wire/foil.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/wire/foil.json", 4 | "$ref": "/schemas/magnetic/wire/basicWire.json", 5 | "title": "wire/foil", 6 | "description": "The description of a solid foil magnet wire", 7 | "type": "object", 8 | "properties": { 9 | "conductingWidth": { 10 | "description": "The conducting width of the wire, in m", 11 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 12 | }, 13 | "conductingHeight": { 14 | "description": "The conducting height of the wire, in m", 15 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 16 | }, 17 | "outerWidth": { 18 | "description": "The outer width of the wire, in m", 19 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 20 | }, 21 | "outerHeight": { 22 | "description": "The outer height of the wire, in m", 23 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 24 | } 25 | }, 26 | "required": [ "conductingWidth" ], 27 | 28 | "$defs": { 29 | } 30 | } -------------------------------------------------------------------------------- /schemas/magnetic/wire/litz.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/wire/litz.json", 4 | "$ref": "/schemas/magnetic/wire/basicWire.json", 5 | "title": "wire/litz", 6 | "description": "The description of a stranded litz magnet wire", 7 | "type": "object", 8 | "properties": { 9 | "strand": { 10 | "description": "The wire used as strands", 11 | "oneOf": [ 12 | {"title": "wireRound", "$ref": "/schemas/magnetic/wire/round.json"}, 13 | { 14 | "description": "The name of the wire used as strand", 15 | "type": "string" 16 | } 17 | ] 18 | }, 19 | "outerDiameter": { 20 | "description": "The outer diameter of the wire, in m", 21 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 22 | } 23 | }, 24 | "required": ["strand", "outerDiameter"] 25 | } -------------------------------------------------------------------------------- /schemas/magnetic/wire/material.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/wire/material.json", 4 | "title": "wire/material", 5 | "description": "A material for wire", 6 | "type": "object", 7 | "properties": { 8 | "name": { 9 | "description": "The name of a wire material", 10 | "type": "string" 11 | }, 12 | "permeability":{ 13 | "description": "The permeability of a wire material", 14 | "type": "number", 15 | "exclusiveMinimum": 0 16 | }, 17 | "resistivity":{"$ref": "#/$defs/resistivity"}, 18 | "thermalConductivity":{ 19 | "type": "array", 20 | "items": { 21 | "$ref": "#/$defs/thermalConductivityPoint" 22 | }, 23 | "minItems": 1 24 | } 25 | }, 26 | "required": ["name", "permeability", "resistivity"], 27 | 28 | "$defs": { 29 | "resistivity": { 30 | "description": "data for describing the resistivity of a wire", 31 | "type": "object", 32 | "properties": { 33 | "referenceValue": { 34 | "description": "Resistivity reference value, in Ohm * m", 35 | "type": "number", 36 | "exclusiveMinimum": 0 37 | }, 38 | "referenceTemperature": { 39 | "description": "Temperature reference value, in Celsius", 40 | "type": "number" 41 | }, 42 | "temperatureCoefficient": { 43 | "description": "Temperature coefficient value, alpha, in 1 / Celsius", 44 | "type": "number" 45 | } 46 | }, 47 | "required": ["referenceValue", "referenceTemperature", "temperatureCoefficient"] 48 | }, 49 | "thermalConductivityPoint": { 50 | "description": "data for describing one point of thermal conductivity", 51 | "type": "object", 52 | "properties": { 53 | "value": { 54 | "description": "Thermal conductivity value, in W / m * K", 55 | "type": "number", 56 | "exclusiveMinimum": 0 57 | }, 58 | "temperature": { 59 | "description": "Temperature for the field value, in Celsius", 60 | "type": "number" 61 | } 62 | }, 63 | "required": ["value", "temperature"] 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /schemas/magnetic/wire/planar.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/wire/planar.json", 4 | "$ref": "/schemas/magnetic/wire/basicWire.json", 5 | "title": "wire/planar", 6 | "description": "The description of a solid planar magnet wire", 7 | "type": "object", 8 | "properties": { 9 | "conductingWidth": { 10 | "description": "The conducting width of the wire, in m", 11 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 12 | }, 13 | "conductingHeight": { 14 | "description": "The conducting height of the wire, in m", 15 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 16 | }, 17 | "outerWidth": { 18 | "description": "The outer width of the wire, in m", 19 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 20 | }, 21 | "outerHeight": { 22 | "description": "The outer height of the wire, in m", 23 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 24 | } 25 | }, 26 | "required": [ "conductingWidth" ], 27 | 28 | "$defs": { 29 | } 30 | } -------------------------------------------------------------------------------- /schemas/magnetic/wire/rectangular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/wire/rectangular.json", 4 | "$ref": "/schemas/magnetic/wire/basicWire.json", 5 | "title": "wire/rectangular", 6 | "description": "The description of a solid rectangular magnet wire", 7 | "type": "object", 8 | "properties": { 9 | "conductingWidth": { 10 | "description": "The conducting width of the wire, in m", 11 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 12 | }, 13 | "conductingHeight": { 14 | "description": "The conducting height of the wire, in m", 15 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 16 | }, 17 | "edgeRadius": { 18 | "description": "The radius of the edge, in case of rectangular wire, in m", 19 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 20 | }, 21 | "outerWidth": { 22 | "description": "The outer width of the wire, in m", 23 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 24 | }, 25 | "outerHeight": { 26 | "description": "The outer height of the wire, in m", 27 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 28 | } 29 | }, 30 | "required": [ "conductingWidth", "conductingHeight" ], 31 | 32 | "$defs": { 33 | } 34 | } -------------------------------------------------------------------------------- /schemas/magnetic/wire/round.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/magnetic/wire/round.json", 4 | "$ref": "/schemas/magnetic/wire/basicWire.json", 5 | "title": "wire/round", 6 | "description": "The description of a solid round magnet wire", 7 | "type": "object", 8 | "properties": { 9 | "material": { 10 | "title": "WireMaterialDataOrNameUnion", 11 | "oneOf": [ 12 | {"$ref": "/schemas/magnetic/wire/material.json"}, 13 | { 14 | "description": "The name of the material used in the wire", 15 | "type": "string" 16 | } 17 | ] 18 | }, 19 | "conductingDiameter": { 20 | "description": "The conducting diameter of the wire, in m", 21 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 22 | }, 23 | "outerDiameter": { 24 | "description": "The outer diameter of the wire, in m", 25 | "$ref": "/schemas/utils.json#/$defs/dimensionWithTolerance" 26 | } 27 | }, 28 | "required": [ "conductingDiameter" ], 29 | 30 | "$defs": { 31 | } 32 | } -------------------------------------------------------------------------------- /schemas/outputs/coreLossesOutput.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/outputs/coreLossesOutput.json", 4 | "description": "Data describing the core losses and the intermediate inputs used to calculate them", 5 | "title": "coreLossesOutput", 6 | "type": "object", 7 | "properties": { 8 | "origin":{ 9 | "$ref": "/schemas/outputs.json#/$defs/resultOrigin" 10 | }, 11 | "methodUsed": { 12 | "description": "Model used to calculate the core losses in the case of simulation, or method used to measure it", 13 | "type": "string" 14 | }, 15 | "magneticFluxDensity":{ 16 | "description": "Excitation of the B field that produced the core losses", 17 | "title": "excitation", 18 | "$ref": "/schemas/inputs/operatingPointExcitation.json#/$defs/signalDescriptor" 19 | }, 20 | "temperature":{ 21 | "description": "temperature in the core that produced the core losses", 22 | "type": "number" 23 | }, 24 | "volumetricLosses": { 25 | "description": "Volumetric value of the core losses", 26 | "type": "number", 27 | "exclusiveMinimum": 0 28 | }, 29 | "massLosses": { 30 | "description": "Mass value of the core losses", 31 | "type": "number", 32 | "exclusiveMinimum": 0 33 | }, 34 | "eddyCurrentCoreLosses": { 35 | "description": "Part of the core losses due to eddy currents", 36 | "type": "number", 37 | "exclusiveMinimum": 0 38 | }, 39 | "hysteresisCoreLosses": { 40 | "description": "Part of the core losses due to hysteresis", 41 | "type": "number", 42 | "exclusiveMinimum": 0 43 | }, 44 | "coreLosses": { 45 | "description": "Value of the core losses", 46 | "type": "number", 47 | "exclusiveMinimum": 0 48 | } 49 | }, 50 | "required": ["origin", "methodUsed", "coreLosses"], 51 | 52 | "$defs": {} 53 | } -------------------------------------------------------------------------------- /schemas/utils.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "http://openmagnetics.com/schemas/utils.json", 4 | "description": "Some definition utils", 5 | "title": "utils", 6 | "type": "object", 7 | "properties": { 8 | "manufacturerInfo": { 9 | "$ref": "#/$defs/manufacturerInfo" 10 | }, 11 | "coordinates": { 12 | "$ref": "#/$defs/coordinates" 13 | }, 14 | "dimensions": { 15 | "$ref": "#/$defs/dimensions" 16 | }, 17 | "dimensionWithTolerance": { 18 | "$ref": "#/$defs/dimensionWithTolerance" 19 | } 20 | }, 21 | "$defs": { 22 | "resistivityPoint": { 23 | "description": "data for describing one point of resistivity", 24 | "title": "resistivityPoint", 25 | "type": "object", 26 | "properties": { 27 | "value": { 28 | "description": "Resistivity value, in Ohm * m", 29 | "type": "number", 30 | "exclusiveMinimum": 0 31 | }, 32 | "temperature": { 33 | "description": "temperature for the field value, in Celsius", 34 | "type": "number" 35 | } 36 | }, 37 | "required": ["value"] 38 | }, 39 | "manufacturerInfo":{ 40 | "description": "Data from the manufacturer for a given part", 41 | "type": "object", 42 | "properties": { 43 | "name": { 44 | "description": "The name of the manufacturer of the part", 45 | "type": "string" 46 | }, 47 | "status": { 48 | "description": "The production status of a part according to its manufacturer", 49 | "type": "string", 50 | "enum": ["production", "prototype", "obsolete"] 51 | }, 52 | "reference": { 53 | "description": "The manufacturer's reference of this part", 54 | "type": "string" 55 | }, 56 | "orderCode": { 57 | "description": "The manufacturer's order code of this part", 58 | "type": "string" 59 | }, 60 | "family": { 61 | "description": "The family of a magnetic, as defined by the manufacturer", 62 | "type": "string" 63 | }, 64 | "datasheetUrl": { 65 | "description": "The manufacturer's URL to the datasheet of the product", 66 | "type": "string" 67 | }, 68 | "cost": { 69 | "description": "The manufacturer's price for this part", 70 | "type": "string" 71 | } 72 | }, 73 | "required": ["name"] 74 | }, 75 | "distributorInfo":{ 76 | "description": "Data from the distributor for a given part", 77 | "title": "distributorInfo", 78 | "type": "object", 79 | "properties": { 80 | "name": { 81 | "description": "The name of the distributor of the part", 82 | "type": "string" 83 | }, 84 | "phone": { 85 | "description": "The distributor's phone", 86 | "type": "string" 87 | }, 88 | "email": { 89 | "description": "The distributor's email", 90 | "type": "string" 91 | }, 92 | "link": { 93 | "description": "The distributor's link", 94 | "type": "string" 95 | }, 96 | "country": { 97 | "description": "The country of the distributor of the part", 98 | "type": "string" 99 | }, 100 | "distributedArea": { 101 | "description": "The area where the distributor doistributes", 102 | "type": "string" 103 | }, 104 | "reference": { 105 | "description": "The distributor's reference of this part", 106 | "type": "string" 107 | }, 108 | "quantity": { 109 | "description": "The number of individual pieces available in the distributor", 110 | "type": "number" 111 | }, 112 | "updatedAt": { 113 | "description": "The date that this information was updated", 114 | "type": "string" 115 | }, 116 | "cost": { 117 | "description": "The distributor's price for this part", 118 | "type": "number" 119 | } 120 | }, 121 | "required": ["name", "reference", "quantity"] 122 | }, 123 | "rotation":{ 124 | "description": "Data describing the rotation around the corresponding axis in cartesian 2 or 3 dimensional space, in radians", 125 | "type": "array", 126 | "items": { 127 | "type": "number" 128 | }, 129 | "minItems": 2, 130 | "maxItems": 3 131 | }, 132 | "coordinates":{ 133 | "description": "Data describing coordinates in 2 or 3 dimensional space. In case of cartesian coordinates, they represent x, y and z; in case of spherical, they represent r, tetha and gamma, in mathematics convention", 134 | "type": "array", 135 | "items": { 136 | "type": "number" 137 | }, 138 | "minItems": 2, 139 | "maxItems": 3 140 | }, 141 | "dimensions":{ 142 | "description": "Data describing a dimensions in 2 or 3 dimensional space. In case of cartesian coordinates, they represent x, y and z; in case of spherical, they represent r, tetha and gamma, in mathematics convention", 143 | "type": "array", 144 | "items": { 145 | "type": "number" 146 | }, 147 | "minItems": 2, 148 | "maxItems": 3 149 | }, 150 | "velocity":{ 151 | "description": "Data describing a velocity in cartesian 2 or 3 dimensional space", 152 | "type": "array", 153 | "items": { 154 | "type": "number" 155 | }, 156 | "minItems": 2, 157 | "maxItems": 3 158 | }, 159 | "twoDimensionalMatrix":{ 160 | "description": "Data a two dimensional matrix, created as an array of array, where the first coordinate in the X and the second the Y", 161 | "type": "array", 162 | "items": { 163 | "type": "array", 164 | "items": { 165 | "$ref": "#/$defs/dimensionWithTolerance" 166 | }, 167 | "minItems": 1 168 | }, 169 | "minItems": 1 170 | }, 171 | "dimensionWithTolerance": { 172 | "description": "A dimension of with minimum, nominal, and maximum values", 173 | "title": "dimensionWithTolerance", 174 | "type": "object", 175 | "properties": { 176 | "minimum": { 177 | "description": "The minimum value of the dimension", 178 | "type": "number" 179 | }, 180 | "nominal": { 181 | "description": "The nominal value of the dimension", 182 | "type": "number" 183 | }, 184 | "maximum": { 185 | "description": "The maximum value of the dimension", 186 | "type": "number" 187 | }, 188 | "excludeMinimum": { 189 | "description": "True is the minimum value must be excluded from the range", 190 | "type": "boolean", 191 | "default": false 192 | }, 193 | "excludeMaximum": { 194 | "description": "True is the maximum value must be excluded from the range", 195 | "type": "boolean", 196 | "default": false 197 | } 198 | }, 199 | "anyOf": [ 200 | {"required": ["minimum"]}, 201 | {"required": ["nominal"]}, 202 | {"required": ["maximum"]} 203 | ] 204 | }, 205 | "columnShape": { 206 | "description": "Shape of the column, also used for gaps", 207 | "type": "string", 208 | "enum": ["oblong", "round", "rectangular", "irregular"] 209 | }, 210 | "connectionType": { 211 | "description": "Type of the terminal", 212 | "title": "connectionType", 213 | "type": "string", 214 | "enum": ["Pin", "Screw", "SMT", "Flying Lead"] 215 | }, 216 | "complexFieldPoint":{ 217 | "description": "Data describing the complex value of a field in a 2D or 3D space", 218 | "title": "complexFieldPoint", 219 | "type": "object", 220 | "properties": { 221 | "turnIndex":{ 222 | "description": "If this field point is inside of a wire, this is the index of the turn", 223 | "type": "integer" 224 | }, 225 | "turnLength":{ 226 | "description": "If this field point is inside of a wire, this is the length of the turn", 227 | "type": "number" 228 | }, 229 | "label":{ 230 | "description": "If this point has some special significance, can be identified with this label", 231 | "type": "string" 232 | }, 233 | "point":{ 234 | "description": "The coordinates of the point of the field", 235 | "$ref": "#/$defs/coordinates" 236 | }, 237 | "real": { 238 | "description": "Real value of the field at this point", 239 | "type": "number" 240 | }, 241 | "imaginary": { 242 | "description": "Imaginary value of the field at this point", 243 | "type": "number" 244 | } 245 | }, 246 | "required": ["point", "real", "imaginary"] 247 | }, 248 | "complexField":{ 249 | "description": "Data describing a field in a 2D or 3D space", 250 | "title": "complexField", 251 | "type": "object", 252 | "properties": { 253 | "frequency": { 254 | "description": "Value of the field at this point", 255 | "type": "number" 256 | }, 257 | "data": { 258 | "description": "Value of the magnetizing inductance", 259 | "type": "array", 260 | "items": { 261 | "$ref": "#/$defs/complexFieldPoint" 262 | }, 263 | "minItems": 1 264 | } 265 | }, 266 | "required": ["frequency", "data"] 267 | }, 268 | "fieldPoint":{ 269 | "description": "Data describing the value of a field in a 2D or 3D space", 270 | "title": "fieldPoint", 271 | "type": "object", 272 | "properties": { 273 | "turnIndex":{ 274 | "description": "If this field point is inside of a wire, this is the index of the turn", 275 | "type": "integer" 276 | }, 277 | "turnLength":{ 278 | "description": "If this field point is inside of a wire, this is the length of the turn", 279 | "type": "number" 280 | }, 281 | "label":{ 282 | "description": "If this point has some special significance, can be identified with this label", 283 | "type": "string" 284 | }, 285 | "point":{ 286 | "description": "The coordinates of the point of the field", 287 | "$ref": "#/$defs/coordinates" 288 | }, 289 | "rotation": { 290 | "description": "Rotation of the rectangle defining the turn, in degrees", 291 | "type": "number", 292 | "default": 0 293 | }, 294 | "value": { 295 | "description": "Value of the field at this point", 296 | "type": "number" 297 | } 298 | }, 299 | "required": ["point", "value"] 300 | }, 301 | "field":{ 302 | "description": "Data describing a field in a 2D or 3D space", 303 | "title": "field", 304 | "type": "object", 305 | "properties": { 306 | "frequency": { 307 | "description": "Value of the field at this point", 308 | "type": "number" 309 | }, 310 | "data": { 311 | "description": "Value of the magnetizing inductance", 312 | "type": "array", 313 | "items": { 314 | "$ref": "#/$defs/fieldPoint" 315 | }, 316 | "minItems": 1 317 | } 318 | }, 319 | "required": ["frequency", "data"] 320 | }, 321 | "isolationSide": { 322 | "description": "Tag to identify windings that are sharing the same ground", 323 | "title": "isolationSide", 324 | "type": "string", 325 | "enum": ["primary", "secondary", "tertiary", "quaternary", "quinary", "senary", "septenary", "octonary", "nonary", "denary", "undenary", "duodenary"] 326 | } 327 | } 328 | } -------------------------------------------------------------------------------- /tests/Test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "TestReporterStdout.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "json.hpp" 9 | using nlohmann::json_uri; 10 | using nlohmann::json_schema::json_validator; 11 | using json = nlohmann::json; 12 | 13 | namespace UnitTest { 14 | class ListFilter { 15 | char **list; 16 | int n; 17 | public: 18 | ListFilter(char **list_, int count) { 19 | list = list_; n = count; 20 | } 21 | bool operator()(const Test* const t) const { 22 | for (int i=0;im_details.testName, list[i]) || 25 | !strcasecmp(t->m_details.suiteName, list[i]) || 26 | !strcasecmp(t->m_details.filename, list[i]) || 27 | !strcasecmp(t->m_details.filename, dot_cpp_appended.c_str())) { 28 | // erring on the side of matching more tests 29 | return true; 30 | } 31 | } 32 | return false; 33 | } 34 | }; 35 | 36 | int RunTheseTests(char ** list, int n) { 37 | TestReporterStdout reporter; 38 | TestRunner runner(reporter); 39 | return runner.RunTestsIf(Test::GetTestList(), NULL, ListFilter(list,n), 0); 40 | } 41 | } 42 | 43 | int main(int argc, char *argv[]) { 44 | if (argc == 1) { 45 | UnitTest::RunAllTests(); 46 | } else { 47 | UnitTest::RunTheseTests(argv+1, argc-1); // skip the program's name itself. 48 | } 49 | } -------------------------------------------------------------------------------- /tests/TestData.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "json.hpp" 8 | using nlohmann::json_uri; 9 | using nlohmann::json_schema::json_validator; 10 | using json = nlohmann::json; 11 | 12 | 13 | SUITE(Samples) 14 | { 15 | std::string file_path = __FILE__; 16 | auto mas_path = file_path.substr(0, file_path.rfind("/")).append("/../"); 17 | 18 | static void loader(const json_uri & uri, json & schema) 19 | { 20 | std::string filename = mas_path + uri.path(); 21 | std::ifstream lf(filename); 22 | if (!lf.good()) 23 | throw std::invalid_argument("could not open " + uri.url() + " tried with " + filename); 24 | try 25 | { 26 | lf >> schema; 27 | } 28 | catch (const std::exception & e) 29 | { 30 | throw e; 31 | } 32 | } 33 | std::string ReplaceAll(std::string str, const std::string& from, const std::string& to) { 34 | size_t start_pos = 0; 35 | while((start_pos = str.find(from, start_pos)) != std::string::npos) { 36 | str.replace(start_pos, from.length(), to); 37 | start_pos += to.length(); // Handles case where 'to' is a substring of 'from' 38 | } 39 | return str; 40 | } 41 | 42 | static void validate_json(const std::string samples) 43 | { 44 | try 45 | { 46 | for (auto const& dir_entry : std::filesystem::recursive_directory_iterator(samples)) 47 | { 48 | auto path = dir_entry.path(); 49 | if (path.string().ends_with(".json")) { 50 | std::vector v(path.begin(), path.end()); 51 | 52 | auto validator_path = path.parent_path().string() + ".json"; 53 | validator_path = ReplaceAll(validator_path, "samples", "schemas"); 54 | 55 | try 56 | { 57 | std::ifstream f(validator_path); 58 | json shape_schema = json::parse(f); 59 | 60 | json_validator validator(loader); // create validator 61 | try 62 | { 63 | validator.set_root_schema(shape_schema); // insert root-schema 64 | } 65 | catch (const std::exception & e) 66 | { 67 | std::cerr << "Validation of schema failed, here is why: " << e.what() << "\n"; 68 | CHECK(false); // fails 69 | return; 70 | } 71 | 72 | std::ifstream json_file(dir_entry.path()); 73 | // std::cout << dir_entry.path() << std::endl; 74 | auto jf = json::parse(json_file); 75 | try 76 | { 77 | validator.validate(jf); // validate the document - uses the default throwing error-handler 78 | } 79 | catch (const std::exception & e) 80 | { 81 | std::cerr << "Validation failed, here is why: " << e.what() << "\n"; 82 | CHECK(false); // fails 83 | return; 84 | } 85 | 86 | } 87 | catch (std::exception & e) 88 | { 89 | std::cerr << "Could not open and parse " << validator_path << ": " << e.what() << "\n"; 90 | CHECK(false); // fails 91 | return; 92 | } 93 | } 94 | } 95 | } 96 | catch (std::exception & e) 97 | { 98 | std::cerr << "Could not open and parse " << samples << ": " << e.what() << "\n"; 99 | CHECK(false); // fails 100 | return; 101 | } 102 | } 103 | 104 | TEST(AllSamples) 105 | { 106 | auto samples_file_path = mas_path + "samples/"; 107 | validate_json(samples_file_path); 108 | } 109 | } 110 | 111 | 112 | SUITE(Data) 113 | { 114 | std::string file_path = __FILE__; 115 | auto mas_path = file_path.substr(0, file_path.rfind("/")).append("/../"); 116 | 117 | static void loader(const json_uri & uri, json & schema) 118 | { 119 | std::string filename = mas_path + uri.path(); 120 | std::ifstream lf(filename); 121 | if (!lf.good()) 122 | throw std::invalid_argument("could not open " + uri.url() + " tried with " + filename); 123 | try 124 | { 125 | lf >> schema; 126 | } 127 | catch (const std::exception & e) 128 | { 129 | throw e; 130 | } 131 | } 132 | 133 | static void validate_ndjson(const std::string validator, const std::string database) 134 | { 135 | try 136 | { 137 | std::ifstream f(validator); 138 | json shape_schema = json::parse(f); 139 | 140 | json_validator validator(loader); // create validator 141 | try 142 | { 143 | validator.set_root_schema(shape_schema); // insert root-schema 144 | } 145 | catch (const std::exception & e) 146 | { 147 | std::cerr << "Validation of schema failed, here is why: " << e.what() << "\n"; 148 | CHECK(false); // fails 149 | return; 150 | } 151 | 152 | try 153 | { 154 | // std::cout << database << std::endl; 155 | std::ifstream ndjson_file(database); 156 | std::string myline; 157 | 158 | while (std::getline(ndjson_file, myline)) 159 | { 160 | // std::cout << myline << std::endl; 161 | json jf = json::parse(myline); 162 | 163 | try 164 | { 165 | validator.validate(jf); // validate the document - uses the default throwing error-handler 166 | } 167 | catch (const std::exception & e) 168 | { 169 | std::cerr << "Validation failed, here is why: " << e.what() << "\n"; 170 | CHECK(false); // fails 171 | break; 172 | } 173 | } 174 | } 175 | catch (std::exception & e) 176 | { 177 | std::cerr << "Could not open and parse " << database << ": " << e.what() << "\n"; 178 | CHECK(false); // fails 179 | return; 180 | } 181 | } 182 | catch (std::exception & e) 183 | { 184 | std::cerr << "Could not open and parse " << validator << ": " << e.what() << "\n"; 185 | CHECK(false); // fails 186 | return; 187 | } 188 | } 189 | 190 | static void check_valid_ndjson(const std::string database) 191 | { 192 | try 193 | { 194 | // std::cout << database << std::endl; 195 | std::ifstream ndjson_file(database); 196 | std::string myline; 197 | 198 | while (std::getline(ndjson_file, myline)) 199 | { 200 | // std::cout << myline << std::endl; 201 | json jf = json::parse(myline); 202 | } 203 | } 204 | catch (std::exception & e) 205 | { 206 | std::cerr << "Could not open and parse " << database << ": " << e.what() << "\n"; 207 | CHECK(false); // fails 208 | return; 209 | } 210 | } 211 | 212 | TEST(CoreShapes) 213 | { 214 | auto data_file_path = mas_path + "data/core_shapes.ndjson"; 215 | auto schema_file_path = mas_path + "schemas/magnetic/core/shape.json"; 216 | validate_ndjson(schema_file_path, data_file_path); 217 | } 218 | 219 | TEST(Bobbins) 220 | { 221 | auto data_file_path = mas_path + "data/bobbins.ndjson"; 222 | auto schema_file_path = mas_path + "schemas/magnetic/bobbin.json"; 223 | validate_ndjson(schema_file_path, data_file_path); 224 | } 225 | 226 | TEST(CoreMaterials) 227 | { 228 | auto data_file_path = mas_path + "data/core_materials.ndjson"; 229 | auto schema_file_path = mas_path + "schemas/magnetic/core/material.json"; 230 | validate_ndjson(schema_file_path, data_file_path); 231 | } 232 | 233 | TEST(Advanced_Materials) 234 | { 235 | auto data_file_path = mas_path + "data/advanced_core_materials.ndjson"; 236 | check_valid_ndjson(data_file_path); 237 | } 238 | 239 | TEST(Wires) 240 | { 241 | auto data_file_path = mas_path + "data/wires.ndjson"; 242 | auto schema_file_path = mas_path + "schemas/magnetic/wire.json"; 243 | validate_ndjson(schema_file_path, data_file_path); 244 | } 245 | 246 | TEST(Insulation) 247 | { 248 | auto data_file_path = mas_path + "data/insulation_materials.ndjson"; 249 | auto schema_file_path = mas_path + "schemas/magnetic/insulation/material.json"; 250 | validate_ndjson(schema_file_path, data_file_path); 251 | } 252 | 253 | TEST(WireMaterials) 254 | { 255 | auto data_file_path = mas_path + "data/wire_materials.ndjson"; 256 | auto schema_file_path = mas_path + "schemas/magnetic/wire/material.json"; 257 | validate_ndjson(schema_file_path, data_file_path); 258 | } 259 | 260 | TEST(CoreStock) 261 | { 262 | auto data_file_path = mas_path + "data/cores_stock.ndjson"; 263 | auto schema_file_path = mas_path + "schemas/magnetic/core.json"; 264 | validate_ndjson(schema_file_path, data_file_path); 265 | } 266 | 267 | TEST(Cores) 268 | { 269 | auto data_file_path = mas_path + "data/cores.ndjson"; 270 | auto schema_file_path = mas_path + "schemas/magnetic/core.json"; 271 | validate_ndjson(schema_file_path, data_file_path); 272 | } 273 | } 274 | --------------------------------------------------------------------------------