Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Louis.Denis/multiphysics-0471
  • K.Maltez/multiphysics-0471
2 results
Show changes
Commits on Source (5)
# Multiphysics 0471 # Multiphysics 0471
Multiphysics Integrated Computational Project Multiphysics Integrated Computational Project
\ No newline at end of file
FOR WINDOWS:
To build the FEM solver:
- go to the srcs/FEM folder (cd srcs/FEM)
- create a build folder (mkdir build)
- go to this build folder (cd build)
- cmake ..
- make
To execute the FEM solver:
- stay in the build folder and solver.exe ..\my_geo.geo
- for simple tension configuration: solver.exe ..\simple_tension.geo
- for second validation configuration: solver.exe ..\uniform_charge.geo
\ No newline at end of file
//THIS CODE DEFINES THE GEOMETRY OF A CLAMPED BAR WITH TWO TYPES OF MESHES, TRIANGULAR AND QUADRANGULAR
Lx = 5;
Ly = 2;
nx = 50;
ny = 20;
Point(1) = {0, 0, 0, 0.1};
Point(2) = {Lx, 0, 0, 0.2};
Point(3) = {Lx, Ly, 0, 0.2};
Point(4) = {0, Ly, 0, 0.1};
Point(5) = {Lx/2, 0, 0, 0.15};
Point(6) = {Lx/2, Ly, 0, 0.15};
Line(1) = {1, 5};
Line(2) = {2, 5};
Line(3) = {3, 2};
Line(4) = {6, 3};
Line(5) = {6, 4};
Line(6) = {4, 1};
Line(7) = {5, 6};
Curve Loop(1) = {1, 7, 5, 6};
Curve Loop(2) = {7, 4, 3, 2};
Plane Surface(1) = {1};
Plane Surface(2) = {2};
//Transfinite Curve {1, 5} = nx+1 Using Progression 1;
//Transfinite Curve {7, 6} = ny+1 Using Progression 1;
//Transfinite Curve {2, 4} = nx+1 Using Progression 1;
//Transfinite Curve {3, 7} = ny+1 Using Progression 1;
//Transfinite Surface {1};
//Transfinite Surface {2};
Mesh.ElementOrder = 2;
Recombine Surface {1}; // quads instead of triangles
Physical Curve("left_edge", 5) = {6};
Physical Surface("domain", 6) = {1, 2}; // the trick is to include both plane surfaces in one single domain
Physical Curve("top_edge", 7) = {4, 5};
Physical Curve("right_edge", 8) = {3};
Physical Point("fixed_node", 9) = {1};
// additional parameters given to the solver
SetNumber("Boundary Conditions/left_edge/ux", 0.); // ALWAYS NEED TO IMPOSE BOTH ux AND uy ON A GIVEN EDGE !! (pas très réaliste, faut y réfléchir)
//SetNumber("Boundary Conditions/left_edge/uy", 0.);
SetNumber("Materials/domain/Young", 210e3);
SetNumber("Materials/domain/Poisson", 0.3);
SetNumber("Materials/domain/rho",7800); //volumic mass of acier
SetNumber("Boundary Conditions/top_edge/tx", 0.); // ALWAYS NEED TO IMPOSE BOTH tx AND ty ON A GIVEN EDGE (realiste, OK) !
SetNumber("Boundary Conditions/top_edge/ty", 0.); //set to some other value for vertical deflection
SetNumber("Boundary Conditions/right_edge/tx", 21e3); //for simple tension conditions
SetNumber("Boundary Conditions/right_edge/ty", 0.);
SetNumber("Volumic Forces/domain/bx",0.);
SetNumber("Volumic Forces/domain/by",0.); //set to -9.81 for gravity
SetNumber("Boundary Conditions/fixed_node/uy",2.);
This diff is collapsed.
Lx = 5; Lx = 5;
Ly = 2; Ly = 2;
nx = 50; nx = 50; // prend beaucoup de temps àpd de 200x40
ny = 20; ny = 20;
Point(1) = {0, 0, 0, 1.0}; Point(1) = {0, 0, 0, 0.1};
Point(2) = {Lx, 0, 0, 1.0}; Point(2) = {Lx, 0, 0, 0.1};
Point(3) = {Lx, Ly, 0, 1.0}; Point(3) = {Lx, Ly, 0, 0.1};
Point(4) = {0, Ly, 0, 1.0}; Point(4) = {0, Ly, 0, 0.2};
Line(1) = {1, 2}; Line(1) = {1, 2};
Line(2) = {2, 3}; Line(2) = {2, 3};
Line(3) = {3, 4}; Line(3) = {3, 4};
...@@ -14,19 +14,22 @@ Line(4) = {4, 1}; ...@@ -14,19 +14,22 @@ Line(4) = {4, 1};
Curve Loop(1) = {4, 1, 2, 3}; Curve Loop(1) = {4, 1, 2, 3};
Plane Surface(1) = {1}; Plane Surface(1) = {1};
Transfinite Curve {3, 1} = nx+1 Using Progression 1; Transfinite Curve {3, 1} = nx+1 Using Progression 1;
Transfinite Curve {4, 2} = ny+1 Using Progression 1; Transfinite Curve {2, 4} = ny+1 Using Progression 1;
Transfinite Surface {1}; Transfinite Surface {1};
Recombine Surface {1}; // quads instead of triangles Recombine Surface {1}; // quads instead of triangles
Physical Curve("left_edge", 5) = {4}; Mesh.ElementOrder = 1;
Physical Curve("left_edge", 5) = {4,5};
Physical Surface("domain", 6) = {1}; Physical Surface("domain", 6) = {1};
Physical Curve("top_edge", 7) = {3}; Physical Curve("top_edge", 7) = {3};
Physical Curve("right_edge", 8) = {2}; Physical Curve("right_edge", 8) = {2};
Physical Point("fixed_node", 9) = {1};
// additional parameters given to the solver // additional parameters given to the solver
SetNumber("Boundary Conditions/left_edge/ux", 0.); // HERE YOU DO NOT HAVE TO IMPOSE BOTH ux and uy simultaneously ! (permet aussi de simuler appuis à roulettes) SetNumber("Boundary Conditions/left_edge/ux", 0.); // HERE YOU DO NOT HAVE TO IMPOSE BOTH ux and uy simultaneously ! (permet aussi de simuler appuis à roulettes)
//SetNumber("Boundary Conditions/left_edge/uy", 0.); //SetNumber("Boundary Conditions/left_edge/uy", 2.);
SetNumber("Materials/domain/Young", 210e3); SetNumber("Materials/domain/Young", 210e3);
SetNumber("Materials/domain/Poisson", 0.3); SetNumber("Materials/domain/Poisson", 0.3);
SetNumber("Materials/domain/rho",7800); //volumic mass of acier SetNumber("Materials/domain/rho",7800); //volumic mass of acier
...@@ -36,3 +39,4 @@ SetNumber("Boundary Conditions/right_edge/tx", 21e3); // for simple tension cond ...@@ -36,3 +39,4 @@ SetNumber("Boundary Conditions/right_edge/tx", 21e3); // for simple tension cond
SetNumber("Boundary Conditions/right_edge/ty", 0.); SetNumber("Boundary Conditions/right_edge/ty", 0.);
SetNumber("Volumic Forces/domain/bx",0.); SetNumber("Volumic Forces/domain/bx",0.);
SetNumber("Volumic Forces/domain/by",0.); //set to -9.81 for gravity SetNumber("Volumic Forces/domain/by",0.); //set to -9.81 for gravity
SetNumber("Boundary Conditions/fixed_node/uy",2.);
Lx = 5;
Ly = 2;
nx = 50;
ny = 20;
Point(1) = {0, 0, 0, 1.0};
Point(2) = {Lx, 0, 0, 1.0};
Point(3) = {Lx, Ly, 0, 1.0};
Point(4) = {0, Ly, 0, 1.0};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Curve Loop(1) = {4, 1, 2, 3};
Plane Surface(1) = {1};
Transfinite Curve {3, 1} = nx+1 Using Progression 1;
Transfinite Curve {4, 2} = ny+1 Using Progression 1;
Transfinite Surface {1};
Recombine Surface {1}; // quads instead of triangles
Physical Curve("left_edge", 5) = {4};
Physical Surface("domain", 6) = {1};
Physical Curve("top_edge", 7) = {3};
Physical Curve("right_edge", 8) = {2};
Physical Point("fixed_node", 9) = {1};
Mesh.ElementOrder = 1;
// additional parameters given to the solver
SetNumber("Boundary Conditions/left_edge/ux", 0.); // HERE YOU DO NOT HAVE TO IMPOSE BOTH ux and uy simultaneously ! (permet aussi de simuler appuis à roulettes)
//SetNumber("Boundary Conditions/left_edge/uy", 0.);
SetNumber("Materials/domain/Young", 210e3);
SetNumber("Materials/domain/Poisson", 0.3);
SetNumber("Materials/domain/rho",7800); //volumic mass of acier
SetNumber("Boundary Conditions/top_edge/tx", 0.); // ALWAYS NEED TO IMPOSE BOTH tx AND ty ON A GIVEN EDGE (realiste, OK) !
SetNumber("Boundary Conditions/top_edge/ty", 0.); //set to some non-zero value to induce vertical deflection
SetNumber("Boundary Conditions/right_edge/tx", 21e3); // for simple tension conditions
SetNumber("Boundary Conditions/right_edge/ty", 0.);
SetNumber("Volumic Forces/domain/bx",0.);
SetNumber("Volumic Forces/domain/by",0.); //set to -9.81 for gravity
SetNumber("Boundary Conditions/fixed_node/uy",2.);
Lx = 10;
Ly = 1;
nx = 200;
ny = 20;
Point(1) = {0, 0, 0, 1.0};
Point(2) = {Lx, 0, 0, 1.0};
Point(3) = {Lx, Ly, 0, 1.0};
Point(4) = {0, Ly, 0, 1.0};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Curve Loop(1) = {4, 1, 2, 3};
Plane Surface(1) = {1};
Transfinite Curve {3, 1} = nx+1 Using Progression 1;
Transfinite Curve {4, 2} = ny+1 Using Progression 1;
Transfinite Surface {1};
Recombine Surface {1}; // quads instead of triangles
Physical Curve("left_edge", 5) = {4};
Physical Surface("domain", 6) = {1};
Physical Curve("top_edge", 7) = {3};
Physical Curve("right_edge", 8) = {2};
// additional parameters given to the solver
SetNumber("Boundary Conditions/left_edge/ux", 0.); // HERE YOU DO NOT HAVE TO IMPOSE BOTH ux and uy simultaneously ! (permet aussi de simuler appuis à roulettes)
SetNumber("Boundary Conditions/left_edge/uy", 0.);
SetNumber("Materials/domain/Young", 210e3);
SetNumber("Materials/domain/Poisson", 0.3);
SetNumber("Materials/domain/rho",7800); //volumic mass of acier
SetNumber("Boundary Conditions/top_edge/tx", 0.); // ALWAYS NEED TO IMPOSE BOTH tx AND ty ON A GIVEN EDGE (realiste, OK) !
SetNumber("Boundary Conditions/top_edge/ty", -1); //set to some non-zero value to induce vertical deflection
SetNumber("Boundary Conditions/right_edge/tx", 0.); // for simple tension conditions
SetNumber("Boundary Conditions/right_edge/ty", 0.);
SetNumber("Volumic Forces/domain/bx",0.);
SetNumber("Volumic Forces/domain/by",0.); //set to -9.81 for gravity