Skip to content

Commit

Permalink
Added different meshes for cantilever2D
Browse files Browse the repository at this point in the history
  • Loading branch information
iBatistic committed Jul 11, 2024
1 parent fae3fdc commit 1f1c1aa
Show file tree
Hide file tree
Showing 13 changed files with 199 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# Create mesh
gmsh -3 -format msh2 cantilever.geo
gmshToFoam cantilever.msh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Mesh spacing
dx = 0.999;
//dx = 0.4;
//dx = 0.25;
//dx = 0.166;

// Beam length
L = 50;

// Beam thickness
t = 2;

// Depth (out of plane)
d = 1;

// Points
Point(1) = {0, -t/2, 0, dx};
Point(2) = {L, -t/2, 0, dx};
Point(3) = {L, t/2, 0, dx};
Point(4) = {0, t/2, 0, dx};

// Lines
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};

// Surface
Line Loop(6) = {4, 1, 2, 3};
Plane Surface(6) = {6};

// Force mapped meshing (triangles)
Transfinite Surface {6};
// Uncomment this for unstructured mesh
//Mesh.Algorithm = 6;

// Optional: combine triangles into quadrilaterals
//Recombine Surface {6};

// Create volume by extrusion
Physical Volume("internal") = {1};
Extrude {0, 0, d} {
Surface{6};
Layers{1};
Recombine;
}

// Boundary patches
Physical Surface("front") = {28};
Physical Surface("back") = {6};
Physical Surface("top") = {27};
Physical Surface("left") = {15};
Physical Surface("bottom") = {19};
Physical Surface("right") = {23};
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
_____ _____ _____ _____ _____ _____ | High-order Python FOAM
| | |___| _ |_ _| __| | _ | | | Python Version: 3.10
| | . | __| | | __| | | | | | | | Code Version: 0.0
|__|__|___|__| |_ |__| |_____|__|__|_|_|_| | License: GPLv3
|___|
*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


application banana;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 1;

deltaT 1;

writeControl timeStep;

writeInterval 1;

cycleWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;


// ************************************************************************* //
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
_____ _____ _____ _____ _____ _____ | High-order Python FOAM
| | |___| _ |_ _| __| | _ | | | Python Version: 3.10
| | . | __| | | __| | | | | | | | Code Version: 0.0
|__|__|___|__| |_ |__| |_____|__|__|_|_|_| | License: GPLv3
|___|
*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
/*--------------------------------*- C++ -*----------------------------------*\
| solids4foam: solid mechanics and fluid-solid interaction simulations |
| Version: v2.0 |
| Web: https://solids4foam.github.io |
| Disclaimer: This offering is not approved or endorsed by OpenCFD Limited, |
| producer and distributor of the OpenFOAM software via |
| www.openfoam.com, and owner of the OPENFOAM® and OpenCFD® |
| trade marks. |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

d2dt2Schemes
{
default none;
}

ddtSchemes
{
default none;
}

gradSchemes
{
default none;
}

divSchemes
{
default none;
}

laplacianSchemes
{
default none;
}

snGradSchemes
{
default none;
}

interpolationSchemes
{
default none;
}

// ************************************************************************* //

// ************************************************************************* //
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
_____ _____ _____ _____ _____ _____ | High-order Python FOAM
| | |___| _ |_ _| __| | _ | | | Python Version: 3.10
| | . | __| | | __| | | | | | | | Code Version: 0.0
|__|__|___|__| |_ |__| |_____|__|__|_|_|_| | License: GPLv3
|___|
*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


// ************************************************************************* //
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 1f1c1aa

Please sign in to comment.