Skip to content

Commit

Permalink
Merge branch 'vale-fixes' into 'master'
Browse files Browse the repository at this point in the history
[vale] Fixed all issues

See merge request ogs/ogs!4686
  • Loading branch information
endJunction committed Jul 21, 2023
2 parents 4595e22 + e0e9794 commit ef05d75
Show file tree
Hide file tree
Showing 58 changed files with 420 additions and 307 deletions.
9 changes: 6 additions & 3 deletions .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Packages = Hugo
[*.md]
BasedOnStyles = Vale, write-good, ogs
Vale.Spelling = None
write-good.ThereIs = suggestion
write-good.ThereIs = None
write-good.Passive = None
write-good.TooWordy = None
write-good.Weasel = None
Expand All @@ -21,7 +21,10 @@ TokenIgnores = \
; (\\ref\s\S+(\s"\S*")?), \
; (\\subpage\s\S*), \
; (\\copydoc\s\S*), \
(\$+[^\n$]+\$+), \
(\$[^\n$]+\$), \
(\\\S*|\{\S*\}), \
(\w*\set\sal)
(\w*\set\sal), \
({{<\s?(rel)?ref (.*)>}})

# https://regex101.com/r/QWLhgT/1 helped me generating this one:
BlockIgnores = (?s) *(\$\$.*?\$\$)
8 changes: 8 additions & 0 deletions Documentation/.vale/.vale-config/0-Hugo.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[*.md]
# Exclude `{{< ... >}}`, `{{% ... %}}`, [Who]({{< ... >}})
TokenIgnores = ({{[%<] .* [%>]}}.*?{{[%<] ?/.* [%>]}}), \
(\[.+\]\({{< .+ >}}\))

# Exclude `{{< myshortcode `This is some <b>HTML</b>, ... >}}`
BlockIgnores = (?sm)^({{[%<] [^{]*? [%>]}})\n$, \
(?s) *({{< highlight [^>]* ?>}}.*?{{< ?/ ?highlight >}})
25 changes: 22 additions & 3 deletions Documentation/.vale/Vocab/ogs/accept.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
Alcolea
Algolia
Aluminol
Alves
Atteia
Autolinks
BC[s?]
Beier
BGR[a?]
BHE[s?]
Bincrafters
biokinetic
Biot
Expand All @@ -14,6 +18,7 @@ Bruns
CLion
Dalen
Degener
DEM[s?]
devguide
Diao
Diersch
Expand All @@ -29,34 +34,37 @@ Eskilson
Everton
Fancybox
FancyBox
FEFLOW
Feldspars
fmt
Forchheimer
Fortran
Francesco
frontmatter
Galerkin
Genuchten
Geoenergy
Galerkin
Giraldo
gml
GML
Gmsh
Gnielinski
Goswami
Guo
Heidemann
Homebrew
Horner
HTTPS
IPhreeqc
ipynb
ipyvtklink
Jacobian
Johannsen
Jong
Jupyter
Jupytext
Juwels
Kinzelbach
Kitware
Kolditz
Laloui
Langergraber
Expand All @@ -68,9 +76,11 @@ Massmann
Matplotlib
meshio
METIS
MFront
Mikelic
Mises
MODFLOW
MTest
nbconvert
nbdime
Netbeans
Expand All @@ -87,7 +97,9 @@ parameteri[zs]ation
ParaView
Parisio
partmesh
PDE[s?]
Péclet
PETSc
PHREEQC
Pinheiro
Prandtl
Expand All @@ -98,6 +110,7 @@ pvpython
PVTU
Quadro
Quirijn
Ramey
recondensation
relref
Revista
Expand All @@ -107,13 +120,16 @@ Rossendorf
Ruehaak
Scheidegger
semianalytical
SGrid
Shao
shortcode
Snakemake
Srivastava
ST[s?]
Stauffer
Stauffer
stdout
stepping[s?]
storativity
Tarok
Taucha
Expand All @@ -122,16 +138,19 @@ TESPy
Theis
Thuringia
Thuringian
TODO[s?]
Ucar
Unlicense
Unstrut
Vogel
Vogels
vtkdiff
VTU
VTK[s?]
VTUinterface
Witte
Xcode
Xeon
XPath
Youngs
Zenodo
zlib
6 changes: 6 additions & 0 deletions Documentation/.vale/Vocab/ogs/ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ thermomechanics
undeformed
voxel
wellbore
expansivity
simplices
orthotropic
tetrahedralization
cmake
ctest
2 changes: 1 addition & 1 deletion scripts/ci/jobs/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ check docs links:
build/docs
spell check docs:
image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-markdown:alpine-3.15-vale-2.16.1-markdownlint-0.31.1
image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-markdown:alpine-3.18-vale-2.27.0-markdownlint-0.35.0-markdownlint2-0.8.1
stage: check
needs: []
variables:
Expand Down
3 changes: 1 addition & 2 deletions scripts/ci/jobs/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ cppcheck:
- cd build
script:
- >
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DOGS_USE_CONAN=OFF
-DOGS_BUILD_UTILS=OFF
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DOGS_BUILD_UTILS=OFF
-DOGS_USE_UNITY_BUILDS=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- bash cppcheck.sh
artifacts:
Expand Down
18 changes: 7 additions & 11 deletions scripts/cmake/CppCheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ elseif(DEFINED CMAKE_BUILD_PARALLEL_LEVEL)
set(CPPCHECK_PARALLEL ${CMAKE_BUILD_PARALLEL_LEVEL})
endif()
if(DEFINED CPM_SOURCE_CACHE)
set(_cpp_check_ingore "-i${CPM_SOURCE_CACHE}")
set(_cpm_dir ${CPM_SOURCE_CACHE})
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
set(_cpm_dir $ENV{CPM_SOURCE_CACHE})
else()
set(_cpp_check_ingore "-i${PROJECT_BINARY_DIR}/_deps")
set(_cpm_dir ${PROJECT_BINARY_DIR}/_deps)
endif()
set(_last_sed_expression [['x;${s/,$//;p;x;};1d']])

configure_file(
${PROJECT_SOURCE_DIR}/scripts/test/cppcheck.in.sh
Expand All @@ -25,13 +28,6 @@ endif()

add_custom_target(
cppcheck
COMMAND
${CPPCHECK_TOOL_PATH}
--project=${PROJECT_BINARY_DIR}/compile_commands.json --language=c++
--std=c++20 --enable=all --inconclusive ${CPPCHECK_THREADS} -i
${PROJECT_BINARY_DIR}/CMakeFiles -i ${PROJECT_BINARY_DIR}/_deps -i
${PROJECT_SOURCE_DIR}/ThirdParty -i
${PROJECT_SOURCE_DIR}/Applications/DataExplorer -i
${PROJECT_SOURCE_DIR}/Tests --xml --xml-version=2
--output-file=${PROJECT_BINARY_DIR}/cppcheck.log ${PROJECT_SOURCE_DIR}
COMMAND ${BASH_TOOL_PATH} cppcheck.sh
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
24 changes: 15 additions & 9 deletions scripts/test/cppcheck.in.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ OUTPUT_FILE=${PROJECT_BINARY_DIR}/cppcheck.json
${CPPCHECK_TOOL_PATH} \
--project=${PROJECT_BINARY_DIR}/compile_commands.json \
--language=c++ \
--std=c++20 \
--std=c++${CMAKE_CXX_STANDARD} \
--enable=all \
--inconclusive \
-j ${CPPCHECK_PARALLEL} \
${_cpp_check_ingore} \
--inline-suppr \
--suppress=*:*/usr/local\* \
--suppress=*:*cpm\* \
--suppress=*:*Tests\* \
-i ${_cpm_dir} --suppress=*:${_cpm_dir}/* \
-i ${PROJECT_SOURCE_DIR}/ThirdParty --suppress=*:${PROJECT_SOURCE_DIR}/ThirdParty* \
-i ${PROJECT_SOURCE_DIR}/Tests --suppress=*:*Tests/* \
--suppress=missingIncludeSystem \
--template='{\n "description": "{message}",\n "severity": "info",\n "location": {\n "path": "{file}",\n "lines": {\n "begin": {line}\n }\n }\n},' \
--output-file="$OUTPUT_FILE.tmp"

Expand All @@ -24,15 +24,21 @@ $(
`: strip source code absolute path` \
sed 's|${PROJECT_SOURCE_DIR}/||' | \
`: escape strings` \
sed 's/string literal "\(.*\)" to/string literal \\"\1\\" to/g' | \
`: remove last comma` \
sed '$s/,$//'
sed 's/string literal "\(.*\)" to/string literal \\"\1\\" to/g'
)
]
EOF

cat <<EOF >"$OUTPUT_FILE"
$(
cat "$OUTPUT_FILE" | \
`: remove last comma` \
sed ${_last_sed_expression}
)
EOF

rm "$OUTPUT_FILE.tmp"

if [ -f ${Python_EXECUTABLE} ]; then
${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/test/cppcheck_gen_hashes.py "$OUTPUT_FILE"
${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/test/cppcheck_gen_hashes.py "$OUTPUT_FILE"
fi
16 changes: 13 additions & 3 deletions web/content/docs/benchmarks/elliptic/elliptic-neumann/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,22 @@ k\\;{\partial h(x,y) \over \partial n} = 0 &\quad \text{on } (x,y=1) \subset \Ga
}$$

The solution of this problem is

$$
\begin{equation}
h(x,y) = 1 + \sum_{k=1}^\infty A_k \sin\bigg(C_k y\bigg) \sinh\bigg(C_k x\bigg),
\end{equation}
$$
where $C_k = \frac{2k-1}{2} \pi$ and $A_k = 2 \Big/ \Big(C_k^2 \cosh\big(C_k\big)\Big)$.

where

$$
C_k = \frac{2k-1}{2} \pi
$$

and

$$
A_k = 2 \Big/ \Big(C_k^2 \cosh\big(C_k\big)\Big).
$$

## Input files

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,60 +25,73 @@ Figure 1: Single pipe flow model

In Ramey's analytical solution (Ramey et al. (1962)), the outlet temperature of the pipe inside the wellbore can be calculated by,

\begin{equation}
$$
T_o(t) = T_{s} + (T_i(t) - T_{s})\exp(-\Delta z/X)
\end{equation}
$$

\noindent where, $q$ is the flow rate of the fluid in the wellbore and coefficient $X$ is determined by,

\begin{equation}
$$
X = \frac{q\rho_fc_{p,f}(\lambda_{s}+r_pUf(t))}{2\pi r_pU \lambda_{s}}
\end{equation}
$$

with dimensionless time $t_D = \frac{\lambda_{s}t}{(\rho_{s}c_{p,s}r_b)}$, the time function $f(t)$ can be calculated by,

\begin{align}
&f(t) = [0.4063+0.5\ln(t_D)][1+\frac{0.6}{t_D}], & t_D > 1.5
\\
&f(t) = 1.1281\sqrt{t_D}(1-0.3\sqrt{t_D}), & t_D \leqslant 1.5
\end{align}
<!-- markdownlint-disable reference-links-images -->

\noindent and the overall heat transfer coefficient $U$ is written as follows,
$$
f(t) = [0.4063+0.5\ln(t_D)][1+\frac{0.6}{t_D}], t_D > 1.5
$$

\begin{equation}
<!-- markdownlint-enable reference-links-images -->

$$
f(t) = 1.1281\sqrt{t_D}(1-0.3\sqrt{t_D}), t_D \leqslant 1.5
$$

and the overall heat transfer coefficient $U$ is written as follows,

$$
U = [\frac{r_{pi}+t_{pi}}{r_{pi}h}+(r_{pi}+t_{pi})(\frac{\ln{\frac{r_{pi}+t_{pi}}{r_{pi}}}}{\lambda_{pi}}+\frac{\ln{\frac{r_b}{r_{pi}+t_{pi}}}}{\lambda_{grout}})]^{-1}
\end{equation}
$$

\begin{equation}
$$
h = \frac{\lambda_f Nu}{2r_{pi}}
\end{equation}
$$

The Nusselt number can be determined according to the Gnielinski's equation (Gnielinski et al. (1975)),

\begin{align}
& Nu = 4.364, & Re < 2300 \\
& Nu = \frac{\frac{f}{8}(Re - 1000)Pr}{1+12.7\sqrt{\frac{f}{8}}(Pr^{\frac{2}{3}}-1)}, & 2300\leqslant Re < 5 \times 10^6
\end{align}
$$
Nu = 4.364, Re < 2300
$$

$$
Nu = \frac{\frac{f}{8}(Re - 1000)Pr}{1+12.7\sqrt{\frac{f}{8}}(Pr^{\frac{2}{3}}-1)}, 2300\leqslant Re < 5 \times 10^6
$$

Pr is the Prandtl number, and the friction factor $f$, is evaluated by Churchill correlation (Churchill et al. (1977)),

\begin{equation}
$$
f = \frac{1}{(\frac{1}{[((\frac{8}{Re})^{10}+(\frac{Re}{36500})^{20})]^{1/2}}+[2.21(\ln{\frac{Re}{7}})]^{10})^{1/5}}
\end{equation}
$$

The Prandtl and Reynolds number can be calculated as follows,

\begin{align}
& Pr = \frac{\mu_f c_{p,f}}{\lambda_f}
& Re = \frac{\rho_f v d_{pi}}{\mu_f}
\end{align}
\noindent where, $\mu_f, \rho_f$ and $\lambda_f$ is the fluid viscosity, density and thermal conductivity.
$$
Pr = \frac{\mu_f c_{p,f}}{\lambda_f}
$$

$$
Re = \frac{\rho_f v d_{pi}}{\mu_f}
$$

where, $\mu_f, \rho_f$ and $\lambda_f$ is the fluid viscosity, density and thermal conductivity.

## Results and discussion

The outlet temperature change over time was compared against analytical solution and presented in Figure 2. After 30 days, the fluid temperature distribution in the wellbore is shown in Figure 3. The maximum relative error between the numerical model and Ramey's analytical solution is less than 0.15 \%.
The outlet temperature change over time was compared against analytical solution and presented in Figure 2. After 30 days, the fluid temperature distribution in the wellbore is shown in Figure 3. The maximum relative error between the numerical model and Ramey's analytical solution is less than $0.15\ \\%$.

In numerical model, the outlet temperature at beginning stage is affected by the initial temperature in the pipe inside the wellbore. The initial fluid temperature set in the benchmark means there is water with 20 $^{\circ}$C filled in the wellbore already before injecting water into the wellbore. But in the analytical solution, no initial temperature is set and the temperature keeps equilibrium state at every moment. The impact of initial temperature condition in numerical model is decreasing with the increasing of the operational time as shown in Figure 2.
In numerical model, the outlet temperature at beginning stage is affected by the initial temperature in the pipe inside the wellbore. The initial fluid temperature set in the benchmark means there is water with $20\ ^{\circ}$C filled in the wellbore already before injecting water into the wellbore. But in the analytical solution, no initial temperature is set and the temperature keeps equilibrium state at every moment. The impact of initial temperature condition in numerical model is decreasing with the increasing of the operational time as shown in Figure 2.

{{< img src="T_out_comparison.png" width="120">}}

Expand Down
Loading

0 comments on commit ef05d75

Please sign in to comment.