gtheler пре 7 година
родитељ
комит
278dd982fe
5 измењених фајлова са 114 додато и 56 уклоњено
  1. +1
    -0
      .gitignore
  2. +34
    -0
      README.md
  3. +15
    -12
      hook-pre.sh
  4. +57
    -44
      pipe-linearized.md
  5. +7
    -0
      plot.sh

+ 1
- 0
.gitignore Прегледај датотеку

@@ -1,3 +1,4 @@
pipe-linearize
hash.yaml
*.bbl
*.bcf

+ 34
- 0
README.md Прегледај датотеку

@@ -0,0 +1,34 @@
# On convergence of linearized stresses in an infinite pipe computed using the finite element method

To compile the report, first clone the case files

```
git clone https://gtheler@bitbucket.org/seamplex/pipe-linearize.git
```

Then go to `pipe-linearize`, run (might take a while) and plot:

```
cd pipe-linearize
./run.sh
./plot.sh
```

Go back to the report’s directory and plot again:

```
cd ..
./plot.sh
```

Now you are ready to make:

```
./make.sh
```

## Dependencies

### To run

*

+ 15
- 12
hook-pre.sh Прегледај датотеку

@@ -1,22 +1,25 @@
#!/bin/bash

run="run/analytical.txt \
run/problem.max \
run/analytical.ppl"
run="pipe-linearize \
pipe-linearize/problem.was \
pipe-linearize/analytical.txt \
pipe-linearize/pipe.fin \
pipe-linearize/versions.txt \
pipe-linearize/cpu.txt \
pipe-linearize/run.sh \
pipe-linearize/problem.max \
pipe-linearize/analytical.max \
pipe-linearize/analytical.ppl \
pipe-linearize/analytical.was \
pipe-linearize/pipe.geo.m4"
plot="pipe-mesh-1.png"

for i in ${run}; do
for i in ${run} ${plot}; do
if [ ! -e $i ]; then
echo "$i does not exist, please run the case first"
exit 1
fi
done

for i in ${plot}; do
if [ ! -e $i ]; then
echo "$i does not exist, please plot the results"
echo "$i does not exist, please read README first"
exit 1
fi
done

+ 57
- 44
pipe-linearized.md Прегледај датотеку

@@ -56,20 +56,20 @@ Fino is a free (“Free” both as in “free speech” and in “free beer.”)
Let us consider an infinite pipe (i.e. a cylinder) of internal radius $a$ and external radius $b$ with uniform mechanical properties---Young modulus $E$ and Poisson’s ratio $\nu$---subject to an internal uniform pressure $p$. We would like to compute the linearized membrane and membrane plus bending stresses according to ASME VIII Section 5 [@asme8div2, annex 5-A]. To obtain a numerical solution with the finite-element method, let us fix the numerical values of the parameters as follows

\begin{align*}
dnl b &= \SI{esyscmd([[echo "INCLUDE run/problem.was\nPRINT b" | wasora - | xargs]])}{\milli\meter} \\
dnl a &= \SI{esyscmd([[echo "INCLUDE run/problem.was\nPRINT a" | wasora - | xargs]])}{\milli\meter} \\
dnl E &= \SI{esyscmd([[echo "INCLUDE run/problem.was\nPRINT 1e-3*E" | wasora - | xargs]])}{\giga\pascal} \\
dnl \nu &= esyscmd([[echo "INCLUDE run/problem.was\nPRINT %.2f nu" | wasora - | xargs]]) \\
dnl p &= \SI{esyscmd([[echo "INCLUDE run/problem.was\nPRINT p" | wasora - | xargs]])}{\mega\pascal} \\
b &= esyscmd([[echo "INCLUDE run/problem.was\nPRINT b" | wasora - | xargs]])~\text{mm} \\
a &= esyscmd([[echo "INCLUDE run/problem.was\nPRINT a" | wasora - | xargs]])~\text{mm} \\
E &= esyscmd([[echo "INCLUDE run/problem.was\nPRINT 1e-3*E" | wasora - | xargs]])~\text{GPa} \\
\nu &= esyscmd([[echo "INCLUDE run/problem.was\nPRINT %.2f nu" | wasora - | xargs]]) \\
dnl b &= \SI{esyscmd([[echo "INCLUDE pipe-linearize/problem.was\nPRINT b" | wasora - | xargs]])}{\milli\meter} \\
dnl a &= \SI{esyscmd([[echo "INCLUDE pipe-linearize/problem.was\nPRINT a" | wasora - | xargs]])}{\milli\meter} \\
dnl E &= \SI{esyscmd([[echo "INCLUDE pipe-linearize/problem.was\nPRINT 1e-3*E" | wasora - | xargs]])}{\giga\pascal} \\
dnl \nu &= esyscmd([[echo "INCLUDE pipe-linearize/problem.was\nPRINT %.2f nu" | wasora - | xargs]]) \\
dnl p &= \SI{esyscmd([[echo "INCLUDE pipe-linearize/problem.was\nPRINT p" | wasora - | xargs]])}{\mega\pascal} \\
b &= esyscmd([[echo "INCLUDE pipe-linearize/problem.was\nPRINT b" | wasora - | xargs]])~\text{mm} \\
a &= esyscmd([[echo "INCLUDE pipe-linearize/problem.was\nPRINT a" | wasora - | xargs]])~\text{mm} \\
E &= esyscmd([[echo "INCLUDE pipe-linearize/problem.was\nPRINT 1e-3*E" | wasora - | xargs]])~\text{GPa} \\
\nu &= esyscmd([[echo "INCLUDE pipe-linearize/problem.was\nPRINT %.2f nu" | wasora - | xargs]]) \\
\end{align*}
which correspond to a esyscmd([[grep inch run/problem.was | cut -c2-]]) carbon steel pipe according to ASME B36-10M [@asmeb36]. Again, for the sake of numerical results, we fix the internal pressure to
which correspond to a esyscmd([[grep inch pipe-linearize/problem.was | cut -c2-]]) carbon steel pipe according to ASME B36-10M [@asmeb36]. Again, for the sake of numerical results, we fix the internal pressure to

$$
p = esyscmd([[echo "INCLUDE run/problem.was\nPRINT p" | wasora - | xargs]])~\text{MPa}
p = esyscmd([[echo "INCLUDE pipe-linearize/problem.was\nPRINT p" | wasora - | xargs]])~\text{MPa}
$$
that is a typical pressure found in nuclear power plants (so ASME III applies).

@@ -187,37 +187,37 @@ For the particular parameters fixed in [@sec:problem], the numerical values for

divert(-1)
\begin{align*}
\text{M}_\text{tresca} &= \SI{esyscmd(grep -A1 ev\(M_tresca run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{M}_\text{vonmises} &= \SI{esyscmd(grep -A1 ev\(M_vonmises run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{M}_1 &= \SI{esyscmd(grep -A1 ev\(M_1 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{M}_2 &= \SI{esyscmd(grep -A1 ev\(M_2 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{M}_3 &= \SI{esyscmd(grep -A1 ev\(M_3 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{M}_\text{tresca} &= \SI{esyscmd(grep -A1 ev\(M_tresca pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{M}_\text{vonmises} &= \SI{esyscmd(grep -A1 ev\(M_vonmises pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{M}_1 &= \SI{esyscmd(grep -A1 ev\(M_1 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{M}_2 &= \SI{esyscmd(grep -A1 ev\(M_2 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{M}_3 &= \SI{esyscmd(grep -A1 ev\(M_3 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\end{align*}
and
\begin{align*}
\text{MB}_\text{tresca} &= \SI{esyscmd(grep -A1 ev\(MB_tresca run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{MB}_\text{vonmises} &= \SI{esyscmd(grep -A1 ev\(MB_vonmises run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{MB}_1 &= \SI{esyscmd(grep -A1 ev\(MB_1 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{MB}_2 &= \SI{esyscmd(grep -A1 ev\(MB_2 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{MB}_3 &= \SI{esyscmd(grep -A1 ev\(MB_3 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{MB}_\text{tresca} &= \SI{esyscmd(grep -A1 ev\(MB_tresca pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{MB}_\text{vonmises} &= \SI{esyscmd(grep -A1 ev\(MB_vonmises pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{MB}_1 &= \SI{esyscmd(grep -A1 ev\(MB_1 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{MB}_2 &= \SI{esyscmd(grep -A1 ev\(MB_2 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\text{MB}_3 &= \SI{esyscmd(grep -A1 ev\(MB_3 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')}{\mega\pascal} \\
\end{align*}
respectively.
divert(0)

\begin{align*}
\text{M}_\text{tresca} &= esyscmd(grep -A1 ev\(M_tresca run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{M}_\text{vonmises} &= esyscmd(grep -A1 ev\(M_vonmises run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{M}_1 &= esyscmd(grep -A1 ev\(M_1 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{M}_2 &= esyscmd(grep -A1 ev\(M_2 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{M}_3 &= esyscmd(grep -A1 ev\(M_3 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{M}_\text{tresca} &= esyscmd(grep -A1 ev\(M_tresca pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{M}_\text{vonmises} &= esyscmd(grep -A1 ev\(M_vonmises pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{M}_1 &= esyscmd(grep -A1 ev\(M_1 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{M}_2 &= esyscmd(grep -A1 ev\(M_2 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{M}_3 &= esyscmd(grep -A1 ev\(M_3 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\end{align*}
and
\begin{align*}
\text{MB}_\text{tresca} &= esyscmd(grep -A1 ev\(MB_tresca run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{MB}_\text{vonmises} &= esyscmd(grep -A1 ev\(MB_vonmises run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{MB}_1 &= esyscmd(grep -A1 ev\(MB_1 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{MB}_2 &= esyscmd(grep -A1 ev\(MB_2 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{MB}_3 &= esyscmd(grep -A1 ev\(MB_3 run/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{MB}_\text{tresca} &= esyscmd(grep -A1 ev\(MB_tresca pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{MB}_\text{vonmises} &= esyscmd(grep -A1 ev\(MB_vonmises pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{MB}_1 &= esyscmd(grep -A1 ev\(MB_1 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{MB}_2 &= esyscmd(grep -A1 ev\(MB_2 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\text{MB}_3 &= esyscmd(grep -A1 ev\(MB_3 pipe-linearize/analytical.txt | tail -n 1 | tr -d ' ' | awk -F\) '{printf("%.4f", $2) }')~\text{MPa} \\
\end{align*}
respectively. See [@sec:maxima] and [@sec:wasora] for the input files used to compute both the integrals and the numerical values, either using [Maxima](http://maxima.sourceforge.net/) (symbolic integration) or [wasora](https://www.seamplex.com/wasora) [@wasoradesc] (numerical integration).

@@ -245,7 +245,7 @@ These three boundary conditions are applied over two different faces, namely

## Parametric grids

define(n_grids, esyscmd([[grep PARAMETRIC run/pipe.fin | awk '{printf("%d", $6)}']]))
define(n_grids, esyscmd([[grep PARAMETRIC pipe-linearize/pipe.fin | awk '{printf("%d", $6)}']]))

By expanding the macros of the Gmsh input template shown in [@sec:gmsh] for the parameter $n=1,\dots,6$ that represents the number of elements along the pipe wall thickness, the grids shown in [figures @fig:mesh1]--[-@fig:mesh[[]]n_grids] are obtained. It should be noted that the number and distribution of elements is _exactly_ the same in the first and second-order cases. However, not only is the number of nodes different but also the new second-order nodes (i.e. the nodes located along each of the the six edges the tetrahedra have) are placed on the curved surfaces of the cylinder. Thus, the original first-order tetrahedra are _slightly_ “distorted” to better represent the continuous geometry in the second-order case. In any case, this distortion is so slight that each case cannot be graphically distinguished even for the coarser case. Nevertheless, this effect is present and is illustrated in the extremely coarse grids presented in [@fig:distorted]. The extra cost of this better geometrical representation is a greater number of nodes, which in turn leads to an increase in the computational effort needed to solve the associated finite-element problem as discussed in [@sec:resources]. Even though quadratic iso-parametric (i.e. standard) elements can _better_ represent circles, they are still approximations. One need to switch to [iso-geometric](https://en.wikipedia.org/wiki/Isogeometric_analysis) elements for that end.

@@ -424,22 +424,35 @@ from which [@eq:radial] follows.

# Host, codes, scripts and input files {#sec:codes}

The results shown in this report were obtained using the free-as-in-free-speech^[And not just free as in “free beer”] tools [Gmsh](http://gmsh.info/) and [Fino](https://www.seamplex.com). Specifically, the following versions were used:
The complete set of scripts and input files needed to run the cases discussed in this report can be found at

:::: {text-center}
<https://bitbucket.org/seamplex/pipe-linearize>
::::

\medskip

The results shown in this report correspond to revision

```{style=terminal}
esyscmd(cd pipe-linearize; git log -1)
```
\noindent and were obtained using the free-as-in-free-speech^[And not just free as in “free beer”] tools [Gmsh](http://gmsh.info/) and [Fino](https://www.seamplex.com) using the following versions:

```{style=terminal}
include(run/versions.txt)
include(pipe-linearize/versions.txt)
```

These codes were executed on a host with the following features:

```{style=terminal}
include(run/cpu.txt)
include(pipe-linearize/cpu.txt)
```

The complete case can be run by executing the following script:

```{.bash style=bash caption=run.sh}
include(run/run.sh)
include(pipe-linearize/run.sh)
```


@@ -448,18 +461,18 @@ include(run/run.sh)
The reference solutions presented in [@sec:analytical] where computed from the theoretical stresses by symbolic integration using [Maxima](http://maxima.sourceforge.net/).

```{.maxima style=maxima caption=problem.max}
include(run/problem.max)
include(pipe-linearize/problem.max)
```

```{.maxima style=maxima caption=analytical.max}
include(run/analytical.max)
include(pipe-linearize/analytical.max)
```

The results are illustrated in the following terminal mimic:

```{style=terminal}
$ maxima -b analytical.max
include(run/analytical.txt)dnl
include(pipe-linearize/analytical.txt)dnl
$
```

@@ -468,32 +481,32 @@ $
Instead of symbolic integration, adaptive numerical quadrature can be performed easily using [wasora](https://www.seamplex.com/wasora) [@wasoradesc]. First, we put all the problem parameters in a file `problem.was`:

```{.wasora style=wasora caption=problem.was}
include(run/problem.was)
include(pipe-linearize/problem.was)
```

And then include this file from the main one `analytical.was`:

```{.wasora style=wasora caption=analytical.was}
include(run/analytical.was)
include(pipe-linearize/analytical.was)
```

```{style=terminal}
$ wasora analytical.was
include(run/analytical.ppl)dnl
include(pipe-linearize/analytical.ppl)dnl
$
```

## Geometry and mesh generation with Gmsh {#sec:gmsh}

```{.c style=gmsh caption=pipe.geo.m4}
include(run/pipe.geo.m4)
include(pipe-linearize/pipe.geo.m4)
```


## Parametric finite-element analysis with Fino {#sec:fino}

```{.fino style=fino caption=pipe.fin}
include(run/pipe.fin)
include(pipe-linearize/pipe.fin)
```

\newpage

+ 7
- 0
plot.sh Прегледај датотеку

@@ -17,6 +17,13 @@ done
# copy the figures to .
cp pipe-linearize/*.pdf pipe-linearize/*.png .

# create the distorted mesh figures
gmsh distorted.geo -order 1; mv distorted.png distorted1.png
gmsh distorted.geo -order 2; mv distorted.png distorted2.png
montage -mode concatenate -tile 2x1 distorted1.png distorted2.png distorted.png
convert -trim distorted.png distorted.png


# convert pdfs to svg
for i in M_*.pdf MB_*.pdf ur.pdf *-vs-n.pdf sigma*.pdf error*.pdf; do
pdf2svg $i `basename $i .pdf`.svg

Loading…
Откажи
Сачувај