From 84f7e5d25b1323a1a83b5d6a66c354416e84ff8c Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 6 Oct 2023 14:42:35 +0200 Subject: Add missing simulation yamls --- coil_mag_materials.yml | 68 +++++++++++++++++++++++++++++++++++++++ coil_mag_sim.yml | 14 ++++++++ coil_mag_solvers.yml | 50 ++++++++++++++++++++++++++++ gerbonara/cad/kicad/base_types.py | 2 +- gerbonara/cad/kicad/footprints.py | 20 ++++++++++-- 5 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 coil_mag_materials.yml create mode 100644 coil_mag_sim.yml create mode 100644 coil_mag_solvers.yml diff --git a/coil_mag_materials.yml b/coil_mag_materials.yml new file mode 100644 index 0000000..9efbb80 --- /dev/null +++ b/coil_mag_materials.yml @@ -0,0 +1,68 @@ +air: + Density: 1.1885 # 20°C + Electric Conductivity: 0.0 + Heat Capacity: 1006.4 # 20°C + Heat Conductivity: 0.025873 # 20°C + Relative Permeability: 1 + Relative Permittivity: 1 +ro4003c: + Density: 1790 # 23°C + Relative Permeability: 1 + Relative Permittivity: 3.55 +ideal: + Relative Permittivity: 1 +copper: + Density: 8960.0 # 0°C + Electric Conductivity: 32300000 # 200°C + Emissivity: 0.012 # 327°C + Heat Capacity: 415.0 # 200°C + Heat Conductivity: 401.0 # 0°C + Relative Permeability: 1 + Relative Permittivity: 1 +graphite_CZ3-R6300: # crucible + Density: 1730.0 + Electric Conductivity: 58800 + Emissivity: 0.81 # 205°C + Heat Capacity: 1237.0 + Heat Conductivity: 65 # 20°C + Relative Permeability: 1 + Relative Permittivity: 1 +graphite_FU8957: # heater + Density: 1750.0 + Emissivity: 0.81 # 250°C + Heat Capacity: 1237.0 + Heat Conductivity: 105 # averaged over different given values + Relative Permeability: 1 + Relative Permittivity: 1 +steel_1.4541: + Density: 7900.0 # 20°C + Electric Conductivity: 1370 + Emissivity: 0.111 # 200°C + Heat Capacity: 470.0 # 20°C + Heat Conductivity: 15.0 # 20°C + Relative Permeability: 1 + Relative Permittivity: 1 +tin_liquid: + Density: 6980.0 + Electric Conductivity: 2080000 + Emissivity: 0.064 # set equal to solid + Heat Capacity: 252.7 + Heat Conductivity: 29.0 + Relative Permeability: 1 + Relative Permittivity: 1 + Liquid: 'Logical True' +tin_solid: + Density: 7179.0 + Electric Conductivity: 4380000 + Emissivity: 0.064 + Heat Capacity: 244.0 + Heat Conductivity: 60.0 + Relative Permeability: 1 + Relative Permittivity: 1 + Solid: 'Logical True' + Melting Point: 505 + Latent Heat: 59600 +water: + Density: 1000.0 + Heat Capacity: 4182.0 + Heat Conductivity: 0.6 diff --git a/coil_mag_sim.yml b/coil_mag_sim.yml new file mode 100644 index 0000000..f2200e6 --- /dev/null +++ b/coil_mag_sim.yml @@ -0,0 +1,14 @@ +3D_steady: + Mesh Levels: 1 + Max Output Level: 7 + Coordinate System: Cartesian + Coordinate Mapping(3): 1 2 3 + Simulation Type: Steady state + Steady State Max Iterations: 1 + Output Intervals: 1 + Timestepping Method: BDF + Simulation Timing: True + BDF Order: 1 + Solver Input File: case.sif + Post File: case.vtu + Output File: case.result diff --git a/coil_mag_solvers.yml b/coil_mag_solvers.yml new file mode 100644 index 0000000..bb7b169 --- /dev/null +++ b/coil_mag_solvers.yml @@ -0,0 +1,50 @@ +Static_Current_Conduction: + Equation: Static Current Conduction + Variable: Potential + Procedure: '"StatCurrentSolve" "StatCurrentSolver"' + Calculate Volume Current: True + Calculate Joule Heating: False + Optimize Bandwidth: True + Nonlinear System Max Iterations: 1 + Linear System Solver: Iterative + Linear System Iterative Method: BiCGStabl + Linear System Max Iterations: 5000 + Linear System Convergence Tolerance: 1.0e-10 + Linear System Preconditioning: ILU0 + Linear System ILUT Tolerance: 1.0e-3 + Linear System Abort Not Converged: False + Linear System Residual Output: 20 + Linear System Precondition Recompute: 1 + +Magneto_Dynamics: + Equation: MGDynamics + Procedure: '"MagnetoDynamics" "WhitneyAVSolver"' + Newton-Raphson Iteration: True + Nonlinear System Max Iterations: 1 + Linear System Solver: Iterative + Linear System Preconditioning: none + Linear System Convergence Tolerance: 1e-8 + Linear System Residual Output: 20 + Linear System Max Iterations: 5000 + Linear System Iterative Method: BiCGStabl + BiCGStabL Polynomial Degree: 4 + Idrs Parameter: 6 + Solver Timing: True + +Magneto_Dynamics_Calculations: + Equation: MGDynamicsCalc + Procedure: '"MagnetoDynamics" "MagnetoDynamicsCalcFields"' + Linear System Symmetric: True + Calculate Magnetic Field Strength: True + Calculate JxB: False + Calculate Current Density: True + Calculate Electric Field: False + Calculate Nodal Fields: False + Calculate Elemental Fields: True + Linear System Solver: Iterative + Linear System Preconditioning: ILU0 + Linear System Residual Output: 0 + Linear System Max Iterations: 5000 + Linear System Iterative Method: CG + Linear System Convergence Tolerance: 1.0e-8 + diff --git a/gerbonara/cad/kicad/base_types.py b/gerbonara/cad/kicad/base_types.py index 11eeb6d..81eb0c4 100644 --- a/gerbonara/cad/kicad/base_types.py +++ b/gerbonara/cad/kicad/base_types.py @@ -239,7 +239,7 @@ class AtPos(XYCoord): x: float = 0 # in millimeter y: float = 0 # in millimeter rotation: int = 0 # in degrees, can only be 0, 90, 180 or 270. - unlocked: Flag() = False + unlocked: Flag() = True def __before_sexp__(self): self.rotation = int(round(self.rotation % 360)) diff --git a/gerbonara/cad/kicad/footprints.py b/gerbonara/cad/kicad/footprints.py index 7bdeec6..aedef41 100644 --- a/gerbonara/cad/kicad/footprints.py +++ b/gerbonara/cad/kicad/footprints.py @@ -627,7 +627,7 @@ class Footprint: zone_connect: Named(int) = None thermal_width: Named(float) = None thermal_gap: Named(float) = None - attributes: List(Attribute) = field(default_factory=list) + attributes: Attribute = field(default_factory=list) private_layers: Named(str) = None net_tie_pad_groups: Named(Array(str)) = None texts: List(Text) = field(default_factory=list) @@ -672,11 +672,27 @@ class Footprint: effects = TextEffect() self.properties.append(DrawnProperty(key, value, - at=AtPos(x, y, rotation), + at=AtPos(x, y, rotation, unlocked=True), layer=layer, hide=hide, effects=effects)) + def make_standard_properties(self): + if not self.property_value('Reference', None): + self.set_property('Reference', 'REF**', 0, 0, 0, 'F.SilkS') + + if not self.property_value('Value', None): + self.set_property('Value', self.name or 'VAL**', 0, 0, 0, hide=False) + + if not self.property_value('Footprint', None): + self.set_property('Footprint', '', 0, 0, 0) + + if not self.property_value('Datasheet', None): + self.set_property('Datasheet', '', 0, 0, 0) + + if not self.property_value('Description', None): + self.set_property('Description', self.descr or '', 0, 0, 0) + @property def pads_by_number(self): return {(int(pad.number) if pad.number.isnumeric() else pad.number): pad for pad in self.pads if pad.number} -- cgit