Skip to content

Commit

Permalink
update rom potential flow examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco1410 committed Oct 26, 2023
1 parent 8270636 commit 16386fd
Show file tree
Hide file tree
Showing 8 changed files with 210,361 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,8 @@
{
"element_type": "perturbation_incompressible"
},
"convergence_criterion": "solution_criterion",
"linear_solver_settings" : {
"solver_type": "amgcl",
"max_iteration": 400,
"gmres_krylov_space_dimension": 100,
"smoother_type":"ilu0",
"coarsening_type":"ruge_stuben",
"coarse_enough" : 5000,
"krylov_type": "lgmres",
"tolerance": 1e-9,
"verbosity": 0,
"scaling": false
"solver_type": "LinearSolversApplication.pardiso_lu"
},
"volume_model_part_name" : "Parts_Parts_Auto1",
"skin_parts" : ["PotentialWallCondition2D_Far_field_Auto1","Body2D_Body"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ def GetRomManagerParameters():
"save_vtk_output": false, // false, true #if true, it must exits previously in the ProjectParameters.json
"output_name": "id", // "id" , "mu"
"ROM":{
"svd_truncation_tolerance": 1e-12,
"svd_truncation_tolerance": 1e-30,
"model_part_name": "MainModelPart", // This changes depending on the simulation: Structure, FluidModelPart, ThermalPart #TODO: Idenfity it automatically
"nodal_unknowns": ["VELOCITY_POTENTIAL","AUXILIARY_VELOCITY_POTENTIAL"], // Main unknowns. Snapshots are taken from these
"rom_basis_output_format": "json", // "json" "numpy"
"rom_basis_output_format": "numpy", // "json" "numpy"
"rom_basis_output_name": "RomParameters",
"snapshots_control_type": "step", // "step", "time"
"snapshots_interval": 1,
Expand All @@ -94,8 +94,8 @@ def GetRomManagerParameters():
},
"HROM":{
"element_selection_type": "empirical_cubature",
"element_selection_svd_truncation_tolerance": 1e-12,
"create_hrom_visualization_model_part" : true,
"element_selection_svd_truncation_tolerance": 1e-30,
"create_hrom_visualization_model_part" : false,
"echo_level" : 0
}
}""")
Expand All @@ -112,8 +112,8 @@ def get_multiple_params_by_Halton_test(number_of_values):
l_angle = -1.0
u_angle = 6.0
#Mach infinit
l_mach = 0.03
u_mach = 0.6
l_mach = 0.05
u_mach = 0.65
mu = []
values = qmc.scale(sample, [l_angle,l_mach], [u_angle,u_mach])
for i in range(number_of_values):
Expand All @@ -128,8 +128,8 @@ def get_multiple_params_by_Halton_train(number_of_values):
l_angle = -1.0
u_angle = 6.0
#Mach infinit
l_mach = 0.03
u_mach = 0.6
l_mach = 0.05
u_mach = 0.65
mu = []
values = qmc.scale(sample, [l_angle,l_mach], [u_angle,u_mach])
values[0,0] = l_angle
Expand Down Expand Up @@ -174,8 +174,8 @@ def plot_mu_values(mu_train,mu_test):
if __name__ == "__main__":
KratosMultiphysics.kratos_utilities.DeleteDirectoryIfExisting('Results')

mu_train = get_multiple_params_by_Halton_train(25)
mu_test = get_multiple_params_by_Halton_test(25)
mu_train = get_multiple_params_by_Halton_train(30)
mu_test = get_multiple_params_by_Halton_test(10)

plot_mu_values(mu_train,mu_test)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"analysis_stage": "KratosMultiphysics.MeshMovingApplication.mesh_moving_analysis",
"problem_data" : {
"problem_name" : "naca0012",
"parallel_type" : "OpenMP",
"echo_level" : 0,
"start_time" : 0.0,
"end_time" : 1.0
},
"solver_settings" : {
"solver_type": "structural_similarity",
"model_part_name" : "MainModelPart",
"model_import_settings" : {
"input_type" : "mdpa",
"input_filename" : "naca0012_0aoa_00"
},
"echo_level": 0,
"time_stepping" : {
"time_step" : 1.0
},
"domain_size" : 2,
"linear_solver_settings" : {
"solver_type" : "amgcl",
"max_iteration" : 500,
"tolerance" : 1e-7,
"provide_coordinates" : false,
"smoother_type" : "ilu0",
"krylov_type" : "bicgstab",
"coarsening_type" : "aggregation",
"scaling" : false,
"verbosity" : 0
}
},
"processes" : {
"initial_conditions_process_list" : [],
"boundary_conditions_process_list" : [{
"python_module" : "impose_mesh_motion_process",
"kratos_module" : "KratosMultiphysics.MeshMovingApplication",
"process_name" : "ImposeMeshMotionProcess",
"Parameters" : {
"model_part_name" : "MainModelPart.Body2D_Body",
"rotation_definition" : "rotation_axis",
"rotation_axis" : [0.0, 0.0, 1.0],
"reference_point" : [0.999999, 2e-7, 0.0],
"rotation_angle" : 0.0
}
},{
"python_module" : "fix_vector_variable_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "FixVectorVariableProcess",
"Parameters" : {
"model_part_name" : "MainModelPart.Body2D_Body",
"variable_name" : "MESH_DISPLACEMENT",
"constrained" : [true,true,true]
}
},{
"python_module" : "assign_vector_variable_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "AssignVectorVariableProcess",
"Parameters" : {
"model_part_name" : "MainModelPart.PotentialWallCondition2D_Far_field_Auto1",
"variable_name" : "MESH_DISPLACEMENT",
"value" : [0.0,0.0,0.0]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"analysis_stage": "KratosMultiphysics.CompressiblePotentialFlowApplication.potential_flow_analysis",
"problem_data" : {
"problem_name" : "naca0012",
"parallel_type" : "OpenMP",
"echo_level" : 0,
"start_time" : 0.0,
"end_time" : 1.0
},
"solver_settings" : {
"solver_type" : "potential_flow",
"model_part_name" : "MainModelPart",
"domain_size" : 2,
"model_import_settings" : {
"input_type" : "mdpa",
"input_filename" : "naca0012_0aoa_00"
},
"echo_level" : 1,
"material_import_settings": {
"materials_filename": ""
},
"formulation" :
{
"element_type": "perturbation_incompressible"
},
"linear_solver_settings" : {
"solver_type": "LinearSolversApplication.pardiso_lu"
},
"volume_model_part_name" : "Parts_Parts_Auto1",
"skin_parts" : ["PotentialWallCondition2D_Far_field_Auto1","Body2D_Body"],
"no_skin_parts" : []
},
"processes" : {
"initial_conditions_process_list" : [],
"boundary_conditions_process_list" : [{
"python_module" : "apply_far_field_process",
"kratos_module" : "KratosMultiphysics.CompressiblePotentialFlowApplication",
"process_name" : "FarFieldProcess",
"Parameters" : {
"model_part_name" : "MainModelPart.PotentialWallCondition2D_Far_field_Auto1",
"angle_of_attack" : 0.0,
"mach_infinity" : 0.05,
"free_stream_density" : 1.225,
"perturbation_field" : true
}
},
{
"python_module" : "define_wake_process_2d",
"kratos_module" : "KratosMultiphysics.CompressiblePotentialFlowApplication",
"process_name" : "DefineWakeProcess",
"Parameters" : {
"model_part_name" : "MainModelPart.Body2D_Body",
"echo_level": 0
}
},
{
"python_module" : "compute_nodal_value_process",
"kratos_module" : "KratosMultiphysics.CompressiblePotentialFlowApplication",
"process_name" : "ComputeNodalValueProcess",
"Parameters" : {
"model_part_name" : "MainModelPart",
"elemental_variables_list_to_project": ["VELOCITY","PRESSURE_COEFFICIENT"]
}
}
]
},
"output_processes" : {
"gid_output" : [{
"python_module" : "gid_output_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "GiDOutputProcess",
"help" : "This process writes postprocessing files for GiD",
"Parameters" : {
"model_part_name" : "MainModelPart.Parts_Parts_Auto1",
"output_name" : "Results/outputPrimal",
"postprocess_parameters" : {
"result_file_configuration" : {
"gidpost_flags" : {
"GiDPostMode" : "GiD_PostBinary",
"WriteDeformedMeshFlag" : "WriteDeformed",
"WriteConditionsFlag" : "WriteConditions",
"MultiFileFlag" : "SingleFile"
},
"file_label" : "step",
"output_control_type" : "step",
"output_interval" : 1,
"body_output" : true,
"node_output" : false,
"skin_output" : false,
"plane_output" : [],
"nodal_nonhistorical_results": ["VELOCITY","PRESSURE_COEFFICIENT"],
"nodal_results" : ["VELOCITY_POTENTIAL","AUXILIARY_VELOCITY_POTENTIAL"],
"gauss_point_results" : ["WAKE"]
},
"point_data_configuration" : []
}
}
}]
}
}
Loading

0 comments on commit 16386fd

Please sign in to comment.