@@ -899,7 +899,11 @@ def test_heat_charge_bcs_validation(boundary_conditions):
899
899
900
900
# Invalid ACVoltageSource: infinite voltage
901
901
with pytest .raises (pd .ValidationError ):
902
- td .VoltageBC (source = td .ACVoltageSource (voltage = np .array ([td .inf , 0 , 1 ]), amplitude = 1e-2 ))
902
+ td .VoltageBC (
903
+ source = td .ACVoltageSource (
904
+ voltage = np .array ([td .inf , 0 , 1 ]), signal = td .SinusoidalSignal (amplitude = 1e-2 )
905
+ )
906
+ )
903
907
904
908
905
909
def test_ssac_freqs_validation ():
@@ -937,7 +941,7 @@ def test_ssac_freqs_validation():
937
941
938
942
charge_tolerance = td .ChargeToleranceSpec (rel_tol = 1e5 , abs_tol = 1e3 , max_iters = 400 )
939
943
ssac_freqs_input = [1e3 , 1e4 , 1e5 ]
940
- isothermal_spec = td .IsothermalSteadyChargeDCAnalysis (
944
+ isothermal_spec = td .IsothermalSSACAnalysis (
941
945
temperature = 300 ,
942
946
tolerance_settings = charge_tolerance ,
943
947
fermi_dirac = True ,
@@ -965,7 +969,7 @@ def test_ssac_freqs_validation():
965
969
)
966
970
967
971
# Test that ssac_freqs with ACVoltageSource works
968
- ac_source = td .ACVoltageSource (voltage = [0 , 1 , 2 ], amplitude = 1e-3 )
972
+ ac_source = td .ACVoltageSource (voltage = [0 , 1 , 2 ], signal = td . SinusoidalSignal ( amplitude = 1e-3 ) )
969
973
sim = td .HeatChargeSimulation (
970
974
size = (8 , 8 , 8 ),
971
975
center = (0 , 0 , 0 ),
@@ -1332,10 +1336,14 @@ def createSolid(geometry, name):
1332
1336
solid_structure_3 = createSolid (solid_box_3 , "solid_3" )
1333
1337
1334
1338
bc_ssac1 = td .VoltageBC (
1335
- source = td .ACVoltageSource (voltage = [0 , 1 ], amplitude = 1e-3 , name = "ac_source1" )
1339
+ source = td .ACVoltageSource (
1340
+ voltage = [0 , 1 ], signal = td .SinusoidalSignal (amplitude = 1e-3 ), name = "ac_source1"
1341
+ )
1336
1342
)
1337
1343
bc_ssac2 = td .VoltageBC (
1338
- source = td .ACVoltageSource (voltage = [0 , 1 ], amplitude = 1e-3 , name = "ac_source2" )
1344
+ source = td .ACVoltageSource (
1345
+ voltage = [0 , 1 ], signal = td .SinusoidalSignal (amplitude = 1e-3 ), name = "ac_source2"
1346
+ )
1339
1347
)
1340
1348
1341
1349
placement1 = td .StructureStructureInterface (structures = ["solid_1" , "solid_2" ])
@@ -1346,14 +1354,15 @@ def createSolid(geometry, name):
1346
1354
td .HeatChargeBoundarySpec (condition = bc_ssac2 , placement = placement2 ),
1347
1355
]
1348
1356
1349
- with pytest .raises (pd .ValidationError , match = "Only a single AC source can be supplied" ):
1357
+ with pytest .raises (pd .ValidationError , match = "Only a single AC source can be supplied. " ):
1350
1358
td .HeatChargeSimulation (
1351
1359
structures = [solid_structure_1 , solid_structure_2 , solid_structure_3 ],
1352
1360
center = (2 , 2 , 2 ),
1353
1361
size = (6 , 6 , 6 ),
1354
1362
boundary_spec = boundary_spec ,
1355
1363
medium = air ,
1356
1364
grid_spec = grid_specs ["uniform" ],
1365
+ analysis_spec = td .IsothermalSSACAnalysis (ssac_freqs = [1e2 , 1e3 ]),
1357
1366
)
1358
1367
1359
1368
@@ -1627,8 +1636,16 @@ def test_charge_simulation(
1627
1636
1628
1637
# Two AC sources cannot be defined
1629
1638
with pytest .raises (pd .ValidationError ):
1630
- bc_ssac_n = bc_n .updated_copy (source = td .ACVoltageSource (voltage = [0 , 1 ], amplitude = 1e-3 ))
1631
- bc_ssac_p = bc_p .updated_copy (source = td .ACVoltageSource (voltage = [0 , 1 ], amplitude = 1e-3 ))
1639
+ bc_ssac_n = bc_n .updated_copy (
1640
+ source = td .ACVoltageSource (
1641
+ voltage = [0 , 1 ], signal = td .SinusoidalSignal (amplitude = 1e-3 )
1642
+ )
1643
+ )
1644
+ bc_ssac_p = bc_p .updated_copy (
1645
+ source = td .ACVoltageSource (
1646
+ voltage = [0 , 1 ], signal = td .SinusoidalSignal (amplitude = 1e-3 )
1647
+ )
1648
+ )
1632
1649
analysis = sim .analysis_spec .updated_copy (ssac_freqs = [1e2 , 1e3 ])
1633
1650
sim .updated_copy (boundary_spec = [bc_n_ground , bc_p_ground ], analysis_spec = analysis )
1634
1651
0 commit comments