... | ... | @@ -17,9 +17,10 @@ For potential flows to be lifting, the potential value must be multivalued along |
|
|
```python
|
|
|
mshCrck = tbox.MshCrack(msh, dim)
|
|
|
mshCrck.setCrack('wake')
|
|
|
mshCrck.addBoundaries(['boundary', ...])
|
|
|
for bnd in ['boundary_0', 'boundary_1', ...]:
|
|
|
mshCrck.addBoundary(bnd)
|
|
|
```
|
|
|
where `dim` is the dimension of the problem (2 or 3), `'wake'` is the name of the physical group of the mesh containing the wake surface, and `'boundary'`, ... are the name of the physical groups of the mesh having elements touching the wake surface. These groups typically include the fluid domain, the airfoil, wing or and fuselage, and the downstream and symmetry boundaries. `mshCrck` will automatically create a new physical group named `'wake_'`. Two methods are implemented to detect if the elements touching the wake are above or below it. Either the physical groups `'boundary'` and `'boundary_'` are present in the mesh, and the algorithm will consider that the elements of `'boundary'` are above and that those of `'boundary_'` are below, or only the group `'boundary'` is present, and the algorithm will try to detect automatically were the elements are located with respect to the wake surface. This is done by comparing the orientation of the normal of the closest wake element to the vector linking the center of gravity of the closest wake element to the considered element. The wake normals must be pointing in the positive (y in 2D and z in 3D) direction. Note that, in the first case, the group `'boundary_'` will be merged within the group `'boundary'`.
|
|
|
where `dim` is the dimension of the problem (2 or 3), `'wake'` is the name of the physical group of the mesh containing the wake surface, and `'boundary_0'`, ... are the name of the physical groups of the mesh having elements touching the wake surface. These groups typically include the fluid domain, the airfoil, wing or and fuselage, and the downstream and symmetry boundaries. `mshCrck` will automatically create a new physical group named `'wake_'`. Two methods are implemented to detect if the elements touching the wake are above or below it. Either the physical groups `'boundary'` and `'boundary_'` are present in the mesh, and the algorithm will consider that the elements of `'boundary'` are above and that those of `'boundary_'` are below, or only the group `'boundary'` is present, and the algorithm will try to detect automatically were the elements are located with respect to the wake surface. For surface boundaries (of dimension `dim-1`), this is done by comparing the orientation of the normal of the closest wake element to the vector linking the center of gravity of the closest wake element to the considered element. The same process is applied to treat volume boundaries (of dimension `dim`), except that the algorithm will first check whether the nodes of the volume also belong to a surface located below the wake. The wake normals must be pointing in the positive (y in 2D and z in 3D) direction. Note that, in the first case, the group `'boundary_'` will be merged within the group `'boundary'`.
|
|
|
For a 3D flow, the potential at the wake tip (i.e., the edge of the wake downstream of the wingtip) will be continuous. This is enforced by not duplicating the nodes in this line,
|
|
|
```python
|
|
|
mshCrck.setExcluded('wakeTip')
|
... | ... | @@ -37,18 +38,18 @@ tbox.GmshExport(msh).save(msh.name) |
|
|
**1.3 Creating a mesh morpher**
|
|
|
A mesh morpher can be used to deform the volume mesh in order to track the motion of a given boundary surface of that mesh. This is typically required for applications where a body immersed in the fluid can move or deform, such as aerostructural or optimization calculations. The morpher is instantiated using the tbox::MshDeform C++ class as,
|
|
|
```python
|
|
|
morpher = tbox.MshDeform(msh, dim)
|
|
|
morpher.nthreads = k # can be set automatically using k = fwk.parseargs().k
|
|
|
morpher = tbox.MshDeform(msh, linsol, dim, nthreads)
|
|
|
```
|
|
|
where `k` is the number of threads.
|
|
|
where `linsol` is a linear solver and `nthreads` is the number of threads (can be set automatically using `fwk.parseargs().k`). In order to solve the linear elasticity equations to deform the mesh, an ILU preconditioned GMRES usually works well as linear solver: `linsol = tbox.Gmres(1, 1e-6, 30, 1e-8)`. More information about the available linear solvers can be found [here](use_custom_solver).
|
|
|
The grid associated to the volume (fluid), and the fixed, moving and internal boundaries are added using
|
|
|
```python
|
|
|
morpher.setField('fld') # volume grid
|
|
|
morpher.addFixed(['fxd_i', ...]) # list of fixed boundaries
|
|
|
for fxd in ['fxd_0', 'fxd_1', ...]:
|
|
|
morpher.addFixed(fxd) # fixed boundary
|
|
|
morpher.addMoving('mov') # moving boundary
|
|
|
morpher.addInternal(['wk', 'wk_']) # pair of internal boundaries
|
|
|
morpher.addInternal('wk', 'wk_') # pair of internal boundaries
|
|
|
```
|
|
|
where, `'fld'` is the name of the physical group of the mesh contaning the volume grid (fluid), `'fxd_i'` is the name of the ith physical group of the mesh contaning a fixed boundary, `'mov'` is the name of the physical group of the mesh contaning the moving boundary (typically, a body), and `['wk','wk_']` is the pair of names of the physical groups of the mesh contaning the internal boundaries (typically, a wake).
|
|
|
where `'fld'` is the name of the physical group of the mesh contaning the volume grid (fluid), `'fxd_i'` is the name of the ith physical group of the mesh contaning a fixed boundary, `'mov'` is the name of the physical group of the mesh contaning the moving boundary (typically, a body), and `'wk','wk_'` is the pair of names of the physical groups of the mesh contaning the internal boundaries (typically, a wake). Note that several pair of internal boundaries can be added by repeating the last instruction.
|
|
|
For 3D computations, if the problem contains a symmetry plane, it can be added as,
|
|
|
```python
|
|
|
morpher.setSymmetry('sym', 1)
|
... | ... | |