Skip to content

Commit 27bb208

Browse files
new geometries new tests 3D
1 parent 81ff754 commit 27bb208

File tree

7 files changed

+306
-0
lines changed

7 files changed

+306
-0
lines changed

meshes/msh/boolean.geo

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*****************************************************************************
2+
3+
This file is a part of ArcaneFEM (finite element tool in Arcane)
4+
5+
-------------------------------------------------------------------
6+
7+
Author(s): Mohd Afeef Badri
8+
9+
Date : 27-02-2024
10+
11+
-------------------------------------------------------------------
12+
13+
This file is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; or without even the implied warranty
15+
of FITNESS FOR A PARTICULAR PURPOSE.
16+
17+
--------------------------------------------------------------------
18+
19+
This is a Gmsh .geo file which produces 3D boolean geometry. The file
20+
is a copy of Gmsh's tutorial on boolean only groups have been added
21+
here.
22+
23+
compile-run: gmsh -3 boolean.geo -format msh41
24+
25+
*******************************************************************************/
26+
27+
SetFactory("OpenCASCADE");
28+
29+
// from http://en.wikipedia.org/wiki/Constructive_solid_geometry
30+
31+
Mesh.Algorithm = 6;
32+
Mesh.MeshSizeMin = 0.4;
33+
Mesh.MeshSizeMax = 0.4;
34+
35+
R = DefineNumber[ 1.4 , Min 0.1, Max 2, Step 0.01,
36+
Name "Parameters/Box dimension" ];
37+
Rs = DefineNumber[ R*.7 , Min 0.1, Max 2, Step 0.01,
38+
Name "Parameters/Cylinder radius" ];
39+
Rt = DefineNumber[ R*1.25, Min 0.1, Max 2, Step 0.01,
40+
Name "Parameters/Sphere radius" ];
41+
42+
Box(1) = {-R,-R,-R, 2*R,2*R,2*R};
43+
44+
Sphere(2) = {0,0,0,Rt};
45+
46+
BooleanIntersection(3) = { Volume{1}; Delete; }{ Volume{2}; Delete; };
47+
48+
Cylinder(4) = {-2*R,0,0, 4*R,0,0, Rs};
49+
Cylinder(5) = {0,-2*R,0, 0,4*R,0, Rs};
50+
Cylinder(6) = {0,0,-2*R, 0,0,4*R, Rs};
51+
52+
BooleanUnion(7) = { Volume{4}; Delete; }{ Volume{5,6}; Delete; };
53+
BooleanDifference(8) = { Volume{3}; Delete; }{ Volume{7}; Delete; };
54+
55+
Physical Surface("left", 42) = {4};
56+
Physical Surface("right", 43) = {6};
57+
Physical Surface("top", 44) = {7};
58+
Physical Surface("bottom", 45) = {8};
59+
Physical Surface("front", 46) = {5};
60+
Physical Surface("back", 47) = {1};
61+
Physical Volume("vol", 48) = {8};

meshes/msh/boolean.msh

74.1 KB
Binary file not shown.

meshes/msh/pipe.geo

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*****************************************************************************
2+
3+
This file is a part of ArcaneFEM (finite element tool in Arcane)
4+
5+
-------------------------------------------------------------------
6+
7+
Author(s): Mohd Afeef Badri
8+
9+
Date : 27-02-2024
10+
11+
-------------------------------------------------------------------
12+
13+
This file is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; or without even the implied warranty
15+
of FITNESS FOR A PARTICULAR PURPOSE.
16+
17+
--------------------------------------------------------------------
18+
19+
This is a Gmsh .geo file which produces 3D boolean geometry. The file
20+
is a copy of Gmsh's tutorial on boolean only groups have been added
21+
here.
22+
23+
compile-run: gmsh -3 pipe.geo -format msh41
24+
25+
*******************************************************************************/
26+
27+
SetFactory("OpenCASCADE");
28+
29+
Mesh.MeshSizeMin = 0.1;
30+
Mesh.MeshSizeMax = 0.1;
31+
Geometry.NumSubEdges = 100; // nicer display of curve
32+
33+
nturns = DefineNumber[ 1, Min 0.1, Max 1, Step 0.01, Name "Parameters/Turn" ];
34+
npts = 20;
35+
r = 1;
36+
rd = 0.1;
37+
h = 1 * nturns;
38+
39+
For i In {0:npts-1}
40+
theta = i * 2*Pi*nturns/npts;
41+
Point(i + 1) = {r * Cos(theta), r * Sin(theta), i * h/npts};
42+
EndFor
43+
44+
Spline(1) = {1:npts};
45+
Wire(1) = {1};
46+
47+
Disk(1) = {1,0,0, rd};
48+
49+
Rectangle(2) = {1+2*rd,-rd,0, 2*rd,2*rd,rd/5};
50+
Rotate {{1, 0, 0}, {0, 0, 0}, Pi/2} { Surface{1,2}; }
51+
52+
Extrude { Surface{1,2}; } Using Wire {1}
53+
Delete{ Surface{1,2}; }
54+
55+
Physical Surface("leftSurfaceCircularPipe", 47) = {5};
56+
Physical Surface("rightSurfaceCircularPipe", 48) = {3};
57+
Physical Surface("leftSurfaceSquarePipe", 49) = {15};
58+
Physical Surface("rightSurfaceSquarePipe", 50) = {6};
59+
Physical Volume("SquarePipeVol", 51) = {1};
60+
Physical Volume("CylindricalPipeVol", 52) = {2};

meshes/msh/pipe.msh

198 KB
Binary file not shown.

modules/fourier/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ set(MESH_FILES
3535
plancher.quad4.msh
3636
square_-2pi_to_2pi.msh
3737
bar_dynamic_3D.msh
38+
pipe.msh
39+
boolean.msh
3840
)
3941
foreach(MESH_FILE IN LISTS MESH_FILES)
4042
file(COPY ${MSH_DIR}/${MESH_FILE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/meshes)
@@ -76,6 +78,8 @@ if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
7678
inputs/manufacture.solution.arc)
7779
add_test(NAME [Fourier]conduction_3D COMMAND Fourier
7880
inputs/conduction.3D.arc)
81+
add_test(NAME [Fourier]conduction_boolean_3D COMMAND Fourier
82+
inputs/conduction.boolean.3D.arc)
7983
add_test(NAME [Fourier]manufacture_solution_3D COMMAND Fourier
8084
-A,UsingDotNet=1
8185
-A,//meshes/mesh/filename=meshes/bar_dynamic_3D.msh
@@ -90,6 +94,8 @@ if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
9094
add_test(NAME [Fourier]manufacture_solution_2p COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ./Fourier
9195
-A,UsingDotNet=1
9296
inputs/manufacture.solution.arc)
97+
add_test(NAME [Fourier]conduction_heterogeneous_3D_2p COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ./Fourier
98+
inputs/conduction.pipe.3D.arc)
9399
add_test(NAME [Fourier]manufacture_solution_3D_2p COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ./Fourier
94100
-A,UsingDotNet=1
95101
-A,//meshes/mesh/filename=meshes/bar_dynamic_3D.msh
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Case configuration for a Fourier analysis simulation.
4+
This file includes settings for:
5+
- General simulation parameters
6+
- Mesh configuration details
7+
- Finite Element Method (FEM) configurations
8+
- Post-processing options
9+
-->
10+
<case codename="Fourier" xml:lang="en" codeversion="1.0">
11+
12+
<!--
13+
Arcane-specific settings:
14+
- title: Descriptive name for the simulation case.
15+
- timeloop: Specifies the time-stepping loop used in this Fourier simulation.
16+
-->
17+
<arcane>
18+
<title>Fouriers equation FEM code</title>
19+
<timeloop>FourierLoop</timeloop>
20+
</arcane>
21+
22+
<!--
23+
Mesh configuration:
24+
- filename: The path to the mesh file used in the simulation.
25+
-->
26+
<meshes>
27+
<mesh>
28+
<filename>meshes/boolean.msh</filename>
29+
</mesh>
30+
</meshes>
31+
32+
<!--
33+
FEM (Finite Element Method) settings:
34+
- lambda: Thermal conductivity or diffusivity coefficient.
35+
- qdot: Heat source term or volumetric heat generation.
36+
- result-file: File where simulation results will be saved.
37+
- boundary-conditions: Defines the boundary conditions for the simulation.
38+
- dirichlet: Fixed value boundary condition with penalty enforcement for specified surfaces.
39+
- neumann: Flux or gradient boundary condition for specified surfaces.
40+
-->
41+
<fem>
42+
<lambda>23.5</lambda>
43+
<qdot>1.123e-2</qdot>
44+
<mesh-type>TETRA4</mesh-type>
45+
<boundary-conditions>
46+
<dirichlet>
47+
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
48+
<surface>left</surface>
49+
<value>55.0</value>
50+
</dirichlet>
51+
<dirichlet>
52+
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
53+
<surface>right</surface>
54+
<value>12.0</value>
55+
</dirichlet>
56+
<dirichlet>
57+
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
58+
<surface>top</surface>
59+
<value>166.0</value>
60+
</dirichlet>
61+
<dirichlet>
62+
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
63+
<surface>bottom</surface>
64+
<value>32.0</value>
65+
</dirichlet>
66+
<neumann>
67+
<surface>front</surface>
68+
<value>56.0</value>
69+
</neumann>
70+
<neumann>
71+
<surface>back</surface>
72+
<value>3.67</value>
73+
</neumann>
74+
</boundary-conditions>
75+
</fem>
76+
77+
<!--
78+
Post-processing settings:
79+
- output-period: Defines how often (in simulation steps) the output is generated.
80+
- format: Specifies the post-processing format, here using VtkHdfV2.
81+
- output: Defines the variables to be included in the post-processing output.
82+
-->
83+
<arcane-post-processing>
84+
<output-period>1</output-period>
85+
<output>
86+
<variable>U</variable>
87+
</output>
88+
</arcane-post-processing>
89+
90+
</case>
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Case configuration for a Fourier analysis simulation.
4+
This file includes settings for:
5+
- General simulation parameters
6+
- Mesh configuration details
7+
- Finite Element Method (FEM) configurations
8+
- Post-processing options
9+
-->
10+
<case codename="Fourier" xml:lang="en" codeversion="1.0">
11+
12+
<!--
13+
Arcane-specific settings:
14+
- title: Descriptive name for the simulation case.
15+
- timeloop: Specifies the time-stepping loop used in this Fourier simulation.
16+
-->
17+
<arcane>
18+
<title>Fouriers equation FEM code</title>
19+
<timeloop>FourierLoop</timeloop>
20+
</arcane>
21+
22+
<!--
23+
Mesh configuration:
24+
- filename: The path to the mesh file used in the simulation.
25+
-->
26+
<meshes>
27+
<mesh>
28+
<filename>meshes/pipe.msh</filename>
29+
</mesh>
30+
</meshes>
31+
32+
<!--
33+
FEM (Finite Element Method) settings:
34+
- lambda: Thermal conductivity or diffusivity coefficient.
35+
- qdot: Heat source term or volumetric heat generation.
36+
- result-file: File where simulation results will be saved.
37+
- boundary-conditions: Defines the boundary conditions for the simulation.
38+
- dirichlet: Fixed value boundary condition with penalty enforcement for specified surfaces.
39+
- neumann: Flux or gradient boundary condition for specified surfaces.
40+
-->
41+
<fem>
42+
<qdot>6.3e-2</qdot>
43+
<mesh-type>TETRA4</mesh-type>
44+
<boundary-conditions>
45+
<dirichlet>
46+
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
47+
<surface>leftSurfaceCircularPipe</surface>
48+
<value>55.0</value>
49+
</dirichlet>
50+
<dirichlet>
51+
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
52+
<surface>rightSurfaceCircularPipe</surface>
53+
<value>12.0</value>
54+
</dirichlet>
55+
<dirichlet>
56+
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
57+
<surface>leftSurfaceSquarePipe</surface>
58+
<value>55.0</value>
59+
</dirichlet>
60+
<dirichlet>
61+
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
62+
<surface>rightSurfaceSquarePipe</surface>
63+
<value>12.0</value>
64+
</dirichlet>
65+
</boundary-conditions>
66+
<material-property>
67+
<volume>SquarePipeVol</volume>
68+
<lambda>16.5</lambda>
69+
</material-property>
70+
<material-property>
71+
<volume>CylindricalPipeVol</volume>
72+
<lambda>35.8</lambda>
73+
</material-property>
74+
</fem>
75+
76+
<!--
77+
Post-processing settings:
78+
- output-period: Defines how often (in simulation steps) the output is generated.
79+
- format: Specifies the post-processing format, here using VtkHdfV2.
80+
- output: Defines the variables to be included in the post-processing output.
81+
-->
82+
<arcane-post-processing>
83+
<output-period>1</output-period>
84+
<output>
85+
<variable>U</variable>
86+
</output>
87+
</arcane-post-processing>
88+
89+
</case>

0 commit comments

Comments
 (0)