Technical documentation for ICOFSI

  • Published on
    10-Apr-2015

  • View
    400

  • Download
    3

Embed Size (px)

DESCRIPTION

Installation procedure and input for ICOFSI used in thesis is elaborated. For access of the code, see contact in the document.

Transcript

Technical Documentation: ICOFSI version 0.9January 6, 2011

1

Contents1 The Purpose 2 Preliminary remark 3 Overview of the installation 4 Installation of Distributions 4.1 OpenFOAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 DEAL.II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 ICOFSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 The 5.1 5.2 5.3 Mesh OpenFOAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . DEAL.II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Boundary specication . . . . . . . . . . . . . . . . . . . . . . 3 3 3 3 3 4 4 5 5 5 5 5 5 5 6 6 6 7 7 7

6 The Input to ICOFSI 6.1 OpenFOAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 DEAL.II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Putting all together 7.1 General . . . . . . . 7.2 Flow chart . . . . . . 7.3 Setting the damping 7.4 Setting the threshold 8 Contact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2

1

The Purpose

A description of the installation and the input to the C++ package ICOFSI.

2

Preliminary remark

The diploma work contains further technical details of the implementation [1]. The reader should regard this document as a complement to section 3.1 in this thesis. At present, the source code is provided by the author of the project through email. Note: The reader of this document is assumed to have knowledge of DEAL.II and OpenFOAM.

3

Overview of the installation

The code ICOFSI is written in the context of OpenFOAM using namespace technique to encapsulate DEAL.II, Download the distributions from www.dealii.com and www.openfoam.com. Install each distribution separately by following instructions [8, 9]. verify the correctness of distribution separately by execute tutorials. unpack ICOFSI open Make/le and Make/options and make necessary changes. verify ICOFSI by apply executable on reference case Note:Follow the README, but if binaries is used from OpenFOAM, ensure that alla common libraries and DEAL.II is compiled with the compiler provided in that distribution.

4

Installation of Distributions

Install the latest version of the packages. Read the README les. Verify the distribution by running tutorials and control that all third party programs are not conicting the distributions. Important: The compiler must be the same for both packages.

4.1

OpenFOAM

If older distributions than OpenFOAM 1.6 is used for OpenFOAM, some modication of the code is necessary since the option ags for running OpenFOAM case have been modied which aect the path variables used in the

3

load and write routines such as in dealiiGrid and DynamicElastic. See Appendix, [Older distribution than OpenF OAM 1.6]. The OpenFOAM package is downloaded from http://www.openfoam.com/. For most linux platforms the following command is often sucient, from the root of the distribution catalogue, wmake all Recommendation: Download the binaries, see for further detailed instructions [9].

4.2

DEAL.II

The deal.II package is downloaded from http://www.dealii.com [8]. For most linux platforms the following is sucient, from the root of the distribution catalogue, ./configure make all Note: If binaries used for OpenFOAM, the provided compiler must be used by ./congure options.

4.3

ICOFSI

ICOFSI is written in the OpenFOAM context. Place all code under a directory together with a M ake directory and compile by wmake gives an executable dened in Make/le. See Appendix [ICOF SI Installation] for a details. An overview of the key les, icofsi.C, the main code, icoDymFOAM as template. Contain the denition of the traction. DynamicElastic.H, the structured part solver, step-8 as template. IcoDymFOAN.H, the kernel of template for icofsi.C, the uid part solver. dealiiGrid.H, the mesh handler for structured grid. AutoMesh.H, the ALE step. InterGridMapping.H, the mapping between uid and structured mesh [ALE]. SetBoundaryIndicator.H, denes the boundary condition by proximity between uid and structure. The main code is icof si.C involves both OpenFOAM and DEAL.II context using namespace technique. 4

55.1

The MeshOpenFOAM

The boundaries to be specied is called patches in OpenFOAM, see Appendix [constant/couplingP arameters]. The procedure in generating uid mesh for OpenFOAM is straightforward, there is several conversion routines that is available [2]. It is recommended that a quadrilateral mesh is applied on the contact surface to the structure. The there is only one patch for the xed surface.

5.2

DEAL.II

For structured grid, the DEAL.II oers several options but the version 0.9 code is restricted to .msh format [7]. For more advanced mesh generator than primitives see Appendix [Gmesh]. The class dealiiGrid handle the DEAL.II I/O for the structure regarding the loading/writing mesh.

5.3

Boundary specication

There is a routine that automatic matches couplings surfaces, the setBoundaryIndicator.H, which project each uid face point at couplings surface onto each structure face element and if within a threshold to the cell surface it is marked Neumann [movable] and Dirichlet otherwise [xed]. This require however that the uid mesh is to be ner than the structure initial before renement is applied, which calls for the reason using this parameter cycle/renement. Note: threshold for surface normal alignment and the distance can be required to be changed for the purpose of correct mapping.

66.1

The Input to ICOFSIOpenFOAM

The input for the uid solver requires specication of velocity eld U , pressure eld p and few other parameters. The specication can be consulted by OpenFOAM guides with example input les given in Appendix [0/U ,0/p,0/pointDisplacement ...] as support. One important aspect is the determination of the driven force of the uid, namely, pressure or velocity driven. The eects are chosen patch [=boundary condition for OpenFOAM].

6.2

DEAL.II

The input for the structured solver is specied by input le < name >.prgm, the < name > is specied in Appendix [constant/couplingP arameters], placed under OpenFOAM syntax case structure, see Appendix [Case]. The

5

keywords in this le is specied by dene the sub category and then parameter name, see Appendix [T he keywords f or dealiiP arameterHandler]. The subcategory have the syntax subsection < name > with end marker < end >, the parameter is dened by syntax set < name of parameter > < value >. As an example, subsection Dynamical Constants set The Alpha Damping Coefficient set The Beta Damping Coefficient end = 0.0 = 0.0

Note: the input is case sensitive. See Appendix [dealii/marker0,dealii/object0.prgm] for example les.

77.1

Putting all togetherGeneral

The project is executed in same way as icoDymF oam, a tutorial in OpenFOAM. The time step and write interval is set by system/controlDict [aect both packages]. The mesh for structure is placed in deal.ii/constant while the uid follow the OpenFOAM standard, in this example by 0 catalogue. The restart vectors [u restart, v restart]in output deal.ii/ouput match the latest catalogue for OpenFOAM.

7.2

Flow chart

Break down the procedure into the following steps, Install and verify each package using icoDymFOAM and step-8 tutorials. Create Case [See Appendix] Create Mesh [Section 5] Run the Case using icoDymF oam solver to stationary uid state [2] Evaluate the mean frontal pressure on the structure from the input from previous step Run the structure solver DynamicElastic with mean frontal pressure specied from previous step. Run ICOFSI with stationary ow and settings for stable structure.

6

7.3

Setting the damping

Damping is vital to remove the initial energy by holding structure to xed position, depending on the Case, the necessity for restart and use new damping can be optional choice while reducing the computational eort. Regarding the specify the mean pressure for deal.ii, either one set this through using OpenFOAM or see Appendix [Testing the structure]

7.4

Setting the threshold

An important task for partitioned solvers is the setting of thresholds, there is a trial and error in choosing parameters and in some cases no such is feasible. See diploma work for further details [1]. Improper settings often leads to numerical instability manifested as Floating point exception, divergence, drifting.

8

Contact

If you experience some problem during installation or have any comments upon the code, please contact me at johan lorentzon@hotmail.com

7

References[1] Fluid-Structure Interaction (FSI) case study of a cantilever using OpenFOAM and DEAL.II with application to VIV, ISRN LUTMDN/TMHP09/5186SE. [2] http://www.openfoam.com/docs/user. [3] Which strategy to move the mesh in the. Computational Fluid Dynamic code. OpenFOAM. Christophe Kassiotis. April 12, 2008. cole Normale Suprieure de Cachan. [4] http://www.dealii.org/developer/doxygen/tutorial/index.html . [5] https://help.ubuntu.com/community/OpenFOAM. [6] http://www.openfoam.com/download/source.php. [7] http://geuz.org/gmsh/. [8] http://www.dealii.org/developer/readme.html#installation. [9] http://www.openfoamwiki.net/index.php/Howto compile OpenFOAM.

8

Appendix: ICOFSI installationMake/lecyclicHashTable.C icofsi.C EXE = \$(FOAM_USER_APPBIN)/ICOFSI

Make/optionEXE_INC = \ \$(WM_DECOMP_INC) \ -I\$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I\$(LIB_SRC)/dynamicMesh/lnInclude \ -I\$(LIB_SRC)/meshTools/lnInclude \ -I\$(LIB_SRC)/cfdTools/incompressible \ -I\$(LIB_SRC)/finiteVolume/lnInclude \ -I\$(LIB_SRC)/dynamicMesh/motionSolver \ -I /home/\$(USER)/deal.II/contrib/boost/include \ -I /home/\$(USER)/deal.II/lac/include \ -I /home/\$(USER)/deal.II/base/include \ -I /home/\$(USER)/deal.II/deal.II/include EXE_LIBS = \ -ldynamicFvMesh \ -ldynamicMesh \ -lmeshTools \ -lfiniteVolume \ -ltriSurface \ /home/\$(USER)/deal.II/lib/libbase.g.so\ /home/\$(USER)/deal.II/lib/libdeal_II_3d.g.so\ /home/\$(USER)/deal.II/lib/liblac.g.so\ /home/\$(USER)/OpenFOAM/ThirdParty-1.6/gcc-4.3.3/platforms/\ "linux64"/lib64/libstdc++.so.6 Important: The last line refer to the libstdc++ library its related to current compilator and both distribution must use the same.

9

CaseA case contain all input les and output, each placed under specied directories, Case 0 U p pointDisplacement cellDisplacement cellMotionU ... constant couplingParameter transportProperties dynamicMeshDictionary ... deal.ii constant output .prgm marker system controlDict ... Note: The 0 Case represent the start time of the simulation, could be set arbitrary according to the input le controlDict.

10

Older distribution than OpenFOAM 1.6The current distribution 1.7 use a syntax for path description not compatible to older version 1.5 and earlier. The locations to change the path settings can be found, dealiiGrid.H: void { Grid::set_path(char* arglist[], const char name[]) filename.append(arglist[2]); filename.append("/deal.ii/constant/"); filename.append(name); } Dynamicelastic.H: void TopLevel::set_grid_path( char* arglist[], const char name[]) { filename.append(arglist[2]); path=filename; path.append("/"); printf("%s\n",path.c_str()); filename.append(name); } In both snippets it is the arglist that cause eventual problem running the code.

11

constant/couplingParameterThis input le denes the number of structural elements in the calculation [nObject], density of uid [Density], time for start of FSI [time], label of the boundaries[f luidSide,solidSide]. The vector after label is the SI unit specication. The f luidSide and solidSide denes the tag used for label the boundary for OpenFOAM respectively naming the input/output les for DEAL.II. To separate multiples of surfaces/structures The OpenFOAM mesh tags is dierentiated by a sux from 2 to nObjects + 1 [ 1 refers to the xed surface domain under one patch], while for DEAL.II the input/output les for structures are by sux enumerated from 0 till nObjects 1. An example, FoamFile { version format root case instance local class object

2.0; ascii; ""; ""; ""; ""; dictionary; couplingParameters;

} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // nObject nObject [0 0 0 0 0 0 0] 1.0; fluidSide SURFACE; solidSide object; Density Density [1 -3 0 0 0 0 0] 1000.0; startMeshMotion time [0 0 1 0 0 0 0] 7.065; // ************************************************************************* // SURFACE1 refers to the xed wall, SURFACE2 is the exible structured part specied in the tags for the respective surface if uid mesh to OpenFOAM. The object0.prgm is the input le to DEAL.II solver and marker0 the probes.

12

0/UThe patch [boundary condition] is f ixedV alue for xed wall and movingW allV elocity for the structural element that are allowed to interact. This is a velocity driven uid but the dirichlet set inlet of U. FoamFile { version format root case instance local class object } dimensions internalField boundaryField { INLET { type value } SURFACE1 { type value } SURFACE2 { type value } OUTLET { type } } [0 1 -1 0 0 0 0]; uniform (0 0 0);

2.0; ascii; ""; ""; ""; ""; volVectorField; U;

fixedValue; uniform (1.0 0 0);

fixedValue; uniform (0 0 0);

movingWallVelocity; uniform (0 0 0);

zeroGradient;

13

0/pThe patch [boundary condition] is f ixedV alue for xed wall and movingW allV elocity for the structural element that are allowed to interact. Note the pressure set to 0 at outlet and 0 gradient for the purpose of consistency with specication of a velocity driven uid. FoamFile { version format root case instance local class object } dimensions internalField boundaryField { SURFACE1 { type } SURFACE2 { type } OUTLET { type value } INLET { type } } [0 2 -2 0 0 0 0]; uniform 0;

2.0; ascii; ""; ""; ""; ""; volScalarField; p;

zeroGradient;

zeroGradient;

fixedValue; uniform 0;

zeroGradient;

14

constant/dynamicMeshDictThis section specify what kind of solver to be used to solve the laplacian that denes the deformation in the ALE step. For further details, see [3]. Related input les are cellDisplacement, pointdisplacement,cellmotionU, FoamFile { version format root case instance local class object } twoDMotion no; dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs ("libfvMotionSolvers.so"); solver displacementLaplacian; diffusivity quadratic inverseDistance 1(SURFACE2); ( );

2.0; ascii; ""; ""; ""; ""; dictionary; motionProperties;

15

0/cellMotionUFoamFile { version format root case instance local class object } dimensions internalField boundaryField { INLET { type value } SURFACE1 { type value } SURFACE2 { type value } OUTLET { type } } [0 1 -1 0 0 0 0]; uniform (0 0 0);

2.0; ascii; ""; ""; ""; ""; volVectorField; motionU;

fixedValue; uniform (0 0 0);

fixedVa...

Recommended

View more >