Skip to content

Commit 0f9e536

Browse files
committed
Merge branch 'master' into piotr/integrate_with_docs
2 parents d115c6b + 2af3b53 commit 0f9e536

22 files changed

Lines changed: 246 additions & 880 deletions

docs/01.introduction/05.project-tree.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ The project tree supports multiple branches at each level:
114114
- Simulation continues from the last state of the parent case
115115
- Multiple forks can branch from the same parent case
116116
117+
### **Interpolation**
118+
119+
- Interpolation transfers solution from a case onto a new mesh
120+
- New mesh can exist either within the same project, or in a different one
121+
- Useful when running a refined mesh or slightly altered geometry
122+
- Arrow on the volume mesh asset icon in project tree indicates that the volume mesh exists in a different project
123+
117124
### **Component Actions**
118125
119126
When clicking on a component in the project tree, a menu of available actions appears. Below are the available actions:
@@ -126,7 +133,7 @@ When clicking on a component in the project tree, a menu of available actions ap
126133
|------------|-----------------|
127134
| Open in workbench | Opens the component workbench |
128135
| New run | Creates a new simulation run draft using settings from this component |
129-
| Interpolation | Transfers solution data between different mesh resolutions |
136+
| Interpolation | Transfers solution data between different meshes |
130137
| Rename | Changes the display name of the component |
131138
| Details | Shows components details such as ID, name, cost, parent asset ID, etc. |
132139
| Expand all sub-items | Shows all sub-components derived from this component |
Lines changed: 3 additions & 0 deletions
Loading
110 KB
Loading

docs/02.simulation-setup/02.mesh/01.mesh.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The Meshing Defaults define the baseline mesh generation parameters that control
1717
| **Boundary layer first layer thickness** | First layer thickness for volumetric anisotropic layers |
1818
| **Refinement factor** | Global scaling factor for mesh refinement |
1919
| **Gap treatment strength** | Controls mesh behavior in narrow gaps |
20+
| **Preserve thin geometry** | Specifies whether thin geometry features should be resolved accurately during surface meshing|
2021

2122
---
2223

@@ -89,14 +90,16 @@ The Meshing Defaults define the baseline mesh generation parameters that control
8990

9091
#### **Refinement factor**
9192

92-
*Global scaling factor that affects the overall mesh refinement level.*
93+
*Global scaling factor that affects the overall **volume** mesh refinement level.*
9394

9495
- **Default:** `1.0`
9596
- **Units:** Dimensionless
9697
>**Notes:**
98+
> - Doesn't work with beta mesher
99+
> - Adjusts all spacings in refinement regions and first layer thickness to generate r-times finer mesh, where r is the refinement factor value. For example, if `refinement factor=2`, all spacings will be divided by \[ 2^{1/3} \], so the resulting mesh will have approximately 2 times more nodes
97100
> - Values > `1.0` increase global mesh refinement
98101
> - Values < `1.0` decrease global mesh refinement
99-
> - Affects both surface and volume mesh density
102+
> - Affects volume mesh density only
100103
> - Useful for quick mesh resolution studies
101104
102105
#### **Gap treatment strength**
@@ -111,6 +114,16 @@ The Meshing Defaults define the baseline mesh generation parameters that control
111114
> - Critical for mesh quality in tight geometric spaces
112115
> - Helps prevent highly skewed elements in narrow regions
113116
117+
#### **Preserve thin geometry**
118+
119+
*Flag to specify whether thin geometry features should be resolved accurately during the surface meshing process.*
120+
121+
- **Default:** `False`
122+
>**Notes:**
123+
> - This setting is only effective when using Geometry AI.
124+
> - Resolves features with thickness roughly equal to `geometry_accuracy`.
125+
> - Can be overridden using **GeometryRefinement**.
126+
114127
---
115128

116129
<details>
@@ -191,6 +204,7 @@ meshing_defaults = fl.MeshingDefaults(
191204
curvature_resolution_angle=12 * u.deg,
192205
boundary_layer_growth_rate=1.2,
193206
boundary_layer_first_layer_thickness=0.01 * u.mm,
207+
preserve_thin_geometry=True
194208
)
195209
```
196-
</details>
210+
</details>
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Geometry Refinement
2+
3+
*Geometry refinement allows for controlling the resolution of the surface mesh by defining the smallest geometric features to be captured. It ensures that the mesh accurately represents the geometry down to a specified length scale. Geometry AI needs to be enabled to use this feature.*
4+
5+
---
6+
7+
## **Available Options**
8+
9+
| *Option* | *Description* |
10+
|------------|-----------------|
11+
| **Geometry accuracy** | The smallest length scale to be accurately resolved by the surface mesher. |
12+
| **Preserve thin geometry** | Specifies whether to accurately resolve thin geometry features. |
13+
| **Assigned surfaces** | The surfaces to which the refinement is applied. |
14+
15+
---
16+
17+
## **Detailed Descriptions**
18+
19+
### **Geometry accuracy**
20+
21+
*Specifies the minimum length scale that the surface meshing process will accurately resolve.*
22+
23+
- **Required**
24+
- **Example:** `0.01 m`
25+
26+
> **Notes:**
27+
> - A smaller `Geometry accuracy` value will result in a finer mesh and consequently a larger cell count and longer computation time.
28+
> - Start with a larger value and decrease it iteratively to find the optimal balance between accuracy and computational cost.
29+
30+
### **Preserve thin geometry**
31+
32+
*Specifies whether thin geometry features should be accurately resolved during surface meshing.*
33+
34+
- **Default:** `false`
35+
> **Notes:**
36+
> - Resolves features with thickness roughly equal to `geometry_accuracy`.
37+
38+
### **Assigned surfaces**
39+
40+
*The list of surfaces where the geometry refinement will be applied.*
41+
42+
- **Required**
43+
> **Notes:**
44+
> - Must reference valid surface entities in the geometry.
45+
> - Surfaces can be assigned from the list using the `+` button or by graphical selection in the viewer.
46+
47+
---
48+
49+
<details>
50+
<summary><h3 style="display:inline-block"> 💡 Tips</h3></summary>
51+
52+
- Use this refinement to ensure small but important geometric features (e.g., sharp corners, small fillets) are not lost during meshing.
53+
54+
</details>
55+
56+
---
57+
58+
<details>
59+
<summary><h3 style="display:inline-block"> ❓ Frequently Asked Questions</h3></summary>
60+
61+
- **What is a typical value for Geometry accuracy?**
62+
> The value is highly dependent on the specific geometry and the scale of the features you want to capture. It should be smaller than the smallest important feature size. For example, for a vehicle simulation, you might want to resolve features on the scale of millimeters.
63+
64+
- **What is the difference between Geometry Refinement and Surface Refinement?**
65+
> `Surface Refinement` controls the maximum edge length of surface cells directly. `Geometry Refinement` provides a more automated way of refining the mesh based on geometric curvature and feature size, driven by geometry AI.
66+
67+
</details>
68+
69+
---
70+
71+
<details>
72+
<summary><h3 style="display:inline-block"> 🐍 Python Example Usage</h3></summary>
73+
74+
```python
75+
import flow360 as fl
76+
77+
geometry_refinement = fl.GeometryRefinement(
78+
name="fine_features_refinement",
79+
faces=[geometry["wing_surface"], geometry["fuselage_surface"]],
80+
geometry_accuracy=0.001 * fl.u.m,
81+
preserve_thin_geometry=True
82+
)
83+
```
84+
</details>

docs/02.simulation-setup/02.mesh/03.refinements/README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
|[**Passive Spacing**](./04.passive-spacing.md) | Controls mesh behavior without direct refinement |
1313
|[**Uniform Refinement**](./05.uniform-refinement.md) | Creates uniform mesh spacing in a region |
1414
|[**Axisymmetric Refinement**](./06.axisymmetric-refinement.md) | Creates structured-like mesh with cylindrical bias |
15+
|[**Geometry Refinement**](./07.geometry-refinement.md) | Controls mesh resolution based on geometric features |
1516

1617
## **General Guidelines**
1718

@@ -21,6 +22,7 @@
2122
- Use Surface Edge Refinement for leading/trailing edges
2223
- Apply Surface Refinement for general surface resolution
2324
- Implement Boundary Layer Refinement for wall regions
25+
- Select geometry refinement to accurately capture small features
2426

2527
2. **Off-Body Features**
2628
- Use Uniform Refinement for wakes and shocks
@@ -87,58 +89,56 @@
8789
<summary><h3 style="display:inline-block"> 🐍 Python Example Usage</h3></summary>
8890

8991
```python
90-
from flow360 import (
91-
MeshingParams,
92-
SurfaceEdgeRefinement,
93-
SurfaceRefinement,
94-
BoundaryLayer,
95-
PassiveSpacing,
96-
UniformRefinement,
97-
AxisymmetricRefinement,
98-
u
99-
)
92+
import flow360 as fl
10093

10194
# Example of combining multiple refinements
10295
meshing=MeshingParams(
10396
refinements=[
10497
# Surface edge refinement for leading edge
105-
SurfaceEdgeRefinement(
98+
fl.SurfaceEdgeRefinement(
10699
name="leading_edge",
107100
edges=[leading_edge],
108-
method=HeightBasedRefinement(value=0.001 * u.m)
101+
method=fl.HeightBasedRefinement(value=0.001 * fl.u.m)
109102
),
110103
# Surface refinement for general resolution
111-
SurfaceRefinement(
104+
fl.SurfaceRefinement(
112105
name="wing_surface",
113106
faces=[wing_surface],
114-
max_edge_length=0.05 * u.m
107+
max_edge_length=0.05 * fl.u.m
115108
),
116109
# Boundary layer refinement for wall regions
117-
BoundaryLayer(
110+
fl.BoundaryLayer(
118111
name="wing_bl",
119112
faces=[wing_surface],
120-
first_layer_thickness=1e-5 * u.m,
113+
first_layer_thickness=1e-5 * fl.u.m,
121114
growth_rate=1.2
122115
),
123116
# Passive spacing refinement for interface region
124-
PassiveSpacing(
117+
fl.PassiveSpacing(
125118
name="interface_region",
126119
type="projected",
127120
faces=[interface_surface]
128121
),
129122
# Wake region refinement
130-
UniformRefinement(
123+
fl.UniformRefinement(
131124
name="wake_region",
132125
entities=[wake_box],
133-
spacing=0.1 * u.m
126+
spacing=0.1 * fl.u.m
134127
),
135128
# Axisymmetric refinement for propeller region
136-
AxisymmetricRefinement(
129+
fl.AxisymmetricRefinement(
137130
name="propeller_region",
138131
entities=[prop_cylinder],
139-
spacing_axial=0.02 * u.m,
140-
spacing_radial=0.01 * u.m,
141-
spacing_circumferential=0.015 * u.m
132+
spacing_axial=0.02 * fl.u.m,
133+
spacing_radial=0.01 * fl.u.m,
134+
spacing_circumferential=0.015 * fl.u.m
135+
),
136+
# Geometry refinement for fine features
137+
fl.GeometryRefinement(
138+
name="fine_features_refinement",
139+
faces=[wing_surface, fuselage_surface],
140+
geometry_accuracy=0.001 * fl.u.m,
141+
preserve_thin_geometry=True
142142
)
143143
]
144144
)

docs/02.simulation-setup/02.mesh/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ A section for defining the meshing settings.
2323

2424
### **[Refinements](./03.refinements/README.md)**
2525

26-
*Comprehensive local mesh control system for critical regions. Provides six refinement types.*
26+
*Comprehensive local mesh control system for critical regions. Provides seven refinement types.*
2727

2828
**Subsections:**
2929
- **[Surface Edge Refinement](./03.refinements/01.surface-edge-refinement.md)** - Controls mesh resolution near edges
@@ -32,11 +32,13 @@ A section for defining the meshing settings.
3232
- **[Passive Spacing](./03.refinements/04.passive-spacing.md)** - Controls mesh behavior without direct refinement
3333
- **[Uniform Refinement](./03.refinements/05.uniform-refinement.md)** - Creates uniform mesh spacing in a region
3434
- **[Axisymmetric Refinement](./03.refinements/06.axisymmetric-refinement.md)** - Creates structured-like mesh with cylindrical bias
35+
- **[Geometry Refinement](./03.refinements/07.geometry-refinement.md)** - Controls mesh resolution based on geometric features
3536

3637
```{toctree}
3738
:hidden:
3839
:maxdepth: 3
3940
./01.mesh.md
4041
./02.rotation-regions.md
4142
./03.refinements/README.md
42-
```
43+
```
44+
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Stopping criterion
2+
3+
*Stopping criterion provides a mechanism to automatically terminate a simulation when a monitored field reaches a certain value. This is achieved by tracking the deviation of the field over a moving window of iterations. When the deviation falls below a defined tolerance, the simulation is considered converged and stops.*
4+
5+
---
6+
7+
## **Available Parameters**
8+
9+
| *Parameter* | *Description* |
10+
|----------------|------------------------------------------------------------------------------------------------------------|
11+
| **Output type** | The type of output to be monitored (e.g., Probe, Surface Integral). |
12+
| **(Output name)** | The name of a specific, pre-defined output instance. This field appears after selecting an **Output type**. |
13+
| **Output field** | The specific scalar field within the selected output to monitor for convergence. |
14+
| **Tolerance** | The threshold for the moving deviation of the monitored field. |
15+
| **Change window** | The number of iterations over which to calculate the moving deviation of the monitored field. |
16+
17+
---
18+
19+
## **Detailed Descriptions**
20+
21+
### **Output type**
22+
23+
*Specifies the category of output that contains the field to be monitored.*
24+
25+
- **Default:** None
26+
- **Options:**
27+
- `Probe`
28+
- `Surface probe`
29+
> **Notes:**
30+
> - The chosen output type must be configured in output section of the simulation setup.
31+
> - This determines which specific outputs are available in the next dropdown.
32+
33+
### **Output name**
34+
35+
*Selects a specific, named output instance of the chosen "Output type" to monitor.*
36+
37+
- **Default:** None
38+
> **Notes:**
39+
> - You must define an output (e.g., a `ProbeOutput` or `SurfaceIntegralOutput`) before it can be selected here.
40+
> - The list of available names is filtered based on the selected **Output type**.
41+
42+
### **Output field**
43+
44+
*Field within the selected output whose convergence will be tracked.*
45+
46+
- **Default:** None
47+
- **Example:** `Cl`, `Pressure`, `MyVelocityVariable`
48+
> **Note:**
49+
> - The selected field must be one of the `output_fields` defined in the selected output instance.
50+
51+
### **Tolerance**
52+
53+
*Convergence threshold. The simulation stops when the moving deviation of the **Output field** is less than this value.*
54+
55+
- **Default:** `0.01`
56+
- **Example:** `1e-4`
57+
> **Notes:**
58+
> - This value is non-dimensional if the monitored field is a string-defined default field (e.g., 'Cl').
59+
> - If using a `UserVariable` for the output field, the dimensions of the tolerance must match the dimensions of the field.
60+
61+
### **Change window**
62+
63+
*The number of data points used for the moving window to calculate the deviation of the monitored field.*
64+
65+
- **Default:** `10`
66+
- **Example:** `20`
67+
> **Notes:**
68+
> - The value must be an integer greater than or equal to 2.
69+
> - A larger window provides a more stable measure of convergence but may react slower to changes.
70+
71+
---
72+
73+
<details>
74+
<summary><h3 style="display:inline-block"> 🐍 Python Example Usage</h3></summary>
75+
76+
```python
77+
import flow360 as fl
78+
79+
fl.Fluid(
80+
stopping_criterion=[
81+
stop_on_lift_convergence = fl.Criterion(
82+
name="StopOnLift",
83+
monitor_output=fl.SurfaceIntegralOutput(
84+
name="wing_forces",
85+
entities=[surface_mesh['wing']],
86+
output_fields=['Cf', 'Cl', 'Cd']
87+
),
88+
monitor_field='Cl',
89+
tolerance=1e-5,
90+
criterion_change_window=50
91+
)
92+
],
93+
...
94+
)
95+
```
96+
97+
</details>

0 commit comments

Comments
 (0)