Skip to content

Commit 9fcdeeb

Browse files
Merge pull request #38 from aurora-multiphysics/hsaunders1904/26_update_readme_documentation
Update documentation
2 parents da48ba4 + 31acb9a commit 9fcdeeb

File tree

11 files changed

+724
-12
lines changed

11 files changed

+724
-12
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
git config --global --add safe.directory "$GITHUB_WORKSPACE"
2424
pre-commit install
2525
SKIP=no-commit-to-branch pre-commit run --all
26+
2627
- name: Build
2728
shell: bash
2829
run: |
@@ -36,9 +37,36 @@ jobs:
3637
3738
# Build hippo
3839
make -j
40+
3941
- name: Test
4042
shell: bash
4143
run: |
4244
. /opt/openfoam/OpenFOAM-12/etc/bashrc || true
4345
pip install -r requirements.test.txt
4446
./run_tests
47+
48+
- name: Docs
49+
shell: bash
50+
run: |
51+
. /opt/openfoam/OpenFOAM-12/etc/bashrc || true
52+
cd doc
53+
./moosedocs.py build --destination=htmldoc
54+
[ -f htmldoc/index.html ]
55+
56+
- name: Artifact docs
57+
id: deployment
58+
uses: actions/upload-pages-artifact@v3
59+
with:
60+
path: doc/htmldoc
61+
62+
deploy-docs:
63+
runs-on: ubuntu-latest
64+
if: ${{ github.event_name == 'push' && github.ref == 'main' }}
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
needs: build-test
69+
steps:
70+
- name: Deploy to GitHub Pages
71+
id: deployment
72+
uses: actions/deploy-pages@v4

README.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# hippo
22

3-
Moose app that wraps OpenFOAM buoyantFoam solver.
3+
Hippo is a MOOSE app wrapping OpenFOAM's fluid solver.
4+
It provides tools for solving coupled conjugate heat transfer problems.
5+
6+
Some simple 1 and 2D validation cases can be found in
7+
[the tests](https://github.com/aurora-multiphysics/hippo/tree/main/test/tests/multiapps).
48

59
## Install/Build
610

@@ -78,7 +82,9 @@ METHOD=dbg make
7882

7983
## Tests
8084

81-
Some basic tests can be run with `./run_tests`.
85+
Hippo's tests are written using MOOSE's
86+
[test harness system](https://mooseframework.inl.gov/python/TestHarness.html).
87+
Just run `./run_tests`.
8288

8389
Note that you must have the required Python packages installed:
8490

@@ -112,15 +118,43 @@ git commit --no-verify
112118
## Notes
113119

114120
This is a work in progress.
115-
So far hippo can:
121+
So far, Hippo can:
122+
123+
- Create a 2D MOOSE boundary mesh from the boundary of an OpenFOAM mesh.
124+
- Run a fluid solver case via a MOOSE input file.
125+
- Transfer temperatures and or heat fluxes from an OpenFOAM mesh to
126+
the MOOSE boundary mesh.
127+
- Set OpenFOAM temperature field boundary conditions
128+
using values from a MOOSE mesh.
129+
130+
### Floating Point Error Trapping
131+
132+
If you have floating point error (FPE) trapping enabled in OpenFOAM,
133+
you may run into errors when running Hippo.
134+
135+
Hippo input files that run a MOOSE case do not require a Kernel or variables.
136+
However, MOOSE will still happily go off and calculate a residual.
137+
Since there are no variables defined,
138+
the residual calculation results in a division by vero and an FPE signal.
139+
OpenFOAM will catch this signal and abort the application.
140+
141+
There are two workarounds for this problem:
142+
143+
1. Disable trapping for floating point exceptions.
144+
`unset FOAM_SIGFPE && unset FOAM_SETNAN`.
116145

117-
- Create a moose mesh from the boundary of an openfoam mesh
118-
- Can run an buoyantFOAM case via moose
119-
- Transfer temperature from faces of openfoam mesh to nodes of Moose mesh
146+
2. Add a dummy variable to the MOOSE input file.
147+
E.g.,
120148

121-
> *Note: When running in parallel add `--keep-cout` to the command line
122-
> because OpenFOAM will crash if a process fails to write to stdout*
149+
```toml
150+
[Variables]
151+
[dummy]
152+
initial_value = 999
153+
[]
154+
[]
155+
```
123156

124157
"Fork hippo" to create a new MOOSE-based application.
125158

126-
For more information see: [http://mooseframework.org/create-an-app/](http://mooseframework.org/create-an-app/)
159+
For more information see:
160+
[http://mooseframework.org/create-an-app/](http://mooseframework.org/create-an-app/)

doc/content/developer_guide.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
This page contains information to aid in development of Hippo.
44

5+
## Documentation
6+
7+
The project uses the MOOSE docs system to generate its HTML documentation.
8+
The HTML artifacts are generated and deployed within Hippo's CI.
9+
The CI pipeline is run on any pull request
10+
and also on a push to `main` (i.e., a merged pull request).
11+
The documentation pages are always built,
12+
however they are only deployed on a push to `main`.
13+
514
## Docker
615

716
The Dockerfile `docker/Dockerfile` contains the build definition for
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
[Mesh]
2+
[solid]
3+
type = GeneratedMeshGenerator
4+
boundary_name_prefix = solid
5+
dim = 3
6+
7+
nx = 161
8+
xmin = 0
9+
xmax = 1
10+
11+
ny = 16
12+
ymin = -0.25
13+
ymax = 0
14+
15+
nz = 1
16+
zmin = 0
17+
zmax = 0.4
18+
19+
# Calculated here:
20+
# https://openfoamwiki.net/index.php/Scripts/blockMesh_grading_calculation
21+
# Based on a grading factor of 5 and 161 elements.
22+
bias_x = 1.010109749
23+
[]
24+
[]
25+
26+
[Variables]
27+
[temp]
28+
family = LAGRANGE
29+
order = FIRST
30+
initial_condition = 310
31+
[]
32+
[]
33+
34+
[Kernels]
35+
[heat-conduction]
36+
type = HeatConduction
37+
variable = temp
38+
[]
39+
[heat-conduction-dt]
40+
type = HeatConductionTimeDerivative
41+
variable = temp
42+
[]
43+
[]
44+
45+
[BCs]
46+
[fixed_temp]
47+
type = DirichletBC
48+
variable = temp
49+
boundary = solid_bottom
50+
value = 310
51+
[]
52+
53+
# Use the fluid wall temperature as a matched value boundary condition.
54+
[fluid_interface]
55+
type = MatchedValueBC
56+
variable = temp
57+
boundary = solid_top
58+
v = fluid_wall_temperature
59+
[]
60+
[]
61+
62+
[Materials]
63+
# The example specifies that the thermal diffusivity of the solid should
64+
# be α = 1 m2/s, and the thermal conductivity should be k = 100 W/(m.K).
65+
#
66+
# We know α = k/(ρ.Cp), where k is thermal conductivity, Cp is specific
67+
# heat capacity, and ρ is density.
68+
#
69+
# Hence we require that ρ.Cp = k = 100.
70+
[thermal-conduction]
71+
type = HeatConductionMaterial
72+
thermal_conductivity = 100.0 # W/(m.K)
73+
specific_heat = 0.5 # J/(kg.K)
74+
[]
75+
[thermal-density]
76+
type = GenericConstantMaterial
77+
prop_names = 'density'
78+
prop_values = 200.0 # kg/m3
79+
[]
80+
[]
81+
82+
[AuxVariables]
83+
[wall_heat_flux]
84+
family = MONOMIAL
85+
order = CONSTANT
86+
initial_condition = 0
87+
[]
88+
89+
# Add an AuxVariable to store the wall temperature of the fluid domain.
90+
[fluid_wall_temperature]
91+
family = LAGRANGE
92+
order = FIRST
93+
initial_condition = 0
94+
[]
95+
[]
96+
97+
[AuxKernels]
98+
[heat_flux_aux]
99+
type = HeatFluxAux
100+
variable = wall_heat_flux
101+
thermal_conductivity = 100 # W/(m.K)
102+
T = temp
103+
boundary = 'solid_top'
104+
[]
105+
[]
106+
107+
[MultiApps]
108+
[hippo]
109+
type = TransientMultiApp
110+
app_type = hippoApp
111+
execute_on = timestep_begin
112+
input_files = 'fluid.i'
113+
[]
114+
[]
115+
116+
[Transfers]
117+
# Copy the wall temperature from the fluid into an AuxVariable.
118+
[wall_temperature_from_fluid]
119+
type = MultiAppGeometricInterpolationTransfer
120+
source_variable = fluid_wall_temp
121+
from_multi_app = hippo
122+
variable = fluid_wall_temperature
123+
execute_on = same_as_multiapp
124+
[]
125+
126+
# Copy the heat flux from the 'wall_heat_flux' aux variable into the
127+
# multiapp.
128+
# Remember we marked the 'solid_heat_flux' variable in 'fluid.i' to be
129+
# used as a heat flux boundary condition on the OpenFOAM solve.
130+
[heat_flux_to_fluid]
131+
type = MultiAppGeometricInterpolationTransfer
132+
source_variable = wall_heat_flux
133+
to_multi_app = hippo
134+
variable = solid_heat_flux
135+
execute_on = same_as_multiapp
136+
[]
137+
[]
138+
139+
[Executioner]
140+
type = Transient
141+
start_time = 0
142+
end_time = 10
143+
dt = 0.025
144+
145+
fixed_point_abs_tol = 1e-7
146+
fixed_point_rel_tol = 1e-8
147+
148+
solve_type = 'PJFNK'
149+
petsc_options = '-snes_ksp_ew'
150+
petsc_options_iname = '-pc_type -pc_hypre_type'
151+
petsc_options_value = 'hypre boomeramg'
152+
nl_abs_tol = 1e-7
153+
nl_rel_tol = 1e-8
154+
[]
155+
156+
[Outputs]
157+
exodus = true
158+
[]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[Mesh]
2+
type = FoamMesh
3+
case = 'fluid-openfoam' # the directory of the OpenFOAM case
4+
foam_patch = 'interface' # the name of the coupled boundary
5+
[]
6+
7+
[AuxVariables]
8+
[fluid_wall_temp]
9+
family = MONOMIAL
10+
order = CONSTANT
11+
initial_condition = 300
12+
[]
13+
[solid_heat_flux]
14+
family = MONOMIAL
15+
order = CONSTANT
16+
initial_condition = 0
17+
[]
18+
[]
19+
20+
[Problem]
21+
type = FoamProblem
22+
# Take the heat flux from MOOSE and set it on the OpenFOAM mesh.
23+
heat_flux = solid_heat_flux
24+
# Take the boundary temperature from OpenFOAM and set it on the MOOSE mesh.
25+
foam_temp = fluid_wall_temp
26+
[]
27+
28+
[Executioner]
29+
type = Transient
30+
start_time = 0
31+
end_time = 10
32+
dt = 0.025
33+
34+
[TimeStepper]
35+
type = FoamTimeStepper
36+
[]
37+
[]
78.8 KB
Loading

doc/content/images/step_by_step/setup.svg

Lines changed: 4 additions & 0 deletions
Loading

doc/content/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ A MOOSE multiapp wrapping OpenFOAM for conjugate heat transfer problems.
88

99
Build instructions can be found in the repository's README.
1010

11+
## Setting Up a Case
12+
13+
See a step-by-step example in [this guide](step_by_step.md).
14+
1115
## Developer Guide
1216

1317
See [here](developer_guide.md) for developer documentation.

0 commit comments

Comments
 (0)