Version |
Date |
Description |
|---|---|---|
0 |
2019-29-01 |
Wes Oil Damping |
In this documentation you can obtain basis for: - Code Saturne Moving Mesh. - Turbulence fluid modeling.
PY-A912 Wes Oil Damping¶
First steps: As a first approach we will be to model a 2D damper
Create Geometry¶
Run this geometry in Salome
-*- coding: utf-8 -*-
###
### This file is generated automatically by SALOME v8.3.0 with dump python functionality
###
import sys
import salome
salome.salome_init()
theStudy = salome.myStudy
import salome_notebook
notebook = salome_notebook.NoteBook(theStudy)
sys.path.insert( 0, r'/home/hernando/Escritorio/Oil_damper/2D_1')
###
### GEOM component
###
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
geompy = geomBuilder.New(theStudy)
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
O_1 = geompy.MakeVertex(0, 0, 0)
OX_1 = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY_1 = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ_1 = geompy.MakeVectorDXDYDZ(0, 0, 1)
geomObj_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
Circle_1 = geompy.MakeCircle(None, None, 1.05)
Face_1 = geompy.MakeFaceWires([Circle_1], 1)
Circle_2 = geompy.MakeCircle(None, None, 0.75)
Face_2 = geompy.MakeFaceWires([Circle_2], 1)
Cut_1 = geompy.MakeCutList(Face_1, [Face_2], True)
Circle_3 = geompy.MakeCircle(None, None, 0.9)
Face_3 = geompy.MakeFaceWires([Circle_3], 1)
Circle_4 = geompy.MakeCircle(None, None, 0.85)
Face_4 = geompy.MakeFaceWires([Circle_4], 1)
Cut_2 = geompy.MakeCutList(Face_3, [Face_4], True)
geomObj_2 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
sk = geompy.Sketcher2D()
sk.addPoint(0.0000000, 0.0000000)
sk.addSegmentAbsolute(0.1000000, -1.5000000)
sk.addSegmentAbsolute(-0.1000000, -1.5000000)
sk.addSegmentAbsolute(0.0000000, 0.0000000)
Sketch_1 = sk.wire(Cut_1)
Face_5 = geompy.MakeFaceWires([Sketch_1], 1)
Cut_3 = geompy.MakeCutList(Cut_2, [Face_5], True)
Cut_4 = geompy.MakeCutList(Cut_1, [Cut_3], True)
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["VERTEX"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["VERTEX"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["VERTEX"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["VERTEX"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["VERTEX"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["VERTEX"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["VERTEX"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["VERTEX"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Cut_4, geompy.ShapeType["FACE"])
tower = geompy.CreateGroup(Cut_4, geompy.ShapeType["EDGE"])
geompy.UnionIDs(tower, [3])
inner = geompy.CreateGroup(Cut_4, geompy.ShapeType["EDGE"])
geompy.UnionIDs(inner, [6])
mass = geompy.CreateGroup(Cut_4, geompy.ShapeType["EDGE"])
geompy.UnionIDs(mass, [12, 9, 20, 18, 16, 14])
body = geompy.CreateGroup(Cut_4, geompy.ShapeType["FACE"])
geompy.UnionIDs(body, [1])
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( O_1, 'O' )
geompy.addToStudy( OX_1, 'OX' )
geompy.addToStudy( OY_1, 'OY' )
geompy.addToStudy( OZ_1, 'OZ' )
geompy.addToStudy( Circle_1, 'Circle_1' )
geompy.addToStudy( Face_1, 'Face_1' )
geompy.addToStudy( Circle_2, 'Circle_2' )
geompy.addToStudy( Face_2, 'Face_2' )
geompy.addToStudy( Cut_1, 'Cut_1' )
geompy.addToStudy( Circle_3, 'Circle_3' )
geompy.addToStudy( Face_3, 'Face_3' )
geompy.addToStudy( Circle_4, 'Circle_4' )
geompy.addToStudy( Face_4, 'Face_4' )
geompy.addToStudy( Cut_2, 'Cut_2' )
geompy.addToStudy( Sketch_1, 'Sketch_1' )
geompy.addToStudy( Face_5, 'Face_5' )
geompy.addToStudy( Cut_3, 'Cut_3' )
geompy.addToStudy( Cut_4, 'Cut_4' )
geompy.addToStudyInFather( Cut_4, tower, 'tower' )
geompy.addToStudyInFather( Cut_4, inner, 'inner' )
geompy.addToStudyInFather( Cut_4, mass, 'mass' )
geompy.addToStudyInFather( Cut_4, body, 'body' )
###
### SMESH component
###
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(theStudy)
Damper = smesh.Mesh(Cut_4)
NETGEN_2D_1 = Damper.Triangle(algo=smeshBuilder.NETGEN_1D2D)
NETGEN_Parameters_2D = NETGEN_2D_1.Parameters()
NETGEN_Parameters_2D.SetMaxSize( 0.01 )
NETGEN_Parameters_2D.SetSecondOrder( 0 )
NETGEN_Parameters_2D.SetOptimize( 1 )
NETGEN_Parameters_2D.SetFineness( 3 )
NETGEN_Parameters_2D.SetMinSize( 0.005 )
NETGEN_Parameters_2D.SetUseSurfaceCurvature( 1 )
NETGEN_Parameters_2D.SetFuseEdges( 1 )
NETGEN_Parameters_2D.SetQuadAllowed( 0 )
ViscousLayers2D_0_01 = NETGEN_2D_1.ViscousLayers2D(0.01,4,3)
isDone = Damper.Compute()
tower_1 = Damper.GroupOnGeom(tower,'tower',SMESH.EDGE)
inner_1 = Damper.GroupOnGeom(inner,'inner',SMESH.EDGE)
mass_1 = Damper.GroupOnGeom(mass,'mass',SMESH.EDGE)
body_1 = Damper.GroupOnGeom(body,'body',SMESH.FACE)
[ tower_extruded, inner_extruded, mass_extruded, body_extruded, tower_top, inner_top, mass_top, body_top ] = Damper.ExtrusionSweepObjects( [ Damper ], [], [ Damper ], [ 0, 0, 0.05 ], 1, 1 )
## Set names of Mesh objects
smesh.SetName(NETGEN_2D_1.GetAlgorithm(), 'NETGEN_2D_1')
smesh.SetName(ViscousLayers2D_0_01, 'ViscousLayers2D=0.01,4,1,[],True')
smesh.SetName(NETGEN_Parameters_2D, 'NETGEN_Parameters_2D')
smesh.SetName(body_1, 'body')
smesh.SetName(tower_extruded, 'tower_extruded')
smesh.SetName(inner_extruded, 'inner_extruded')
smesh.SetName(mass_extruded, 'mass_extruded')
smesh.SetName(body_top, 'body_top')
smesh.SetName(Damper.GetMesh(), 'Damper')
smesh.SetName(body_extruded, 'body_extruded')
smesh.SetName(tower_1, 'tower')
smesh.SetName(mass_1, 'mass')
smesh.SetName(inner_1, 'inner')
smesh.SetName(inner_top, 'inner_top')
smesh.SetName(tower_top, 'tower_top')
smesh.SetName(mass_top, 'mass_top')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(True)
Run Saturne¶
The geometry is exported as a med file and put in into the saturne case MESH folder
<Code_Saturne_GUI case="DAMP" solver_version="4.3;5.0" study="2d_DAMP" version="2.0"><additional_scalars/><analysis_control><output><listing_printing_frequency>10</listing_printing_frequency><mesh id="-1" label="Fluid domain" type="cells"><all_variables status="on"/><location>all[]</location><writer id="-1"/></mesh><mesh id="-2" label="Boundary" type="boundary_faces"><all_variables status="on"/><location>all[]</location><writer id="-1"/></mesh><probe name="1" status="on"><probe_x>0</probe_x><probe_y>0.755</probe_y><probe_z>0.025</probe_z></probe><probe name="2" status="on"><probe_x>0</probe_x><probe_y>0.955</probe_y><probe_z>0.025</probe_z></probe><probe name="3" status="on"><probe_x>0</probe_x><probe_y>1.045</probe_y><probe_z>0.025</probe_z></probe><probe name="4" status="on"><probe_x>-0.755</probe_x><probe_y>0</probe_y><probe_z>0.025</probe_z></probe><probe name="5" status="on"><probe_x>-0.955</probe_x><probe_y>0</probe_y><probe_z>0.025</probe_z></probe><probe name="6" status="on"><probe_x>-1.045</probe_x><probe_y>0</probe_y><probe_z>0.025</probe_z></probe><probe_format choice="DAT"/><probe_recording_frequency>1</probe_recording_frequency><writer id="-1" label="results"><directory name="postprocessing"/><format name="ensight" options="binary"/><frequency period="time_step">10</frequency><output_at_end status="off"/><time_dependency choice="transient_coordinates"/></writer></output><profiles/><steady_management status="off"/><time_averages/><time_parameters><iterations>15000</iterations><property label="CourantNb" name="courant_number"/><property label="FourierNb" name="fourier_number"/><time_passing>0</time_passing><time_step_ref>0.1</time_step_ref><zero_time_step status="off"/></time_parameters></analysis_control><boundary_conditions><boundary label="BC_1" name="1" nature="wall">inner</boundary><boundary label="BC_2" name="2" nature="wall">mass</boundary><boundary label="BC_3" name="3" nature="wall">tower</boundary><boundary label="BC_4" name="4" nature="wall">wall_1</boundary><boundary label="BC_5" name="5" nature="wall">wall_2</boundary><variable/><wall field_id="none" label="BC_1"><ale choice="fixed_boundary"/><velocity_pressure choice="off"/></wall><wall field_id="none" label="BC_2"><ale choice="internal_coupling"><damping_matrix><formula>c11=0;
c22=0;
c33=0;
c12=0;
c13=0;
c23=0;
c21=0;
c31=0;
c32=0;</formula></damping_matrix><equilibrium_displacement><X>0</X><Y>0</Y><Z>0</Z></equilibrium_displacement><fluid_force_matrix><formula>fx = 0;
fy = fluid_fy;
fz = 0;</formula></fluid_force_matrix><formula/><initial_displacement><X>0</X><Y>0</Y><Z>0</Z></initial_displacement><initial_velocity><X>0</X><Y>0</Y><Z>0</Z></initial_velocity><mass_matrix><formula>m11=1;
m22=3;
m33=1;
m12=0;
m13=0;
m23=0;
m21=0;
m31=0;
m32=0;</formula></mass_matrix><stiffness_matrix><formula>k11=1;
k22=2;
k33=1;
k12=0;
k13=0;
k23=0;
k21=0;
k31=0;
k32=0;</formula></stiffness_matrix></ale><velocity_pressure choice="off"/></wall><wall field_id="none" label="BC_4"><ale choice="sliding_boundary"/><velocity_pressure choice="off"/></wall><wall field_id="none" label="BC_5"><ale choice="sliding_boundary"/><velocity_pressure choice="off"/></wall><wall field_id="none" label="BC_3"><ale choice="internal_coupling"><DDLX choice="on"/><DDLY choice="off"/><DDLZ choice="on"/><damping_matrix><formula>c11=0;
c22=0;
c33=0;
c12=0;
c13=0;
c23=0;
c21=0;
c31=0;
c32=0;</formula></damping_matrix><equilibrium_displacement><X>0</X><Y>0</Y><Z>0</Z></equilibrium_displacement><fluid_force_matrix><formula>fx = 0;
fy = 2 * sin(fluid_fy);
fz = 0;</formula></fluid_force_matrix><initial_displacement><X>0</X><Y>0</Y><Z>0</Z></initial_displacement><initial_velocity><X>0</X><Y>0</Y><Z>0</Z></initial_velocity><mass_matrix><formula>m11=5;
m22=5;
m33=5;
m12=0;
m13=0;
m23=0;
m21=0;
m31=0;
m32=0;</formula></mass_matrix><stiffness_matrix><formula>k11=1;
k22=2;
k33=1;
k12=0;
k13=0;
k23=0;
k21=0;
k31=0;
k32=0;</formula></stiffness_matrix></ale><velocity_pressure choice="off"/></wall></boundary_conditions><calculation_management><block_io/><debug>debugger</debug><logging main="listing" parallel="listing"/><partitioning/><run_type>standard</run_type><start_restart><frozen_field status="off"/></start_restart></calculation_management><lagrangian model="off"/><numerical_parameters><gradient_reconstruction choice="0"/><gradient_transposed status="on"/><hydrostatic_pressure status="off"/><pressure_relaxation>1</pressure_relaxation><velocity_pressure_algo choice="simplec"><piso_sweep_number>1</piso_sweep_number></velocity_pressure_algo><velocity_pressure_coupling status="off"/><wall_pressure_extrapolation>0</wall_pressure_extrapolation></numerical_parameters><physical_properties><fluid_properties><material choice="user_material"/><method choice="user_properties"/><property choice="constant" label="Density" name="density"><initial_value>900</initial_value><listing_printing status="off"/><postprocessing_recording status="off"/></property><property choice="constant" label="LamVisc" name="molecular_viscosity"><initial_value>0.31</initial_value><listing_printing status="off"/><postprocessing_recording status="off"/></property><property choice="constant" label="SpecHeat" name="specific_heat"><initial_value>1017.24</initial_value><listing_printing status="off"/><postprocessing_recording status="off"/></property><property choice="constant" label="ThermalCond" name="thermal_conductivity"><initial_value>0.02495</initial_value><listing_printing status="off"/><postprocessing_recording status="off"/></property><reference choice="user_material"/></fluid_properties><gravity><gravity_x>0</gravity_x><gravity_y>0</gravity_y><gravity_z>0</gravity_z></gravity><notebook/><omega><omega_x>0</omega_x><omega_y>0</omega_y><omega_z>0</omega_z></omega></physical_properties><solution_domain><extrusion/><faces_cutting status="off"/><joining/><mesh_smoothing status="off"/><meshes_list><mesh name="Damper_30.med"/></meshes_list><periodicity/><thin_walls/><volumic_conditions><zone groundwater_law="off" heads_losses="off" id="1" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" porosity="off" scalar_source_term="off" thermal_source_term="off">all[]</zone></volumic_conditions></solution_domain><thermophysical_models><ale_method status="on"><displacement_prediction_alpha>0.5</displacement_prediction_alpha><displacement_prediction_beta>0</displacement_prediction_beta><external_coupling_post_synchronization status="on"/><fluid_initialization_sub_iterations>5000</fluid_initialization_sub_iterations><formula>mesh_viscosity_1 = 1;</formula><implicitation_precision>1e-08</implicitation_precision><max_iterations_implicitation>20</max_iterations_implicitation><mesh_viscosity type="isotrop"/><monitor_point_synchronisation status="off"/><property label="mesh_vi1" name="mesh_viscosity_1"/><stress_prediction_alpha>2</stress_prediction_alpha><variable dimension="3" label="Mesh Velocity" name="mesh_velocity"/></ale_method><atmospheric_flows model="off"/><compressible_model model="off"/><conjugate_heat_transfer><external_coupling/></conjugate_heat_transfer><gas_combustion model="off" option="off"/><groundwater_model model="off"/><joule_effect model="off"/><radiative_transfer model="off"/><reference_values/><solid_fuels model="off"/><thermal_scalar model="off"/><turbulence model="off"><initialization choice="reference_value" zone_id="1"/></turbulence><velocity_pressure><initialization><formula zone_id="1">velocity[0] = 0.;
velocity[1] = -0.8;
velocity[2] = 0.;</formula></initialization><property label="Stress" name="stress" support="boundary"/><property label="Stress, normal" name="stress_normal" support="boundary"><postprocessing_recording status="off"/></property><property label="Stress, tangential" name="stress_tangential" support="boundary"><postprocessing_recording status="off"/></property><property label="total_pressure" name="total_pressure"/><property label="Yplus" name="yplus" support="boundary"/><variable label="Pressure" name="pressure"><rhs_reconstruction>2</rhs_reconstruction></variable><variable dimension="3" label="Velocity" name="velocity"><blending_factor>1</blending_factor><rhs_reconstruction>1</rhs_reconstruction></variable></velocity_pressure></thermophysical_models></Code_Saturne_GUI>
Tests¶
References¶
1: An opensource solver for wave-induced FSI problems
2: A general OpenFOAM adapter for the coupling library preCICE
3: Couple OpenFOAM with any other solver using preCICE
4: SIMULATION OF F LUID -S TRUCTURAL I NTERACTION USING O PEN FOAM
5: Implementation of 6-DoF on axialTurbine tutorial case
6: A FSI tutorial on the axialTurbine
7: Fluid-Structure Simulations with OpenFOAM for Aircraft Designs