Skip to content

Commit 5559bc3

Browse files
committed
Adding the source files and gifs for FSI_Turek CoSim
1 parent e8a20a0 commit 5559bc3

11 files changed

Lines changed: 108105 additions & 0 deletions
1.67 MB
Loading
5.21 MB
Loading
49.9 KB
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import KratosMultiphysics as KM
2+
from KratosMultiphysics.CoSimulationApplication.co_simulation_analysis import CoSimulationAnalysis
3+
4+
"""
5+
For user-scripting it is intended that a new class is derived
6+
from CoSimulationAnalysis to do modifications
7+
Check also "kratos/python_scripts/analysis_stage.py" for available methods that can be overridden
8+
"""
9+
10+
parameter_file_name = "ProjectParametersCoSim.json"
11+
with open(parameter_file_name,'r') as parameter_file:
12+
parameters = KM.Parameters(parameter_file.read())
13+
14+
simulation = CoSimulationAnalysis(parameters)
15+
simulation.Run()
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
{
2+
"problem_data" : {
3+
"problem_name" : "fsi_turek_FSI2",
4+
"parallel_type" : "OpenMP",
5+
"echo_level" : 0,
6+
"start_time" : 0.0,
7+
"end_time" : 20.0
8+
},
9+
"solver_settings" : {
10+
"solver_type" : "ale_fluid",
11+
"ale_boundary_parts" : ["FluidNoSlipInterface2D_FluidInterface"],
12+
"mesh_motion_solver_settings" : {
13+
"echo_level" : 0,
14+
"domain_size" : 2,
15+
"model_part_name" : "FluidModelPart",
16+
"solver_type" : "structural_similarity"
17+
},
18+
"fluid_solver_settings": {
19+
"solver_type" : "Monolithic",
20+
"domain_size" : 2,
21+
"model_part_name" : "FluidModelPart",
22+
"model_import_settings" : {
23+
"input_type" : "mdpa",
24+
"input_filename" : "fsi_turek_FSI2_Fluid"
25+
},
26+
"echo_level" : 0,
27+
"compute_reactions" : true,
28+
"formulation": {
29+
"element_type": "vms",
30+
"use_orthogonal_subscales": false,
31+
"dynamic_tau": 1.0
32+
},
33+
"maximum_iterations" : 10,
34+
"relative_velocity_tolerance" : 1e-6,
35+
"absolute_velocity_tolerance" : 1e-6,
36+
"relative_pressure_tolerance" : 1e-6,
37+
"absolute_pressure_tolerance" : 1e-6,
38+
"volume_model_part_name" : "Parts_Fluid",
39+
"skin_parts" : ["AutomaticInlet2D_Inlet","Outlet2D_Outlet","NoSlip2D_NoSlip","NoSlip2D_Cylinder","FluidNoSlipInterface2D_FluidInterface"],
40+
"no_skin_parts" : ["ALEMeshDisplacementBC2D_FluidALEMeshFreeX","ALEMeshDisplacementBC2D_FluidALEMeshFixXY","ALEMeshDisplacementBC2D_Cylinder"],
41+
"time_stepping" : {
42+
"automatic_time_step" : false,
43+
"time_step" : 0.002
44+
}
45+
}
46+
},
47+
"processes" : {
48+
"initial_conditions_process_list" : [],
49+
"boundary_conditions_process_list" : [{
50+
"python_module" : "apply_inlet_process",
51+
"kratos_module" : "KratosMultiphysics.FluidDynamicsApplication",
52+
"Parameters" : {
53+
"model_part_name" : "FluidModelPart.AutomaticInlet2D_Inlet",
54+
"variable_name" : "VELOCITY",
55+
"modulus" : "1.5*(0.5*(1-cos(0.5*pi*t))*1.0)*(4.0/0.1681)*y*(0.41-y)",
56+
"direction" : "automatic_inwards_normal",
57+
"interval" : [0.0,2.0]
58+
}
59+
},{
60+
"python_module" : "apply_inlet_process",
61+
"kratos_module" : "KratosMultiphysics.FluidDynamicsApplication",
62+
"Parameters" : {
63+
"model_part_name" : "FluidModelPart.AutomaticInlet2D_Inlet",
64+
"variable_name" : "VELOCITY",
65+
"modulus" : "1.5*(1.0)*(4.0/0.1681)*y*(0.41-y)",
66+
"direction" : "automatic_inwards_normal",
67+
"interval" : [2.0,"End"]
68+
}
69+
},{
70+
"python_module" : "apply_outlet_process",
71+
"kratos_module" : "KratosMultiphysics.FluidDynamicsApplication",
72+
"Parameters" : {
73+
"model_part_name" : "FluidModelPart.Outlet2D_Outlet",
74+
"variable_name" : "PRESSURE",
75+
"constrained" : true,
76+
"value" : 0.0,
77+
"hydrostatic_outlet" : false,
78+
"h_top" : 0.0
79+
}
80+
},{
81+
"python_module" : "apply_noslip_process",
82+
"kratos_module" : "KratosMultiphysics.FluidDynamicsApplication",
83+
"Parameters" : {
84+
"model_part_name" : "FluidModelPart.NoSlip2D_NoSlip"
85+
}
86+
},{
87+
"python_module" : "apply_noslip_process",
88+
"kratos_module" : "KratosMultiphysics.FluidDynamicsApplication",
89+
"Parameters" : {
90+
"model_part_name" : "FluidModelPart.NoSlip2D_Cylinder"
91+
}
92+
},
93+
{
94+
"python_module" : "apply_noslip_process",
95+
"kratos_module" : "KratosMultiphysics.FluidDynamicsApplication",
96+
"Parameters" : {
97+
"model_part_name" : "FluidModelPart.FluidNoSlipInterface2D_FluidInterface"
98+
}
99+
}],
100+
"gravity" : [],
101+
"ale_boundary_conditions" : [{
102+
"python_module" : "fix_vector_variable_process",
103+
"kratos_module" : "KratosMultiphysics",
104+
"help" : "This process fixes the selected components of a given vector variable",
105+
"process_name" : "AssignVectorVariableProcess",
106+
"Parameters" : {
107+
"model_part_name" : "FluidModelPart.FluidNoSlipInterface2D_FluidInterface",
108+
"variable_name" : "MESH_DISPLACEMENT",
109+
"constrained" : [true, true, true]
110+
}
111+
112+
},{
113+
"python_module" : "fix_vector_variable_process",
114+
"kratos_module" : "KratosMultiphysics",
115+
"help" : "This process fixes the selected components of a given vector variable",
116+
"process_name" : "AssignVectorVariableProcess",
117+
"Parameters" : {
118+
"model_part_name" : "FluidModelPart.AutomaticInlet2D_Inlet",
119+
"variable_name" : "MESH_DISPLACEMENT",
120+
"constrained" : [true, true, true]
121+
}
122+
123+
},{
124+
"python_module" : "fix_vector_variable_process",
125+
"kratos_module" : "KratosMultiphysics",
126+
"help" : "This process fixes the selected components of a given vector variable",
127+
"process_name" : "AssignVectorVariableProcess",
128+
"Parameters" : {
129+
"model_part_name" : "FluidModelPart.NoSlip2D_NoSlip",
130+
"variable_name" : "MESH_DISPLACEMENT",
131+
"constrained" : [true, true, true]
132+
}
133+
134+
},{
135+
"python_module" : "fix_vector_variable_process",
136+
"kratos_module" : "KratosMultiphysics",
137+
"help" : "This process fixes the selected components of a given vector variable",
138+
"process_name" : "AssignVectorVariableProcess",
139+
"Parameters" : {
140+
"model_part_name" : "FluidModelPart.Outlet2D_Outlet",
141+
"variable_name" : "MESH_DISPLACEMENT",
142+
"constrained" : [true, true, true]
143+
}
144+
145+
},{
146+
"python_module" : "fix_vector_variable_process",
147+
"kratos_module" : "KratosMultiphysics",
148+
"help" : "This process fixes the selected components of a given vector variable",
149+
"process_name" : "AssignVectorVariableProcess",
150+
"Parameters" : {
151+
"model_part_name" : "FluidModelPart.NoSlip2D_Cylinder",
152+
"variable_name" : "MESH_DISPLACEMENT",
153+
"constrained" : [true, true, true]
154+
}}
155+
]
156+
},
157+
"output_processes" : {
158+
"vtk_output" : [{
159+
"python_module" : "vtk_output_process",
160+
"kratos_module" : "KratosMultiphysics",
161+
"process_name" : "VtkOutputProcess",
162+
"help" : "This process writes postprocessing files for Paraview",
163+
"Parameters" : {
164+
"model_part_name" : "FluidModelPart.Parts_Fluid",
165+
"output_control_type" : "step",
166+
"output_interval" : 1,
167+
"file_format" : "binary",
168+
"output_precision" : 7,
169+
"output_sub_model_parts" : false,
170+
"output_path" : "vtk_output_fsi_turek2_cfd",
171+
"save_output_files_in_folder" : true,
172+
"nodal_solution_step_data_variables" : ["VELOCITY","PRESSURE","MESH_DISPLACEMENT","MESH_VELOCITY", "REACTION"]
173+
}
174+
}
175+
]
176+
}
177+
}
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"problem_data" : {
3+
"problem_name" : "fsi_turek_FSI2",
4+
"parallel_type" : "OpenMP",
5+
"start_time" : 0.0,
6+
"end_time" : 20.0,
7+
"echo_level" : 0
8+
},
9+
"solver_settings" : {
10+
"solver_type" : "dynamic",
11+
"echo_level" : 1,
12+
"analysis_type" : "non_linear",
13+
"time_integration_method" : "implicit",
14+
"scheme_type" : "bossak",
15+
"model_part_name" : "Structure",
16+
"domain_size" : 2,
17+
"model_import_settings" : {
18+
"input_type" : "mdpa",
19+
"input_filename" : "fsi_turek_FSI2_Structural"
20+
},
21+
"material_import_settings" : {
22+
"materials_filename" : "StructuralMaterials.json"
23+
},
24+
"time_stepping" : {
25+
"time_step" : 0.002
26+
},
27+
"convergence_criterion" : "residual_criterion",
28+
"displacement_relative_tolerance" : 0.0001,
29+
"displacement_absolute_tolerance" : 1e-9,
30+
"residual_relative_tolerance" : 1e-6,
31+
"residual_absolute_tolerance" : 1e-8,
32+
"max_iteration" : 10,
33+
"linear_solver_settings" : {
34+
"solver_type" : "LinearSolversApplication.sparse_qr"
35+
},
36+
"rotation_dofs" : false
37+
},
38+
"processes" : {
39+
"constraints_process_list" : [{
40+
"python_module" : "assign_vector_variable_process",
41+
"kratos_module" : "KratosMultiphysics",
42+
"Parameters" : {
43+
"model_part_name" : "Structure.DISPLACEMENT_FixedDisplacement",
44+
"variable_name" : "DISPLACEMENT",
45+
"constrained" : [true,true,true],
46+
"value" : [0.0,0.0,0.0],
47+
"interval" : [0.0,"End"]
48+
}
49+
}],
50+
"loads_process_list" : [
51+
// {
52+
// "python_module" : "assign_vector_by_direction_to_condition_process",
53+
// "kratos_module" : "KratosMultiphysics",
54+
// "process_name" : "AssignVectorByDirectionToConditionProcess",
55+
// "Parameters" : {
56+
// "mesh_id" : 0,
57+
// "model_part_name" : "Structure.StructureInterface2D_StructureInterface",
58+
// "variable_name" : "POINT_LOAD",
59+
// "modulus" : 1,
60+
// "direction" : [0.0,-1.0,0.0]
61+
// }
62+
// }
63+
]
64+
},
65+
"output_processes" : {
66+
"vtk_output" : [{
67+
"python_module" : "vtk_output_process",
68+
"kratos_module" : "KratosMultiphysics",
69+
"process_name" : "VtkOutputProcess",
70+
"help" : "This process writes postprocessing files for Paraview",
71+
"Parameters" : {
72+
"model_part_name" : "Structure",
73+
"output_control_type" : "step",
74+
"output_interval" : 1,
75+
"file_format" : "binary",
76+
"output_precision" : 7,
77+
"output_sub_model_parts" : false,
78+
"output_path" : "vtk_output_fsi_turek2_csd",
79+
"save_output_files_in_folder" : true,
80+
"nodal_solution_step_data_variables" : ["DISPLACEMENT", "POINT_LOAD"]
81+
}
82+
},{
83+
"python_module" : "point_output_process",
84+
"kratos_module" : "KratosMultiphysics",
85+
"process_name" : "PointOutputProcess",
86+
"help" : "This process writes postprocessing files for Paraview",
87+
"Parameters" : {
88+
"model_part_name" : "Structure",
89+
"entity_type" : "node",
90+
"interval" : [0.0, "End"],
91+
"position" : [0.60000 ,0.20067 ,0.00000],
92+
"output_variables" : ["DISPLACEMENT_X"],
93+
"historical_value" : true,
94+
"search_configuration" : "initial",
95+
"search_tolerance" : 1e-6,
96+
"print_format" : "",
97+
"output_file_settings" : {
98+
"file_name" : "Point_A_Displacement_X",
99+
"output_path": "",
100+
"write_buffer_size" : 1,
101+
"file_extension" : "dat"
102+
}
103+
}}],
104+
"hdf5_output": [
105+
// {
106+
// "kratos_module" : "KratosMultiphysics.HDF5Application",
107+
// "python_module" : "single_mesh_temporal_output_process",
108+
// "process_name" : "SingleMeshTemporalOutputProcess",
109+
// "Parameters" : {
110+
// "model_part_name" : "Structure",
111+
// "file_settings" : {
112+
// "file_name" : "structure_<time>.h5",
113+
// "file_access_mode" : "truncate"
114+
// },
115+
// "nodal_solution_step_data_settings" : {
116+
// "list_of_variables" : ["DISPLACEMENT", "REACTION"]
117+
// },
118+
// "condition_data_value_settings" : {
119+
// "list_of_variables" : ["POINT_LOAD"]
120+
// }
121+
// }
122+
// }
123+
]
124+
}
125+
}

0 commit comments

Comments
 (0)