]>
tutorial3
This tutorial introduces the following concepts:
- Arrays of variable values
- Functions that operate on arrays of values
- Functions that create constants and arrays of constant values (Constant and Array)
- Non-uniform domain grids
The model in this example is identical to the model used in the tutorial 1.
Some additional equations that calculate the total flux at the bottom edge are added
to illustrate the array functions.
The temperature plot (at t=100, x=0.5, y=*):
.. image:: _static/tutorial3-results.png
:width: 500px
The average temperature plot (considering the whole x-y domain):
.. image:: _static/tutorial3-results2.png
:width: 500px
$\mathit{tutorial3}$
BC_bottom
Neumann boundary conditions at the bottom edge (constant flux)
${\mathit{BC}}_{\mathit{bottom}}$
eAlgebraic
$${ \left( { \left( { \left( - { \lambda_p } \right) } \right) \cdot \left( { { \partial { { \left( { T \left( { x, y } \right) } \right) } } } \over { \partial {y} } } \right) } \right) - { Q_b } } = 0; {\forall { x } \in \left( { x } _{0}, { x } _{n} \right) }, {{ y } = { y } _{0}}$$
x
$\mathit{x}$
$\mathit{x}$
x
eOpenOpen
y
$\mathit{y}$
$\mathit{y}$
y
eLowerBound
BC_top
Dirichlet boundary conditions at the top edge (constant temperature)
${\mathit{BC}}_{\mathit{top}}$
eAlgebraic
$${ { T \left( { x, y } \right) } - { T_t } } = 0; {\forall { x } \in \left( { x } _{0}, { x } _{n} \right) }, {{ y } = { y } _{n}}$$
x
$\mathit{x}$
$\mathit{x}$
x
eOpenOpen
y
$\mathit{y}$
$\mathit{y}$
y
eUpperBound
BC_left
Neumann boundary conditions at the left edge (insulated)
${\mathit{BC}}_{\mathit{left}}$
eAlgebraic
$${ { \partial { { \left( { T \left( { x, y } \right) } \right) } } } \over { \partial {x} } } = 0; {{ x } = { x } _{0}}, {\forall { y } \in \left[ { y } _{0}, { y } _{n} \right] }$$
x
$\mathit{x}$
$\mathit{x}$
x
eLowerBound
y
$\mathit{y}$
$\mathit{y}$
y
eClosedClosed
BC_right
Neumann boundary conditions at the right edge (insulated)
${\mathit{BC}}_{\mathit{right}}$
eAlgebraic
$${ { \partial { { \left( { T \left( { x, y } \right) } \right) } } } \over { \partial {x} } } = 0; {{ x } = { x } _{n}}, {\forall { y } \in \left[ { y } _{0}, { y } _{n} \right] }$$
x
$\mathit{x}$
$\mathit{x}$
x
eUpperBound
y
$\mathit{y}$
$\mathit{y}$
y
eClosedClosed
T_ave
The average temperature of the plate
${\mathit{T}}_{\mathit{ave}}$
eAlgebraic
$${ { T_ave } - \left( Average \left( { T.array \left( { *, * } \right) } \right( \right) } = 0$$
Q_sum
The sum of heat fluxes at the bottom edge of the plate
${\mathit{Q}}_{\mathit{sum}}$
eAlgebraic
$${ { Q_sum } + \left( { { \lambda_p } \cdot \left( \sum { { { \partial { { T.d_array\left( { *, 0} \right) } } } \over { \partial {y} } } } \right) } \right) } = 0$$
Q_mul
Heat flux multiplied by a vector (units: K) and divided by a constant (units: K)
${\mathit{Q}}_{\mathit{mul}}$
eAlgebraic
$${ { Q_sum1 } + \left( \sum { { \left( { \left( { \left( Array \left( \left[ 2 K, 2 K, 2 K, 2 K, 2 K, 2 K, 2 K, 2 K, 2 K, 2 K, 2 K \right] ) \right) \times \left( { \lambda_p } \right) } \right) \times \left( { { \partial { { T.d_array\left( { *, 0} \right) } } } \over { \partial {y} } } \right) } \right) \over \left( {2 {{K}}} \right) } } \right) } = 0$$
Q_sum2
The sum of heat fluxes at the bottom edge of the plate (numpy version)
${\mathit{Q}}_{\mathit{sum2}}$
eAlgebraic
$${ { Q_sum2 } + \left( { \left( { \left( { \left( { \left( { \left( { \left( { \left( { \left( { \left( { \left( { { \lambda_p } \cdot \left( { { \partial { { \left( { T \left( { 0, 0 } \right) } \right) } } } \over { \partial {y} } } \right) } \right) + \left( { { \lambda_p } \cdot \left( { { \partial { { \left( { T \left( { 1, 0 } \right) } \right) } } } \over { \partial {y} } } \right) } \right) } \right) + \left( { { \lambda_p } \cdot \left( { { \partial { { \left( { T \left( { 2, 0 } \right) } \right) } } } \over { \partial {y} } } \right) } \right) } \right) + \left( { { \lambda_p } \cdot \left( { { \partial { { \left( { T \left( { 3, 0 } \right) } \right) } } } \over { \partial {y} } } \right) } \right) } \right) + \left( { { \lambda_p } \cdot \left( { { \partial { { \left( { T \left( { 4, 0 } \right) } \right) } } } \over { \partial {y} } } \right) } \right) } \right) + \left( { { \lambda_p } \cdot \left( { { \partial { { \left( { T \left( { 5, 0 } \right) } \right) } } } \over { \partial {y} } } \right) } \right) } \right) + \left( { { \lambda_p } \cdot \left( { { \partial { { \left( { T \left( { 6, 0 } \right) } \right) } } } \over { \partial {y} } } \right) } \right) } \right) + \left( { { \lambda_p } \cdot \left( { { \partial { { \left( { T \left( { 7, 0 } \right) } \right) } } } \over { \partial {y} } } \right) } \right) } \right) + \left( { { \lambda_p } \cdot \left( { { \partial { { \left( { T \left( { 8, 0 } \right) } \right) } } } \over { \partial {y} } } \right) } \right) } \right) + \left( { { \lambda_p } \cdot \left( { { \partial { { \left( { T \left( { 9, 0 } \right) } \right) } } } \over { \partial {y} } } \right) } \right) } \right) + \left( { { \lambda_p } \cdot \left( { { \partial { { \left( { T \left( { 10, 0 } \right) } \right) } } } \over { \partial {y} } } \right) } \right) } \right) } = 0$$