Update use_api_core authored by Adrien Crovato's avatar Adrien Crovato
......@@ -5,51 +5,69 @@ The [core](https://gitlab.uliege.be/am-dept/dartflo/blob/master/dart/api/core.py
In practise, DART is initialized by using a dictionary of parameters, and the type of scenario and task. The different parameters are listed hereunder.
```python
cfg = {
# Options
'Threads': int, # number of threads (optional, default=1)
'Verb': int, # verbosity (optional, default=1)
# Model (geometry or mesh)
'File': str, # Input file containing the model
'Pars': dict, # parameters for input file model
'Dim': int, # problem dimension (2 or 3)
'Format': str, # save format (vtk or gmsh)
# Markers...
'Fluid': str, # name of physical group containing the fluid
'Farfield': list of str, # LIST of names of physical groups containing the farfield boundaries (downstream should be last element)
# ... only 2D
'Wing': str, # name of physical group containing the airfoil boundary (will be the body of interest for aerostructural and optimization)
'Wake': str, # name of physical group containing the wake
'Te': str, # name of physical group containing the trailing edge
# ... only 3D
'Wings': list of str, # LIST of names of physical groups containing the lifting surface boundary (first element will be the body of interest for aerostructural and optimization)
'Wakes': list of str, # LIST of names of physical group containing the wake
'WakeTips': list of str, # LIST of names of physical group containing the free edge of the wake (not for 2.5D)
'Tes': list of str, # LIST of names of physical group containing the trailing edges
# ... optional for 3D
'Symmetry': str, # name of physical group containing the symmetry boundaries
'Fuselage': str, # name of physical group containing the fuselage boundary
'WakeExs': str, # LIST of names of physical group containing the free edge of the wake and the intersection of lifting surface with fuselage (to be excluded from Wake B.C.), only required if a 'Fuselage' if present, otherwise 'WakeTips' is sufficient
# Freestream
'M_inf': float, # freestream Mach number (optional, default=0)
'AoA': float, # freestream angle of attack [deg] (optional, default=0)
'AoS': float, # freestream angle of sideslip [deg] (optional, default=0)
'Q_inf': float, # freesteam dynamic pressure (only required for aerostructural computations)
# Geometry
'S_ref': float, # reference surface length
'c_ref': float, # reference chord length
'x_ref': float, # x-coordinate of reference point for moment computation
'y_ref': float, # y-coordinate of reference point for moment computation
'z_ref': float, # z-coordinate of reference point for moment computation
# Numerical
'LSolver': 'GMRES', # inner solver (PARDISO, MUMPS, SparseLU or GMRES)
'G_fill': int, # fill-in factor for GMRES preconditioner (optional, default=2)
'G_tol': float, # tolerance for GMRES (optional, default=1e-5)
'G_restart': int, # restart for GMRES (optional, default=50)
'Rel_tol': float, # relative tolerance on solver residual
'Abs_tol': float, # absolute tolerance on solver residual
'Max_it': int # maximum number of iterations for nonlinear solver
'options': {
'num_threads': int, # number of threads (optional, default=1)
'verbosity': int, # verbosity (optional, default=1)
},
'io': {
'model_file': str, # input file containing the Gmsh model (.geo or .msh)
'parameters': dict, # parameters for input Gmsh model (optional, default={})
'num_dimensions': int, # problem dimension: 2 or 3 (optional, default=2)
'format': str, # output format: 'vtk' or 'gmsh' (optional, default='vtk')
},
'markers': {
'fluid': str, # physical tag containing the fluid domain in Gmsh model
'farfield': list(str), # physical tags containing the farfield boundaries in Gmsh model (downstream should be last entry)
'symmetry': str, # physical tag containing the symmetry boundary (optional)
'bodies': [
{
'tag': str, # physical tag containing the lifting body surface
'is_fsi': bool, # whether the body is a fluid-structure interface (optional, default=False)
'is_design': bool # whether the body is a design interface (optional, default=False)
}
],
'wakes': [
{
'tag': str, # physical tag containing wake
'bound_bodies': list(str) or dict(str, str), # physical tags of the bodies to which the wake is attached
'free_edge': str, # physical tag containing the free edge of the wake (optional)
'kutta_bodies': list(str), # physical tags of the bodies on which the Kutta condition will be applied (optional)
'is_linear': bool # whether the linear version of the wake and Kutta conditions is to be used (optional, default=False)
}
]
},
'freestream': {
'mach': float, # freestream Mach number (optional, default=0)
'aoa': float, # freestream angle of attack [deg] (optional, default=0)
'aos': float, # freestream angle of side slip [deg] (optional, default=0)
'dyn_pressure': float # freesteam dynamic pressure (optional)
},
'geometry': {
'area': float, # reference surface area (optional, default=1)
'length': float, # reference chord length (optional, default=1)
'center': [float, float, float] # reference point coordinates for moment computation (optional, default=[0.25, 0, 0])
},
'numerics': {
'solver': {
'type': str, # inner linear solver: 'GMRES', 'PARDISO', 'MUMPS' or 'SparseLU' (optional default='GMRES')
'tolerance': float, # tolerance, only for GMRES (optional, default=1e-5)
'max_iterations': int, # maximum number of iterations, only for GMRES (optional, default=200)
'num_restart': int, # number of restart, i.e. maximum Krylov subspace size, only for GMRES (optional, default=50)
'fill_in': int, # fill-in factor, only for GMRES (optional, default=2)
'drop_tol': float # dropping tolerance, only for GMRES (optional, default=1e-6)
},
'rel_tolerance': float, # relative tolerance (optional, default=1e-6)
'abs_tolerance': float, # absolute tolerance (optional, default=1e-8)
'max_iterations': int # maximum number of iterations (optional, default=20)
}
}
```
Remarks:
- `'symmetry'` is only required for 3D cases;
- `'free_edge'` is only required for 3D cases;
- if `'kutta_bodies'` is not provided, all the bodies provided in `'bound_bodies'` will be used;
- `'bound_bodies'` can be provided either via a list if the trailing edge of the body 'body' is named 'bodyTe', or via a dict that defines the mapping between a body and its trailing edge explicitly;
- `'dyn_pressure'` is only required for fluid-structure calculations.
**2. Initializing DART**
Once the parameters have been defined, DART can simply be initialized by calling,
......
......