Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FSI] Embedded membrane example #136

Merged
merged 3 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fluid_structure_interaction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Coming soon...

## Validation Cases
- [FSI lid driven cavity](https://github.com/KratosMultiphysics/Examples/blob/master/fluid_structure_interaction/validation/fsi_lid_driven_cavity/README.md)
- [Flexible membrane airfoil (embedded)](https://github.com/KratosMultiphysics/Examples/blob/master/fluid_structure_interaction/validation/embedded_fsi_membrane_airfoil/README.md)
- [Mixer with flexible blades (embedded)](https://github.com/KratosMultiphysics/Examples/blob/master/fluid_structure_interaction/validation/embedded_fsi_mixer_Y/README.md)
- [Mok benchmark](https://github.com/KratosMultiphysics/Examples/blob/master/fluid_structure_interaction/validation/fsi_mok/README.md)
- [Mok benchmark (embedded)](https://github.com/KratosMultiphysics/Examples/blob/master/fluid_structure_interaction/validation/embedded_fsi_mok/README.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Mixer with flexible blades

**Author:** [Rubén Zorrilla](https://github.com/rubenzorrilla)

**Kratos version:** 9.1

**Source files:** [Mixer with flexible blades](https://github.com/KratosMultiphysics/Examples/tree/master/fluid_structure_interaction/validation/embedded_fsi_mixer_Y/source)

## Case Specification
This example is specifically conceived to prove the extended scope of applicatoin of embedded mesh methods. Hence, it involves extremely large rotations, which would be impossible to solve by using a body fitted ALE based approach.

The problem is set up as a 2D idealization of a turbine mixer with clockwise-anticlockwise alternate rotation. The problem geometry is a unit diameter circle with three embedded flexible blades. An imposed rotation is enforced in the blades axis to emulate the spin of the rotor. Such rotation changes the direction (anticlockwise to clockwise and viceversa) after More details on the dimensions, material settings and boundary conditions can be found in [here](https://doi.org/10.1016/j.cma.2020.113179).

## Results
The fluid domain is meshed with a 45 and 540 radial and perimeter subdivisions Q1P1 elements centered structured mesh. Each one of the flexible blades is meshed with an 8x39 subdivisions structured mesh made with Total Lagrangian quadrilateral elements. The problem is run for 20s so three complete rotations (anticlockwise - clockwise - anticlockwise) are simulated.

The obtained velocity and pressure fields, together with the level set zero isosurface representing the deformed geometry, are shown below.

<p align="center">
<figure>
<img src="data/embedded_fsi_mixer_Y_v.gif" alt="Velocity field and level set isosurface." style="width: 600px;"/>
<figcaption>Velocity field and level set isosurface.</figcaption>
</figure>
</p>

<p align="center">
<figure>
<img src="data/embedded_fsi_mixer_Y_p.gif" alt="Pressure field and level set isosurface." style="width: 600px;"/>
<figcaption>Pressure field and level set isosurface.</figcaption>
</figure>
</p>

## References
R. Zorrilla, R. Rossi, R. Wüchner and E. Oñate, An embedded Finite Element framework for the resolution of strongly coupled Fluid–Structure Interaction problems. Application to volumetric and membrane-like structures, Computer Methods in Applied Mechanics and Engineering (368), [10.1016/j.cma.2020.113179](https://doi.org/10.1016/j.cma.2020.113179)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"properties" : [{
"model_part_name" : "FluidModelPart",
"properties_id" : 0,
"Material" : null
},{
"model_part_name" : "FluidModelPart.FluidParts_Fluid",
"properties_id" : 1,
"Material" : {
"constitutive_law" : {
"name" : "Newtonian2DLaw"
},
"Variables" : {
"DENSITY" : 1.0,
"DYNAMIC_VISCOSITY" : 0.000155
},
"Tables" : null
}
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import sys
import math
import time
import importlib

import KratosMultiphysics

def CreateAnalysisStageWithFlushInstance(cls, global_model, parameters):
class AnalysisStageWithFlush(cls):

def __init__(self, model,project_parameters, flush_frequency=10.0):
super().__init__(model,project_parameters)
self.flush_frequency = flush_frequency
self.last_flush = time.time()
sys.stdout.flush()

def Initialize(self):
super().Initialize()
sys.stdout.flush()

def FinalizeSolutionStep(self):
super().FinalizeSolutionStep()

if self.parallel_type == "OpenMP":
now = time.time()
if now - self.last_flush > self.flush_frequency:
sys.stdout.flush()
self.last_flush = now

return AnalysisStageWithFlush(global_model, parameters)

if __name__ == "__main__":

with open("ProjectParameters.json", 'r') as parameter_file:
parameters = KratosMultiphysics.Parameters(parameter_file.read())

analysis_stage_module_name = parameters["analysis_stage"].GetString()
analysis_stage_class_name = analysis_stage_module_name.split('.')[-1]
analysis_stage_class_name = ''.join(x.title() for x in analysis_stage_class_name.split('_'))

analysis_stage_module = importlib.import_module(analysis_stage_module_name)
analysis_stage_class = getattr(analysis_stage_module, analysis_stage_class_name)

global_model = KratosMultiphysics.Model()
simulation = CreateAnalysisStageWithFlushInstance(analysis_stage_class, global_model, parameters)
simulation.Run()
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
{
"analysis_stage" : "KratosMultiphysics.FSIApplication.fsi_analysis",
"problem_data": {
"problem_name": "embedded_fsi_membrane_airfoil",
"parallel_type": "OpenMP",
"echo_level": 0,
"start_time": 0.0,
"end_time": 1.0e0
},
"solver_settings": {
"solver_type": "partitioned_embedded",
"coupling_scheme": "dirichlet_neumann",
"echo_level": 1,
"structure_solver_settings": {
"solver_type" : "Dynamic",
"model_part_name" : "Structure",
"domain_size" : 2,
"echo_level" : 0,
"analysis_type" : "non_linear",
"time_integration_method" : "implicit",
"scheme_type" : "bossak",
"model_import_settings" : {
"input_type": "mdpa",
"input_filename": "embedded_fsi_membrane_airfoil_structure"
},
"material_import_settings": {
"materials_filename": "StructuralMaterials.json"
},
"time_stepping": {
"time_step": 5e-3
},
"line_search" : false,
"convergence_criterion" : "residual_criterion",
"displacement_relative_tolerance" : 1e-5,
"displacement_absolute_tolerance" : 1e-7,
"residual_relative_tolerance" : 1e-5,
"residual_absolute_tolerance" : 1e-7,
"max_iteration" : 20
},
"fluid_solver_settings":{
"model_part_name" : "FluidModelPart",
"domain_size" : 2,
"solver_type" : "Embedded",
"model_import_settings" : {
"input_type" : "mdpa",
"input_filename" : "embedded_fsi_membrane_airfoil_fluid"
},
"material_import_settings": {
"materials_filename": "FluidMaterials.json"
},
"distance_modification_settings": {
"distance_threshold": 1.0e-3
},
"echo_level" : 0,
"compute_reactions" : true,
"maximum_iterations" : 10,
"relative_velocity_tolerance" : 1e-5,
"absolute_velocity_tolerance" : 1e-7,
"relative_pressure_tolerance" : 1e-5,
"absolute_pressure_tolerance" : 1e-7,
"assign_neighbour_elements_to_conditions" : true,
"volume_model_part_name" : "FluidModelPart.FluidParts_Fluid",
"skin_parts" : ["FluidModelPart.AutomaticInlet2D_Inlet","FluidModelPart.Outlet2D_Outlet","FluidModelPart.VelocityConstraints2D_Walls"],
"no_skin_parts" : [],
"time_stepping" : {
"automatic_time_step": false,
"time_step": 5e-3
},
"formulation": {
"element_type": "embedded_weakly_compressible_navier_stokes_discontinuous",
"is_slip": true,
"slip_length": 1.0e6,
"penalty_coefficient": 1.0e3,
"dynamic_tau": 1.0
},
"fm_ale_settings": {
"fm_ale_step_frequency": 1,
"mesh_movement": "implicit",
"fm_ale_solver_settings": {
"structure_model_part_name": "FSICouplingInterfaceFluid",
"virtual_model_part_name": "VirtualModelPart",
"linear_solver_settings": {
"preconditioner_type": "amg",
"solver_type": "amgcl",
"smoother_type": "ilu0",
"krylov_type": "cg",
"max_iteration": 2000,
"verbosity": 0,
"tolerance": 1e-8,
"scaling": false,
"use_block_matrices_if_possible": true
},
"embedded_nodal_variable_settings": {
"gradient_penalty_coefficient": 5.0e-2,
"linear_solver_settings": {
"preconditioner_type": "amg",
"solver_type": "amgcl",
"smoother_type": "ilu0",
"krylov_type": "cg",
"max_iteration": 2000,
"verbosity": 0,
"tolerance": 1e-8,
"scaling": false,
"block_size": 1,
"use_block_matrices_if_possible": true
}
}
}
}
},
"coupling_settings":{
"nl_tol": 1e-4,
"nl_max_it": 10,
"coupling_strategy_settings": {
"solver_type": "MVQN",
"w_0": 0.5,
"abs_cut_off_tol" : 1e-6
},
"structure_interfaces_list": ["Structure.LinePressure2D_Load"]
}
},
"processes":{
"structure_constraints_process_list" : [{
"python_module" : "assign_vector_variable_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "AssignVectorVariableProcess",
"Parameters" : {
"model_part_name" : "Structure.DISPLACEMENT_EndPoints",
"variable_name" : "DISPLACEMENT",
"interval" : [0.0,"End"],
"constrained" : [true,true,true],
"value" : [0.0,0.0,0.0]
}
}],
"structure_loads_process_list" : [],
"fluid_initial_conditions_process_list" : [],
"fluid_boundary_conditions_process_list" : [{
"python_module" : "apply_inlet_process",
"kratos_module" : "KratosMultiphysics.FluidDynamicsApplication",
"process_name" : "ApplyInletProcess",
"Parameters" : {
"model_part_name" : "FluidModelPart.AutomaticInlet2D_Inlet",
"variable_name" : "VELOCITY",
"interval" : [0.0,"End"],
"modulus" : 2.5833,
"direction" : "automatic_inwards_normal"
}
},{
"python_module" : "apply_outlet_process",
"kratos_module" : "KratosMultiphysics.FluidDynamicsApplication",
"process_name" : "ApplyOutletProcess",
"Parameters" : {
"model_part_name" : "FluidModelPart.Outlet2D_Outlet",
"variable_name" : "PRESSURE",
"constrained" : true,
"value" : 0.0,
"hydrostatic_outlet" : false,
"h_top" : 0.0
}
},{
"python_module" : "assign_vector_variable_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "AssignVectorVariableProcess",
"Parameters" : {
"model_part_name" : "FluidModelPart.VelocityConstraints2D_Walls",
"variable_name" : "VELOCITY",
"interval" : [0.0,"End"],
"constrained" : [false,true,false],
"value" : [null,0.0,null]
}
},{
"python_module" : "assign_vector_variable_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "AssignVectorVariableProcess",
"Parameters" : {
"model_part_name" : "FluidModelPart.AutomaticInlet2D_Inlet",
"variable_name" : "MESH_DISPLACEMENT",
"interval" : [0.0,"End"],
"constrained" : [true,true,false],
"value" : [0.0,0.0,null]
}
},{
"python_module" : "assign_vector_variable_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "AssignVectorVariableProcess",
"Parameters" : {
"model_part_name" : "FluidModelPart.Outlet2D_Outlet",
"variable_name" : "MESH_DISPLACEMENT",
"interval" : [0.0,"End"],
"constrained" : [true,true,false],
"value" : [0.0,0.0,null]
}
},{
"python_module" : "assign_vector_variable_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "AssignVectorVariableProcess",
"Parameters" : {
"model_part_name" : "FluidModelPart.VelocityConstraints2D_Walls",
"variable_name" : "MESH_DISPLACEMENT",
"interval" : [0.0,"End"],
"constrained" : [true,true,false],
"value" : [0.0,0.0,null]
}
}],
"fluid_gravity" : [],
"fluid_auxiliar_process_list" : [{
"python_module": "apply_embedded_postprocess_process",
"kratos_module": "KratosMultiphysics.FluidDynamicsApplication",
"process_name": "ApplyEmbeddedPostprocessrocess",
"Parameters": {
"model_part_name": "FluidModelPart.FluidParts_Fluid"
}
}]
},
"output_processes":{
"gid_output" : [{
"python_module" : "gid_output_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "GiDOutputProcess",
"Parameters" : {
"model_part_name" : "Structure",
"output_name" : "gordnier_membrane_structure",
"postprocess_parameters" : {
"result_file_configuration" : {
"gidpost_flags" : {
"GiDPostMode" : "GiD_PostBinary",
"WriteDeformedMeshFlag" : "WriteDeformed",
"WriteConditionsFlag" : "WriteConditions",
"MultiFileFlag" : "SingleFile"
},
"file_label" : "time",
"output_control_type" : "step",
"output_interval" : 1,
"body_output" : true,
"node_output" : false,
"skin_output" : false,
"plane_output" : [],
"nodal_results" : ["DISPLACEMENT","VELOCITY","ACCELERATION","REACTION","LINE_LOAD"],
"gauss_point_results" : []
},
"point_data_configuration" : []
}
}
},{
"python_module": "gid_output_process",
"kratos_module": "KratosMultiphysics",
"process_name": "GiDOutputProcess",
"Parameters": {
"model_part_name": "FluidModelPart.FluidParts_Fluid",
"output_name": "gordnier_membrane_fluid",
"postprocess_parameters": {
"result_file_configuration": {
"gidpost_flags": {
"GiDPostMode": "GiD_PostBinary",
"WriteDeformedMeshFlag": "WriteDeformed",
"WriteConditionsFlag": "WriteConditions",
"MultiFileFlag": "SingleFile"
},
"file_label": "time",
"output_control_type": "step",
"output_interval" : 1,
"body_output": true,
"node_output": false,
"skin_output": false,
"plane_output": [],
"nodal_results": ["VELOCITY","PRESSURE","MESH_VELOCITY"],
"nodal_nonhistorical_results": [],
"elemental_conditional_flags_results": [],
"gauss_point_results": []
},
"point_data_configuration": []
}
}
}]
}
}
Loading
Loading