Skip to content

Commit d8cacea

Browse files
committed
Merge branch 'develop' of https://github.com/feelpp/book.feelpp.org into develop
2 parents f8dbab5 + eea1686 commit d8cacea

File tree

19 files changed

+206
-37
lines changed

19 files changed

+206
-37
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ jobs:
1616
# python-version: '3.10'
1717
# cache: 'pip' # caching pip dependencies
1818
- name: Python install
19-
run: pip install -r requirements.txt
19+
run: |
20+
python -m venv --system-site-packages .venv
21+
source .venv/bin/activate
22+
pip install -r requirements.txt
2023
- name: Npm Install
2124
run: |
2225
npm i
@@ -27,7 +30,9 @@ jobs:
2730
asciidoctor -v
2831
2932
- name: Build
30-
run: npm run antora
33+
run: |
34+
source .venv/bin/activate
35+
npm run antora
3136
env:
3237
FEELPP_GITHUB_TOKEN: ${{ secrets.DOCS_GITHUB_KEY }}
3338
GITHUB_OAUTH: ${{ secrets.DOCS_GITHUB_KEY }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ jupyter/
3838
/**/node_modules/
3939
/**/build/
4040
/**/feelppdb/
41+
/**/toto/
42+
/**/*DS_Store
43+
Loading
Loading

docs/mor/modules/ROOT/nav.adoc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +0,0 @@
1-
* xref:toolboxmor.adoc[ToolboxMor]
2-
** xref:toolboxmor.adoc#_creating_a_model_from_scratch[Creating a model from scratch]
3-
** xref:toolboxmor.adoc#_creating_a_model_from_a_toolbox[Creating a model from a toolbox]
4-
** xref:toolboxmor.adoc#_configuration[Configuration]
5-
* xref:pbdw.adoc[PBDW]
6-
** xref:pbdw.adoc#_sensors[Sensors]
7-
** xref:pbdw.adoc#_using_pbdw[Using PBDW]
8-
* xref:index.adoc#_cases[Cases]
9-
** xref:opusheat:index.adoc[OpusHeat]
10-
** xref:thermalfin:index.adoc[ThermalFin]
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
= Model Order Reduction
2+
:page-layout: case-study
3+
:page-tags: toolbox
24

35
Welcome to the documentation of the Feel++ Model Order Reduction.
46

5-
== Introduction
6-
7-
Feel++ provides a framework for model order reduction. +
8-
One easy way to use it, is to use the xref:toolboxmor.adoc[ToolboxMor] class.
9-
10-
The Parametrized Background Data Weak (xref:pbdw.adoc[PBDW]) method has also been implemented in Feel++.
11-
12-
== Cases
13-
14-
- xref:opusheat:index.adoc[OpusHeat]
15-
- xref:thermalfin:index.adoc[ThermalFin]

docs/mor/modules/opusheat/pages/index.adoc renamed to docs/mor/modules/ROOT/pages/opusheat/index.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
= Opus Heat
2+
:page-tags: case
3+
:page-illustration: opusheat/eads_geometry.png
4+
:description: We consider a reduced 2D model of the surroundings of an electronic component submitted to a cooling air flow.
5+
26

37
This test case has been proposed by mailto:[email protected][Annabelle Le-Hyaric] and
48
mailto:[email protected][Michel Fouquembergh] formerly at AIRBUS.
@@ -28,7 +32,7 @@ stem:[k_1] and stem:[k_2] are parameters of the model.
2832

2933
ICs dissipate heat, so the volumic heat dissipated stem:[Q_1] and stem:[Q_2] are also parameters of the model, while stem:[Q_3=Q_4=0].
3034

31-
image::eads_geometry.png[]
35+
image::opusheat/eads_geometry.png[]
3236

3337
One should notice that the convection term in heat transfer equation
3438
may lead to spatial oscillations which can be overcome by

docs/mor/modules/ROOT/pages/pbdw.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
= Parametrized Background Data Weak
2+
:page-tags: manual
3+
:description: PBDW manual
4+
:page-illustration: pass:[toolboxes::manual.svg]
25

36
== Sensors
47

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
= Thermal simulation of 3D building
2+
:stem: latexmath
3+
:page-tags: case
4+
:page-illustration: thermalbuilding/3d_building.png
5+
:description: We create a reduced order model for the thermal simulation of a 3D building using the stationary heat equation.
6+
:uri-data: https://github.com/feelpp/feelpp/blob/develop/mor/examples/thermalbuilding/
7+
8+
== Description
9+
10+
Based on the solution of the stationary heat equation, we create a reduced order model for the simulation of heat exchanges in a 3D building.
11+
12+
The building is composed of a corridor and 5 rooms, each of which contains a heating unit. Internal walls and doors are modelled as having finite thickness, while external walls properties (thickness and insulation) are encoded in the boundary conditions of the problem.
13+
14+
// Image
15+
16+
=== Mathematical model
17+
18+
Let stem:[\Omega \subset \mathbb{R}^3] be the region occupied by the building, and denote stem:[\Omega_i], stem:[i=0,1,2] its subregions occupied by the air, the internal walls and the internal doors, such that stem:[\Omega = \cup_{i=0}^2 \Omega_i]. Let stem:[k_i] be the thermal conductivities associated with the subregions.
19+
20+
The external boundary of the domain stem:[\partial \Omega] is decomposed into two parts: stem:[\partial \Omega_{ext}], which corresponds to external walls, and stem:[\partial \Omega_D] which corresponds to the front door. We denote by stem:[\Gamma_i] the boundary of the stem:[i-]th heating unit, stem:[i=0,...,4]. The problem writes as
21+
22+
[stem]
23+
++++
24+
\begin{equation}
25+
\begin{aligned}
26+
- \nabla \cdot (k_i\nabla u) &= 0, \quad &\text{on }\Omega_i \\
27+
u &= \mu_i \quad &\text{on }\Gamma_i, i=0,...,4, \\
28+
- k_0 \nabla u \cdot \vec{n} &= \mu_6 (u - \mu_5), \quad &\text{on }\partial \Omega_{ext},\\
29+
- k_0 \nabla u \cdot \vec{n} &= \sigma (u - \mu_5), \quad &\text{on }\partial \Omega_{D}.
30+
\end{aligned}
31+
\end{equation}
32+
++++
33+
where stem:[\sigma] is the convective heat exchange coefficient associated with the front door.
34+
35+
The parameters stem:[\mu_i] correspond to
36+
37+
* stem:[\mu_i \in (300,340)], for stem:[i=0,...,4], are the surface temperatures of the heating units (in Kelvin);
38+
* stem:[\mu_5 \in (270,290)] is the external temperature (in Kelvin);
39+
* stem:[\mu_6] is a function of the external wall thickness. The wall is composed of two layers: a cinder layer of thickness stem:[l_{cinder} \in (0.1,0.3) m] and an insulation layer of thickness stem:[l_{insulation} \in (0.1,0.2) m], and
40+
41+
[stem]
42+
++++
43+
\mu_6 = \frac{1}{0.06 + \frac{0.01}{0.5} + \frac{l_{cinder}}{0.8} + \frac{l_{insulation}}{0.032} + \frac{0.016}{0.313} + 0.14}.
44+
++++
45+
46+
=== Construction of the affine decomposition
47+
48+
The problem presents an affine dependence on the parameters, hence we can explicity compute the terms of the correspondent affine decomposition
49+
50+
[stem]
51+
++++
52+
\sum_{i = 0}^{N_A} \theta^A_i(\mu) A_i(u,v) = \sum_{j = 0}^{N_F} \theta^F_j(\mu) F_j(v),
53+
++++
54+
where stem:[N_A = 1] and stem:[N_F = 6].
55+
56+
The first product on the left-hand side is given by stem:[\theta^A_0(\mu) = 1] and
57+
58+
[stem]
59+
++++
60+
\begin{equation}
61+
\begin{aligned}
62+
A_0(u,v) &= \sum_{i=0}^{N_m} \int_{\Omega_i} k_i \nabla u \cdot \nabla v + \\
63+
& - \int_{\partial \Omega_{ext}} k_0 (\nabla u v + \nabla v u )\cdot \vec{n} + \\
64+
& + \int_{\partial \Omega_{ext}} k_0 \frac{\gamma}{h} u v +\\
65+
& + \int_{\partial \Omega_D} uv,
66+
\end{aligned}
67+
\end{equation}
68+
++++
69+
70+
where stem:[\gamma] is the Nitsche penalty parameter and stem:[h] is the local mesh size.
71+
72+
The second product is given by stem:[\theta^A_1(\mu) = \mu_6] and
73+
74+
[stem]
75+
++++
76+
A_1(u,v) = \int_{\partial \Omega_{ext}} u v.
77+
++++
78+
79+
The terms on the right-hand side are stem:[\theta^F_i(\mu) = \mu_i] for stem:[i=0,...,4], corresponding to the temperatures of the heating units, stem:[\theta^F_5(\mu) = \mu_5\mu_6], corresponding to the temperature on the internal surface of the external walls, and stem:[\theta^F_6(\mu) = \mu_5], corresponding to the external temperature. The corresponding linear forms are
80+
81+
[stem]
82+
++++
83+
\begin{equation}
84+
\begin{aligned}
85+
F_i (v) &= k_0 \int_{\Gamma_i} -\nabla v \cdot \vec{n} + \frac{\gamma}{h} v, \quad i = 0,...,4\\
86+
F_5 (v) &= \int_{\partial \Omega_{ext}} v,\\
87+
F_6 (v) &= \int_{\partial \Omega_D} \sigma v.
88+
\end{aligned}
89+
\end{equation}
90+
++++
91+
92+
=== Geometry
93+
94+
image::thermalbuilding/heat_3d.png[]
95+
96+
The geometry file can be found in Github link:{uri-data}/thermalbuilding/thermalbuilding.geo[here].
97+
98+
== Output
99+
100+
The output corresponds to the air mean temperature, and it is computed as
101+
102+
[stem]
103+
++++
104+
\begin{equation}
105+
s(\mu) = \frac{1}{|\Omega_0|} \int_{\Omega_0} u.
106+
\end{equation}
107+
++++
108+
109+
== Parameters
110+
111+
The table displays the various fixed and variables parameters of this test-case.
112+
113+
.Table of model order reduction parameters
114+
[width="100%"]
115+
|=======================================================================
116+
| Name | Description | Range | Units
117+
| stem:[\mu_0] | Heater temperature living room | stem:[[300,340]] | stem:[K]
118+
| stem:[\mu_1] | Heater temperature kitchen | stem:[[300,340]] | stem:[K]
119+
| stem:[\mu_2] | Heater temperature bedroom 1 | stem:[[300,340]] | stem:[K]
120+
| stem:[\mu_3] | Heater temperature bedroom 2 | stem:[[300,340]] | stem:[K]
121+
| stem:[\mu_4] | Heater temperature bathroom | stem:[[300,340]] | stem:[K]
122+
| stem:[\mu_5] | External temperature | stem:[[270,290]] | stem:[K]
123+
| stem:[\mu_6] | Exchange coefficient external walls | |
124+
|=======================================================================
125+
126+
.Table of constant parameters
127+
[width="100%"]
128+
|=======================================================================
129+
| Name | Description | Range | Units
130+
| stem:[\gamma] | Boundary conditions using Nitsche method | stem:[[10]] |
131+
| stem:[\k_0] | Air conductivity | stem:[1] |
132+
| stem:[\k_1] | Conductivity - internal walls | stem:[0.25] |
133+
| stem:[\k_2] | Conductivity - internal doors | stem:[0.13] |
134+
| stem:[\sigma] | Heat transfer coefficient - front door | stem:[\frac{1.0}{0.06+\frac{0.06}{0.150}+\frac{0.1}{0.029}+0.14}] |
135+
|=======================================================================
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
= Thermal fin
2+
:page-tags: case
3+
:page-illustration: pass:[toolboxes::wip/wip-1.svg]
4+
:description: Work in progress.
5+
6+
The redaction of this page is in progress.

docs/mor/modules/ROOT/pages/toolboxmor.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
= ToolboxMor
2+
:page-tags: manual
3+
:description: ToolboxMor manual
4+
:page-illustration: pass:[toolboxes::manual.svg]
25

36
ToolboxMor is a class aiming to ease the use of the model order reduction framework of Feel++.
47
Usually, you would need to define a class which would handle the initialization of the model, its affine decomposition and possibly the use of the EIM methods.

docs/mor/modules/opusheat/nav.adoc

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/mor/modules/thermalfin/nav.adoc

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/mor/modules/thermalfin/pages/index.adoc

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/user/modules/python/pages/pyfeelpp/filters.adoc

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@ In this 2D and 3D example, we
1717
[%dynamic,python]
1818
----
1919
import feelpp
20-
import sys
20+
import sys,os
21+
import spdlog as spd
22+
from feelpp.timing import tic, toc
23+
24+
logger = spd.ConsoleLogger('Logger', False, True, True)
25+
logger.set_level(spd.LogLevel.TRACE)
26+
27+
tic()
2128
app = feelpp.Environment(["myapp"],config=feelpp.localRepository("")) # <1>
29+
toc("init Feel++")
30+
31+
logger.info(f"Feel++ version: {feelpp.Info.version()}")
2232
----
2333
<1> The {feelpp} environment is initiated with the name of the application and the path to the local repository where the results will be stored.
2434

@@ -27,18 +37,23 @@ app = feelpp.Environment(["myapp"],config=feelpp.localRepository("")) # <1>
2737
app.setLogVerbosityLevel(0) # <1>
2838
geofilename=feelpp.download( "github:{repo:feelpp,path:feelpp/quickstart/laplacian/cases/feelpp2d/feelpp2d.geo}", worldComm=app.worldCommPtr() )[0]
2939

40+
tic()
3041
mesh = feelpp.load(feelpp.mesh(dim=2,realdim=2), name=geofilename, h=0.1, verbose=1) # <2>
42+
toc("load mesh")
43+
logger.info(f"mesh loaded")
3144

3245
Xh=feelpp.functionSpace(mesh=mesh,space="Pch",order=1) # <3>
3346
P0h=feelpp.functionSpace(mesh=mesh,space="Pdh",order=0) # <4>
3447
u=Xh.element() # <5>
3548
u.on(range=feelpp.elements(mesh), expr=feelpp.expr("sin(2*pi*x)*cos(pi*y):x:y")) # <6>
49+
logger.info(f"functionspace built and u created")
3650
3751
e = feelpp.exporter(mesh=mesh) # <7>
3852
e.add("a_scalar", 1.) # <8>
3953
e.add("u",u) # <9>
4054
e.add("pid",feelpp.pid( P0h )) # <10>
4155
e.save() # <11>
56+
logger.info(f"export done")
4257
----
4358
<1> The verbosity level is set to 0 (only `VLOG(level)` with `level <= 0` are displayed)
4459
<2> The mesh is loaded from the {uri-github-feelpp} repository
@@ -70,12 +85,24 @@ def pv_get_mesh(mesh_path):
7085
mesh = reader.read()
7186
return mesh
7287
73-
def pv_plot(mesh, field="u", clim=None, cmap='viridis', cpos='xy', show_scalar_bar=True, show_edges=True):
74-
mesh.plot(scalars=field, clim=clim, cmap=cmap, cpos=cpos, show_scalar_bar=show_scalar_bar, show_edges=show_edges)
75-
7688
plotter = pv.Plotter()
89+
plotter.show_axes()
7790
mesh = pv_get_mesh(f"exports/ensightgold/Exporter/Exporter.case")
7891
plotter.add_mesh(mesh, scalars="u", clim=None, cmap="viridis", show_scalar_bar=True, show_edges=True)
92+
plotter.camera_position = 'xy'
93+
axes = pv.create_axes_marker(
94+
line_width=4,
95+
ambient=0.0,
96+
x_color="#378df0",
97+
y_color="#ab2e5d",
98+
z_color="#f7fb9a",
99+
xlabel="X Axis",
100+
ylabel="Y Axis",
101+
zlabel="Z Axis",
102+
label_size=(0.1, 0.1), label_color="#aaaaaa",
103+
)
104+
plotter.add_actor(axes)
105+
79106
plotter.show()
80107
----
81108

lib/dynamic-notebook.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ sys.stdout.write(plotter.export_html(None).getvalue())`)
9393
let source = response[index].stdout.toString('utf8')
9494
if (block.isOption('raw')) {
9595
if (block.getAttribute('output') === 'pyvista') {
96+
logger.debug(source)
9697
source = source.replace(pyvistaContainerRx, `var container = document.getElementById('pyvista-${index}')`)
9798
source = source.replace(pyvistaFaviconRx, '')
9899
const found = source.match(pyvistaScriptRx)

requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ pyvista
22
xvfbwrapper
33
ipykernel
44
pythreejs
5-
plotly
5+
plotly
6+
trame-vtk
7+
trame
8+
spdlog

site-dev.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ site:
22
title: Feel++ // Docs
33
url: https://docs.feelpp.org
44
start_page: home::index.adoc
5+
runtime:
6+
log:
7+
level: debug
58
content:
69
sources:
710
- url: ./
@@ -74,9 +77,9 @@ content:
7477
- url: ./
7578
branches: develop
7679
start_path: docs/salome/
77-
- url: ../Antora/antora-ui
78-
branches: mais
79-
start_path: docs/
80+
# - url: ../Antora/antora-ui
81+
# branches: mais
82+
# start_path: docs/
8083
# - url: ./
8184
# branches: mor-module
8285
# start_path: docs/mor/

0 commit comments

Comments
 (0)