mkoeh |
February 8, 2019 07:27 |
Gmsh get all Surfaces of a Volume
1 Attachment(s)
Hey there,
I'm a new forum member and I would like to ask you, if you could help me out with the following problem:
I have a bcc lattice domain for the stokes equation and I'm trying to set up the domain with gmsh. For all spherical cavitys of the bcc lattice I would like to assign a physical surface to it, such that the FE-solver can handle those surfaces as a noslip cond.
Code:
// Gmsh project created on Thu Feb 7 09:15:11 2019
SetFactory("OpenCASCADE");
half_length = 0.5774;
//+
Box(1) = {0, 0, 0, half_length, half_length, half_length};
//+
Sphere(2) = {half_length, half_length, half_length, 0.25, -Pi/2, Pi/2, 2*Pi};
//+
Sphere(3) = {half_length, half_length, 0, 0.25, -Pi/2, Pi/2, 2*Pi};
//+
Sphere(4) = {half_length, 0, 0, 0.25, -Pi/2, Pi/2, 2*Pi};
//+
Sphere(5) = {half_length, 0, half_length, 0.25, -Pi/2, Pi/2, 2*Pi};
//+
Sphere(6) = {0, 0, half_length, 0.25, -Pi/2, Pi/2, 2*Pi};
//+
Sphere(7) = {0, half_length, half_length, 0.25, -Pi/2, Pi/2, 2*Pi};
//+
Sphere(8) = {0, half_length, 0, 0.25, -Pi/2, Pi/2, 2*Pi};
//+
Sphere(9) = {0, 0, 0, 0.25, -Pi/2, Pi/2, 2*Pi};
//+
Sphere(10) = {half_length/2, half_length/2, half_length/2, 0.25, -Pi/2, Pi/2, 2*Pi};
//+
BooleanDifference{ Volume{1}; Delete; }{ Volume{10}; Volume{8}; Volume{9}; Volume{3}; Volume{4}; Volume{2}; Volume{5}; Volume{7}; Volume{6}; Delete; }
//+
//+
Translate {0, 0, half_length} {
Duplicata { Volume{1}; }
}
//+
Translate {half_length, 0, 0} {
Duplicata { Volume{2}; Volume{1}; }
}
//+
Translate {0, half_length, 0} {
Duplicata { Volume{4}; Volume{3}; Volume{2}; Volume{1}; }
}
Is there a way to get the boundary surface of Spheres 1-10 without using the GUI?
Thanks in advance and kind regards
|