In a general description of Tekigo a succinct overview of the Tekigo python tool was provided and some relevant terminology introduced. In this page we will focus on the capability of Tekigo in an illustrative sense without going into too much detail. It is intended as a complementary to the comprehensive tutorial pages (beginner, intermediate). After this short read, the reader will understand the possibilities Tekigo can offer and have a sense of how the workflow is structured.

## Summary of the tool

Tekigo is

• not a meshing tool
• a python wrapper enabling the interface with an actual meshing tool for static mesh adaptation
• currently linked to the MMG meshing tool through the intermediate of HIP

• allows the user to define metrics used for adaptation

• provides
• two “operation modes”
• raw adapt: a one time refinement
• refine: a recursive refinement
• the user with full control on the definition of their refinement metric(s) with some boundary conditions
• an a priori estimation of the final mesh size without performing the refinement
• the dry run mode

We will now go through the different options of Tekigo.

Note: The current developments of Tekigo are performed within the context of the AVBP CFD solver with its mesh and solution formats. However, it does not preclude the possibility for its use with other CFD solvers. On the contrary, through the intermediate of HIP, different mesh formats can be read in and written out which does limit the developments to the interfacing between Tekigo and HIP.

## Using Tekigo

### The trapped vortex setup

Similarly to Fig.2 , the examples will use a part of the trapped vortex setup which is illustrated below. It is a purely educational burner configuration. We will rely on the axi-symmetric character of the geometry. The results in following will be presented for a cut in the xy plane at the center of the latter geometry (z = 0).

A first possibility with Tekigo is a one time refinement with a given metric which is achieved through the raw_adapt functionality.
The metric is

• user defined and will control the refinement / coarsening
• a value assigned to each node of the mesh, similar to a field variable
• $$\in$$ [0.5 - 4] with < 1 refine, =1 do nothing, > 1 coarsen
e.g. metric = np.where(temperature > 1200, 0.8, 1.2)


• an initial mesh
• an initial solution
• a metric

Optional

• an average solution

#### In practice:

import numpy as np
from tekigo import (TekigoSolution,
tekigo_sol = TekigoSolution(mesh='default.mesh.h5',
solution='default_inst.sol.h5',
only_sol_vars=['temperature'],
out_dir='./Results')
# create our metric
metric_field = np.where(temp>1200, 0.8, 1.2)


### The (recursive) refine mode

Another possibility offered by Tekigo is the refine function which can1 run in a recursive manner. It comes in handy when we would like to exert some control on the final grid in the form of a maximum number of nodes for instance. The recusive loop will aim towards the mesh size bounded by the user defined parameters. The refine function takes in a criterion (or multiple criteria) instead of a metric. The criterion is

• user defined and will control the refinement / coarsening indirectly, i.e. zones will be flagged for refinement / coarsening in a recursive sense following the criterion
• a value assigned to each node of the mesh, similar to a field variable
• $$\in$$ [-1, 1] with
• -1: max coarsening
• 1: max refinement
• is converted by HIP into a metric as shown in Fig.6 for a temperature based criterion

Refine requires

• an initial mesh
• an initial solution
• a criterion (or criteria)

Optional

• an average solution
• a maximum number of iterations
• a maximum node number
• a minimum edge size
• enable coarsening
• L2 criterion

Note1: If the maximum number of iterations is set to 1 its use is similar to the raw adapt mode but the underlying implementation methodology differs. It has still the advantage of handling multiple criteria without the need for the user to combine them.

#### In practice:

##### Single criterion

An example snippet for a single criterion, corresponding to the result in Fig.7, is given below. The implementation choices are such that the refine() function takes as argument a dictionary containing functions wherein the different criteria are defined. Tekigo “knows” it has to provide the dictionary input with the tekigo solution (ts_ in this example) as an argument.

import numpy as np
from tekigo import (TekigoSolution,
refine)
tekigo_sol = TekigoSolution(mesh='default.mesh.h5',
solution='default_inst.sol.h5',
only_sol_vars=['temperature'],
out_dir='./Results')

# create our criterion function
def temperature_criterion(ts_):
criterion = np.where(temp>1000,0.4,0)
return criterion

# gather our criterion in a dictionary
def custom_criteria(ts_):
"""Funtion to wrap the criterions"""
criteria = dict()
criteria['temperature_crit'] = temperature_criterion(ts_)
return criteria

refine(
tekigo_sol,
custom_criteria,
dry_run = False,
iteration_max=2,
nnode_max=120000,
min_edge=0.7e-3,
coarsen=False)

##### Multiple criteria

A very useful aspect of the refine mode is its ability to deal with multiple criteria at once. In the same manner as detailed in the Single criterion paragraph above, the criteria should be gathered as functions in the form of a dictionary. This is futher exemplified in Fig.8, illustrating the workflow for use of this capability.

### How do we get a “feel” of our refinement control : the dry run

The refinementy parameters might seem somewhat abstract, i.e. numbers between given ranges. It could becomes difficult to get a “feel” on how our metric or criterion (criteria) definition will impact or refinement. The dry_run functionality can greatly help in such situation. It is deactivated by default.

The dry run

• is a boolean
• True:
• Tekigo rewrites a solution with the metric and future_edge_size fields AND estimate te future number of nodes
• The above outputs are the best metrics to get a better grasp on the resulting refinement
• False (default): Tekigo asks HIP to do re refinement
• can be activated in both raw_adapt and refine mode
• provides estimates from which the final refined solution can differ
• does not ensure the refinement will succeed

• Tekigo will not prevent sudden changes in the metric provided. However, the meshing tool (MMG in this case) will put some bounds on the ratio between edges based on a maximum authorized gradient. There are some filters in Tekigo to smooth gradients that can occur (gather, scatter functionality) or even move them (dilate, erode functionality.)

• The full control on the metric / criterion definition is left to the user. If the user ensures that these are as smooth as possible, the differences between the final and the intended result will be minimized.

• At this point you have every bit of knowledge on the capability of Tekigo. Time to get started with the hands on (beginner, intermediate)

### Acknowledgements

The development of Tekigo and its functionalities have been made possible through a collaborative effort within the COOP group. In particular the developments made by Théo Defontaine and Tamon Nakano which are duly acknowledged.

Jimmy-John Hoste is a postdoctoral researcher in computer science engineering with a focus on CFD related topics.