Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ output/

# Hydra
outputs/
outputs_finite_volume_euler/
multirun/
.hydra/

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`uniform_grid_gradient`, `rectilinear_grid_gradient`,
`spectral_grid_gradient`, `meshless_fd_derivatives`, `mesh_lsq_gradient`,
and `mesh_green_gauss_gradient`.
- Added a functionals example for mesh-based finite-volume Euler forward-step
solves with 2D triangular and 3D tetrahedral cases.
- Adds `physicsnemo.sym` module for symbolic PDE residual computation
(`PhysicsInformer`). Users define PDEs via SymPy and select a gradient method
(`autodiff`, `finite_difference`, `spectral`, `meshless_finite_difference`,
Expand Down
6 changes: 6 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ The several examples inside PhysicsNeMo can be classified based on their domains
|[Fine-tuning of DoMINO NIM](./cfd/external_aerodynamics/domino_nim_finetuning/)|DoMINO|NO|
|[Transolver for External Aerodynamics on Irregular Meshes](./cfd/external_aerodynamics/transolver/)|Transolver|NO|

### Functionals

|Use case|Functional area|Transient|
| --- | --- | --- |
|[Finite-Volume Euler Forward Step](./functionals/finite_volume_euler/)|Mesh finite-volume solver|YES|


### Weather

Expand Down
29 changes: 29 additions & 0 deletions examples/functionals/finite_volume_euler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Finite-Volume Euler Example

This example runs a second-order MUSCL-Hancock finite-volume solve of the
compressible Euler equations on unstructured simplicial meshes. It includes a
2D triangular forward-facing-step case and a 3D extruded tetrahedral version of
the same geometry.

The example uses `physicsnemo.mesh.Mesh` for the static simplicial mesh and the
existing `mesh_green_gauss_gradient` functional for cell-centered gradient
reconstruction. Euler-specific pieces, including primitive/conservative
conversion, boundary states, CFL selection, and the fused MUSCL-Hancock
limiter/reconstruction/Rusanov update are kept in `euler_finite_volume.py`.

The timestep runtime keeps only the Mesh geometry, cell-neighbor ids, and local
boundary tags. Face centroids, normals, areas, cell volumes, and limiter
stencils are computed from that compact cell-local connectivity inside the
operators.

Run with:

```bash
python euler_solver.py
```

The default config writes density plots and final tensors under Hydra's
`outputs_finite_volume_euler/` run directory. It also writes PNG frames and
animated GIFs when `plot_every` and `make_animation` are enabled. Set
`solver.implementation` to `torch` or `warp` to choose the backend for the same
Euler finite-volume algorithm.
64 changes: 64 additions & 0 deletions examples/functionals/finite_volume_euler/conf/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

hydra:
job:
chdir: True
run:
dir: ./outputs_finite_volume_euler

solver:
device: cpu
implementation: torch
gamma: 1.4
cfl: 0.35
inflow_mach: 3.0
inflow_density: 1.4
inflow_pressure: 1.0
density_floor: 1.0e-6
pressure_floor: 1.0e-6
log_every: 10

cases:
- name: forward_step_2d
dimension: 2
length: 3.0
height: 1.0
step_x: 0.6
step_height: 0.2
nx: 100
ny: 40
steps: 80
plot_every: 4
make_animation: true
density_vmin: 0.6
density_vmax: 6.5

- name: forward_step_3d
dimension: 3
length: 3.0
height: 1.0
depth: 0.25
step_x: 0.6
step_height: 0.2
nx: 50
ny: 20
nz: 4
steps: 40
plot_every: 4
make_animation: true
density_vmin: 0.6
density_vmax: 6.5
Loading
Loading