@@ -21,8 +21,8 @@ y0 = -1
2121xa, ya, xb, yb, xc, yc = trifoil_formation (x0, y0, 0.035 )
2222
2323# Initialize the `LineCableSystem` with the first cable (phase A):
24- cabledef = CableDef (cable_design, xa, ya, Dict (" core" => 1 , " sheath" => 0 , " jacket" => 0 ))
25- cable_system = LineCableSystem (" tutorial" , 20.0 , earth_params, 1000.0 , cabledef )
24+ cablepos = CablePosition (cable_design, xa, ya, Dict (" core" => 1 , " sheath" => 0 , " jacket" => 0 ))
25+ cable_system = LineCableSystem (" tutorial" , 1000.0 , cablepos )
2626
2727# Add remaining cables (phases B and C):
2828addto_linecablesystem! (cable_system, cable_design, xb, yb,
@@ -35,36 +35,45 @@ addto_linecablesystem!(
3535
3636display (cable_system)
3737
38- # Create a FEMProblemDefinition with custom parameters
38+ # Define a LineParametersProblem with the cable system and earth model
39+ problem = LineParametersProblem (
40+ cable_system,
41+ temperature= 20.0 , # Operating temperature
42+ earth_props= earth_params,
43+ frequencies= [50.0 ], # Frequency for the analysis
44+ )
45+
46+ # Create a FEMFormulation with custom mesh definitions
3947domain_radius = 5.0
40- problem = FEMProblemDefinition (
48+ formulation = FEMFormulation (
4149 domain_radius= domain_radius,
42- correct_twisting = true ,
50+ domain_radius_inf = domain_radius * 1.25 ,
4351 elements_per_length_conductor= 1 ,
4452 elements_per_length_insulator= 2 ,
4553 elements_per_length_semicon= 1 ,
4654 elements_per_length_interfaces= 5 ,
4755 points_per_circumference= 16 ,
48- analysis_type= [ 0 , 1 ], # Electrostatic and magnetostatic
56+ analysis_type= ( FEMDarwin (), FEMElectrodynamics ()),
4957 mesh_size_min= 1e-6 ,
5058 mesh_size_max= domain_radius / 5 ,
5159 mesh_size_default= domain_radius / 10 ,
5260 mesh_algorithm= 5 ,
5361 materials_db= materials_db
5462)
5563
56- # Create a FEMSolver with custom parameters
57- solver = FEMSolver (
64+ # Define runtime FEMOptions
65+ opts = FEMOptions (
5866 force_remesh= true , # Force remeshing
59- run_solver= false ,
67+ run_solver= true ,
68+ overwrite_results= true ,
6069 preview_geo= false , # Preview geometry
61- preview_mesh= true , # Preview the mesh
70+ preview_mesh= false , # Preview the mesh
6271 base_path= joinpath (@__DIR__ , " fem_output" ),
63- verbosity= 0 , # Verbose output
64- getdp_executable= joinpath (" /home/amartins/Applications/onelab-Linux64" , " getdp" ), # Path to GetDP executable
72+ verbosity= 2 , # Verbose output
73+ getdp_executable= joinpath (" /home/amartins/Applications/onelab-Linux64" , " getdp" ), # Path to GetDP executable
6574)
6675
6776# Run the FEM model
68- workspace = run_fem_model (cable_system, problem, solver, frequency = 50.0 )
77+ @time _ = compute! ( problem, formulation, opts )
6978
7079println (" FEM model run completed." )
0 commit comments