Skip to content

Commit 9758164

Browse files
authored
Merge pull request #64 from NREL/sync
Restructuring of PVade
2 parents 534aa30 + 6512a0b commit 9758164

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6502
-525
lines changed

.github/workflows/test_pvade.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [ main ]
66
# branches: [ main, dev ]
77
pull_request:
8-
branches: [ main, dev ]
8+
branches: [ main, dev, sync]
99

1010
concurrency:
1111
group: ${{ github.workflow }}-${{ github.ref }}

docs/Doxyfile

Lines changed: 2854 additions & 0 deletions
Large diffs are not rendered by default.

docs/how_to_guides/installing_pvade.rst

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,121 @@ We can test the successful installation of PVade and it's MPI implementation by
4444
The example solve a Poisson's equation in 3 dimensions using 64 elements and 1 order Lagrange shape functions with cg as the ksp solver and no preconditioners.
4545
For more details about the poisson's problem we refer the use to the folowing link https://jsdokken.com/dolfinx-tutorial/chapter1/fundamentals.html
4646

47+
48+
49+
Accessing the DOLFINx programming environment on Windows: a review
50+
------------------------------------------------------------------------------
51+
52+
Current as of: May 2024.
53+
54+
[Instructions for DOLFINx](https://github.com/FEniCS/dolfinx/blob/main/README.md)
55+
56+
1. Using WSL2
57+
58+
A Windows 11 computer should have WSL natively. In a command prompt, ``wsl --status`` will tell you if you have WSL version 2, which is generally preferred.
59+
60+
To install a Ubuntu distro in WSL 2, in a command prompt, run::
61+
62+
wsl --install
63+
64+
You'll be instructed to create a username and password. After install, your prompt will be logged in to Ubuntu on WSL. You can also access this prompt in the future by searching your apps for Ubuntu.
65+
66+
In Ubuntu, follow the instructions to install the DOLFINx environment.::
67+
68+
69+
add-apt-repository ppa:fenics-packages/fenics
70+
apt update
71+
apt install fenicsx
72+
73+
74+
This may take up to an hour to install.
75+
76+
Following installation, you can access your environment by opening Ubuntu. You can use ``apt`` or ``pip`` to install any additional packages you need.
77+
If you want to access this environment in VSCode, you can use the [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl), which works very similar to remotely accessing HPC systems through SSH with the [SSH extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh).
78+
79+
I found this method to be the easiest to set up, access, and understand.
80+
81+
2. Using Docker
82+
83+
[Install](https://docs.docker.com/desktop/install/windows-install/) Docker. Docker Desktop needs a license, as NREL is a large organization. I don't know if these are available. However, a Docker Destop license is not necessary for installing a DOLFINx environment in Docker.
84+
85+
Docker uses images, which are recipes for programming environments, and containers, which are instances based on an image. Containers can be created and destroyed, entered and exited.
86+
87+
To get up and running with docker, run ::
88+
89+
docker run --name fenicsx -ti dolfinx/dolfinx:nightly
90+
91+
92+
The image, ``dolfinx/dolfinx:nightly``, can be replaced with other options listed in the instructions.
93+
In most cases I would recommend ``dolfinx/dolfinx:stable``, but I used the nightly version to avoid a bug with DOLFINx that hopefully would be resolved by the time this is relevant.
94+
95+
This instruction creates a container from the image, and the first time it is run, it also pulls the image data. This may take up to 20 minutes. If you run this command again, it will create a new container from the same image. Note that you would want to leave out or change the `--name fenicsx` tag, and that it would take far less time the second time, as the image is already pulled.
96+
97+
A container runs one command. By default, that command is to open a terminal. When you exit that terminal, the container also exits.
98+
99+
You may re-enter a Docker container by running::
100+
101+
docker start -i fenics
102+
103+
104+
Exiting and re-entering containers will keep data like files downloaded and packages installed,
105+
on top of the original image. Removing and re-creating a new container will not keep this data, only the original image.
106+
107+
To install additional packages, you may use ``pip`` while you are inside your docker container.
108+
109+
There are ways to keep files from one container to another or from your container to your local computer.
110+
There are also ways to modify and update the docker container with additional packages. I do not know them.
111+
112+
Docker works on Windows. If you understand Docker, I'd recommend using Docker for DOLFINx.
113+
If you don't, I'd recommend WSL2.
114+
115+
3. Using Conda
116+
Windows supports Miniconda and Anaconda. Current DOLFINx instructions read::
117+
118+
119+
conda create -n fenicsx-env
120+
conda activate fenicsx-env
121+
conda install -c conda-forge fenics-dolfinx mpich pyvista
122+
123+
124+
On conda-forge, pyvista supports Windows, but mpich and fenics-dolfinx do not. If that changed, you could use conda environments on Windows by:
125+
1. Installing Miniconda or Anaconda
126+
2. Opening Anaconda prompt
127+
3. Following the above instructions to create and set up the environment
128+
129+
It's unclear whether mpich and fenics-dolfinx cannot be ported to Windows, or just haven't yet been. At present, though, they aren't, so a conda DOLFINx environment through conda-forge is not possible.
130+
131+
4. Using Spack
132+
133+
Windows only technically supports spack. In theory, one would use spack on Windows according to [these instructions](https://spack.readthedocs.io/en/latest/getting_started.html#spack-on-windows). Your procedure would look like:
134+
1. Installing prerequisites VSCode with C++ compiler options, Python, Git
135+
136+
2. Cloning spack
137+
::
138+
git clone https://github.com/spack/spack.git
139+
140+
3. Opening a spack prompt, by running ``bin\spack_cmd.bat``.
141+
142+
4. Setting up spack
143+
::
144+
spack compiler find
145+
spack external find cmake
146+
spack external find ninja
147+
148+
5. Setting up your spack environment
149+
::
150+
spack env create fenicsx-env
151+
spack env activate fenicsx-env
152+
spack add fenics-dolfinx+adios2 py-fenics-dolfinx cflags="-O3" fflags="-O3"
153+
spack install
154+
155+
156+
I got no further than step 1; I couldn't find options to install VSCode with the needed C++ compiler. Many spackages are also not supported by Windows, so you likely would also not be able to run the `spack add` line in step 5.
157+
158+
Development to get spack to work on Windows is underway. Development to port the relevant spackages to Windows is not. Verdict: DOLFINx with Spack on Windows is impossible at current stages, and a pain even if possible.
159+
160+
161+
47162
On NREL HPC machine Kestrel
48163
----------------------------
49164

input/2d_cyld.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ domain:
1010
y_min: 0.0
1111
y_max: 0.41
1212
l_char: .05
13-
pv_array:
14-
stream_rows: 1 # not used
15-
elevation: 1.5 # not used
16-
stream_spacing: [7.0] # not used
17-
panel_chord: 2.0 # not used
18-
panel_span: 7.0 # not used
19-
panel_thickness: 0.1 # not used
20-
tracker_angle: 30.0 # not used
13+
# pv_array:
14+
# stream_rows: 1 # not used
15+
# elevation: 1.5 # not used
16+
# stream_spacing: 7.0 # not used
17+
# panel_chord: 2.0 # not used
18+
# panel_span: 7.0 # not used
19+
# panel_thickness: 0.1 # not used
20+
# tracker_angle: 30.0 # not used
2121
solver:
2222
dt: 0.000625
2323
t_final: 3
@@ -30,6 +30,8 @@ solver:
3030
save_text_interval: 0.1
3131
save_xdmf_interval: 0.1
3232
fluid:
33+
velocity_profile_type: parabolic
34+
inflow_coeff: 1.5307337294603591 # 4*np.sin(np.pi / 8) # only necessary/used when applying a parabolic vel profile
3335
u_ref: 2.5
3436
nu: 0.001 # Establish re = 20 with diam = 0.1 and u_bar = u_ref * (4/9)
3537
dpdx: 0.0

input/3d_cyld.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ domain:
1515
pv_array:
1616
stream_rows: 1 # not used
1717
elevation: 1.5 # not used
18-
stream_spacing: [7.0] # not used
18+
stream_spacing: 7.0 # not used
1919
panel_chord: 2.0 # not used
2020
panel_span: 7.0 # not used
2121
panel_thickness: 0.1 # not used
@@ -32,6 +32,8 @@ solver:
3232
save_text_interval: 0.1
3333
save_xdmf_interval: 0.1
3434
fluid:
35+
velocity_profile_type: parabolic
36+
inflow_coeff: 16 # only necessary/used when applying a parabolic vel profile
3537
u_ref: 0.45
3638
nu: 0.001 # Establish re = 20 with diam = 0.1 and u_bar = u_ref * (4/9)
3739
dpdx: 0.0

input/flag2d.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ general:
22
geometry_module: flag2d
33
output_dir: output/flag2d
44
mesh_only: false
5-
structural_analysis: true
6-
fluid_analysis: true
5+
structural_analysis: True
6+
fluid_analysis: True
77
domain:
88
x_min: 0.0
99
x_max: 2.5
@@ -23,16 +23,18 @@ solver:
2323
solver1_ksp: gmres
2424
solver2_ksp: gmres
2525
solver3_ksp: gmres
26-
solver4_ksp: gmres
26+
solver5_ksp: gmres
2727
solver1_pc: hypre
2828
solver2_pc: hypre
2929
solver3_pc: hypre
30-
solver4_pc: hypre
30+
solver5_pc: hypre
3131
save_text_interval: 0.02
3232
save_xdmf_interval: 0.02
3333
fluid:
34+
velocity_profile_type: parabolic
35+
inflow_coeff: 6 # only necessary/used when applying a parabolic vel profile
3436
u_ref: 1.0 # 0.2 1.0 2.0
35-
time_varying_inflow_bc: true
37+
time_varying_inflow_window: 2.0
3638
rho: 1000.0 # 0.2 1.0 2.0
3739
nu: 0.001 # Establish re = 20 with diam = 0.1 and u = u_ref
3840
dpdx: 0.0

input/heated_panels2d.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
general:
2+
geometry_module: panels2d
3+
output_dir: output/heatedpanels2d
4+
mesh_only: false
5+
structural_analysis: True
6+
fluid_analysis: True
7+
thermal_analysis: True
8+
debug_flag: True
9+
domain:
10+
x_min: -10
11+
x_max: 75
12+
y_min: 0
13+
y_max: 20
14+
l_char: 0.1
15+
pv_array:
16+
stream_rows: 8
17+
elevation: 1.5
18+
stream_spacing: 5.0
19+
panel_chord: 2.0
20+
panel_span: 7.0
21+
panel_thickness: 0.1
22+
tracker_angle: 30.
23+
solver:
24+
dt: .01
25+
t_final: 60.0
26+
solver1_ksp: gmres
27+
solver2_ksp: cg
28+
solver3_ksp: cg
29+
solver4_ksp: gmres
30+
solver1_pc: jacobi
31+
solver2_pc: jacobi
32+
solver3_pc: jacobi
33+
solver4_pc: lu
34+
save_text_interval: 0.01 # must be same as or bigger than dt
35+
save_xdmf_interval: 0.01
36+
fluid:
37+
velocity_profile_type: uniform # loglaw
38+
time_varying_inflow_window: 0.0
39+
initialize_with_inflow_bc: true
40+
u_ref: 1.0
41+
nu: 0.001 #15.89e-5 #0.001
42+
g: 9.81
43+
beta: 0.00333
44+
alpha: 2.25e-05 # high Pe # 0.00225 # low Pe (no stability needed) #
45+
turbulence_model:
46+
periodic: false
47+
bc_y_max: slip # slip noslip free
48+
bc_y_min: noslip # slip noslip free
49+
T_ambient: 300.0
50+
T_bottom: 320.0
51+
T0_panel: 320.0
52+
structure:
53+
dt : .01 # 0.002
54+
# rho : 10000.0
55+
# rho : 10000.0 # 10000.0
56+
poissons_ratio: 0.3
57+
elasticity_modulus: 1.0e+05
58+
body_force_x: 0
59+
body_force_y: -1
60+
body_force_z: 0 #100
61+
bc_list: ["left"]
62+
motor_connection: False
63+
tube_connection: False
64+
beta_relaxation: 0.005
65+
66+
# elasticity_modulus: 1.0e+09
67+
# poissons_ratio: 0.3
68+
# body_force_x: 0
69+
# body_force_y: 0
70+
# bc_list: ["left"]

input/inflow_input.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
general:
2+
geometry_module: flag2d
3+
output_dir: output/inflow
4+
mesh_only: false
5+
structural_analysis: true
6+
fluid_analysis: true
7+
domain:
8+
x_min: 0.0
9+
x_max: 2.5
10+
y_min: 0.0
11+
y_max: 0.41
12+
l_char: 0.006 # .01
13+
pv_array:
14+
panel_chord: 0.35 # Sets the length of the flag (starts outside circle radius)
15+
# panel_chord: 0.0 # Sets the length of the flag (starts outside circle radius)
16+
panel_span: 0.01 # Sets the radius of the flag pole
17+
panel_thickness: 0.02 # Sets the thickness of the flag
18+
span_rows: 1
19+
stream_rows: 1
20+
elevation: 0.205
21+
solver:
22+
dt: 0.001 # 0.002
23+
t_final: 4.0
24+
solver1_ksp: gmres
25+
solver2_ksp: gmres
26+
solver3_ksp: gmres
27+
solver4_ksp: gmres
28+
solver1_pc: hypre
29+
solver2_pc: hypre
30+
solver3_pc: hypre
31+
solver4_pc: hypre
32+
save_text_interval: 0.001 # 0.02
33+
save_xdmf_interval: 0.001 # 0.02
34+
fluid:
35+
velocity_profile_type: parabolic #loglaw
36+
inflow_coeff: 6 # only necessary/used when applying a parabolic vel profile
37+
u_ref: 4.0 # 0.2 1.0 2.0
38+
z0: 0.005 #m
39+
d0: 0.05 #m
40+
time_varying_inflow_window: 0.0
41+
initialize_with_inflow_bc: true
42+
rho: 1000.0 # 0.2 1.0 2.0
43+
nu: 0.001 # Establish re = 20 with diam = 0.1 and u = u_ref
44+
dpdx: 0.0
45+
turbulence_model: null
46+
periodic: false
47+
bc_y_max: noslip # slip noslip free
48+
bc_y_min: noslip # slip noslip free
49+
# warm_up_time: 0.25 # slip noslip free
50+
structure:
51+
dt : 0.001 # 0.002
52+
# rho : 10000.0
53+
rho : 10000.0 # 10000.0
54+
poissons_ratio: 0.4
55+
elasticity_modulus: 1.4e+06
56+
body_force_x: 0
57+
body_force_y: 0
58+
body_force_z: 0 #100
59+
bc_list: ["left"]
60+
motor_connection: False
61+
tube_connection: False
62+
beta_relaxation: 0.005
63+

0 commit comments

Comments
 (0)