Salome HOME
Updated GUI documentation
[tools/solverlab.git] / CoreFlows / Documentation / PhysicalModels / TwoPhasePage.ipynb
1 {
2  "cells": [
3   {
4    "cell_type": "code",
5    "execution_count": 3,
6    "metadata": {},
7    "outputs": [
8     {
9      "data": {
10       "text/markdown": [
11        "The two-phase flow models\n",
12        "=========================\n",
13        "\n",
14        "We present the homogeneised two phase flow models implemented in CoreFlows. \n",
15        "\n",
16        "This models are obtained by averaging the balance equations for each separated phase or for the mixture, using space, time or ensemble averaged quantities (\\ref ishii and \\ref Drew ). \n",
17        "\n",
18        "\\ref The drift model is used in the thermal hydraulics softwares \\ref flica4 and \\ref flocal, whilst the two-fluid models are used in \\ref cathare , \\ref neptuneCFD, \\ref CobraTF , \\ref relap5 .\n",
19        "\n",
20        "\n",
21        "The Drift model\n",
22        "---------------\n",
23        "\n",
24        "The drift model is a system of four nonlinear equations taking the following conservative form\n",
25        "$$\n",
26        "\\left\\{\\begin{array}{lll}\n",
27        "         \\partial_t(\\alpha_g\\rho_g+\\alpha_l\\rho_l)&+\\nabla\\cdot(\\alpha_g\\rho_g{}^t\\vec{u}_g+\\alpha_l\\rho_l{}^t\\vec{u}_l)&=0\\\\\n",
28        "         \\partial_t(\\alpha_g\\rho_g)&+\\nabla\\cdot(\\alpha_g\\rho_g{}^t\\vec{u}_g)&=\\Gamma_g(h_m,\\Phi)\\\\\n",
29        "         \\partial_t(\\alpha_g\\rho_g\\vec{u}_g+\\alpha_l\\rho_l\\vec{u}_l)&+\\nabla\\cdot(\\alpha_g\\rho_g\\vec{u}_g\\otimes\\vec{u}_g+\\alpha_l\\rho_l\\vec{u}_l\\otimes\\vec{u}_l+p {I}_d)&=\\rho_m\\vec{g}-K_g\\alpha_g\\rho_g||\\vec{u}_g||\\vec{u}_g-K_l\\alpha_l\\rho_l||\\vec{u}_l||\\vec{u}_l\\\\\n",
30        "         \\partial_t(\\alpha_g\\rho_g E_g+\\alpha_l\\rho_l E_l)&+\\nabla\\cdot(\\alpha_g\\rho_g H_g{}^t\\vec{u}_g+\\alpha_l\\rho_l H_l{}^t\\vec{u}_l)&=\\Phi+\\rho\\vec{g}\\cdot\\vec{u}-K_g\\alpha_g\\rho_g||\\vec{u}_g||^3-K_l\\alpha_l\\rho_l||\\vec{u}_l||^3\n",
31        "        \\end{array}\\right.,\n",
32        "$$\n",
33        "where the total energy and total enthalpy are defined by\n",
34        "$$\n",
35        "E_k=e_k+\\frac{1}{2}|\\vec{u}_k|^2,\\quad H_k=h_k+\\frac{1}{2}|\\vec{u}_k|^2,\\qquad k=v,l,\n",
36        "$$\n",
37        "where $e_k$ is the internal energy, and $h_k=e_k+\\frac{p}{\\rho_k}$ the enthalpy associated to phase $k$ and\n",
38        "$$\n",
39        "\\begin{array}{lll}\n",
40        "\\rho_m&=&\\alpha_g\\rho_g+\\alpha_l\\rho_l\\\\\n",
41        "\\vec{u}_m&=&\\frac{\\alpha_g\\rho_g\\vec{u}_g+\\alpha_l\\rho_l\\vec{u}_l}{\\alpha_g\\rho_g+\\alpha_l\\rho_l}\\\\\n",
42        "h_m&=&\\frac{\\alpha_g\\rho_g h_g+\\alpha_l\\rho_l h_l}{\\alpha_g\\rho_g+\\alpha_l\\rho_l}.\n",
43        "\\end{array}\n",
44        "$$\n",
45        "We need a drift correlation for the relative velocity:\n",
46        "$$\n",
47        "\\vec{u}_r=\\vec{u}_g-\\vec{u}_l=\\vec{f}_r(c_g,\\vec{u}_m,\\rho_m).\n",
48        "$$\n",
49        "The phase change is modeled using the formula\n",
50        "$$\n",
51        " \\Gamma_g=\\left\\{\\begin{array}{cc}\n",
52        "         \\frac{\\Phi}{\\mathcal{L}}&\\textrm{ if } h_l^{sat}\\leq h< h_g^{sat} \\textrm{ and } 0<\\alpha_g<1\\\\[1.5ex]\n",
53        "         0& \\textrm{ otherwise }\n",
54        "        \\end{array}\\right..\n",
55        "$$\n",
56        "The parameters $\\lambda_k, \\nu_k,\\vec g, K_k $ and $\\Phi$ can be set by the user.\n",
57        "\n",
58        "[More details about the drift model are available here](TwoPhase/DriftModelPage.ipynb)\n",
59        "\n",
60        "\t\n",
61        "The isothermal two-fluid model\n",
62        "-----------------------------------------------\n",
63        "\n",
64        "The model consists in the phasic mass and momentum balance equations.\n",
65        "\n",
66        "The main unknowns are $\\alpha$, $P$, $\\vec{u}_g$, $\\vec{u}_l$. The model uses stiffened gas laws $p_g(\\rho_g)$ and  $p_l(\\rho_l)$ for a contant temperature $T_0$ provided by the user.\n",
67        "\n",
68        "The subscript $k$ stands for $l$ for the liquid phase and $g$ for the gas phase. The common\n",
69        "averaged pressure of the two phases is denoted by $p$. \n",
70        "\n",
71        "In our model, pressure equilibrium between the two phases is postulated, and the resulting system to solve is:\n",
72        "$$\n",
73        "\\left\\{\n",
74        "\\begin{array}{ccll}\n",
75        " \\frac{\\partial m_g}{\\partial t}& +& \\nabla \\cdot \\vec{q}_g &= 0,\\\\[1.5ex]\n",
76        "\\frac{\\partial m_l}{\\partial t} &+ &\\nabla \\cdot \\vec{q}_l &= 0,\\\\[1.5ex]\n",
77        "\\frac{\\partial \\vec{q}_g}{\\partial t}& +& \\nabla \\cdot (\\vec{q}_g\\otimes\\frac{\\vec{q}_g}{m_g})+ \\alpha_g \\vec\\nabla p&\\\\[1.5ex] \n",
78        " &+&\\Delta p \\nabla \\alpha_g -\\nu_g\\Delta \\vec{u}_g &= m_g\\vec{g}-K_gm_g||\\vec{u}_g||\\vec{u}_g\\\\[1.5ex]\n",
79        "\\frac{\\partial \\vec{q}_l}{\\partial t}& +& \\nabla \\cdot (\\vec{q}_l\\otimes\\frac{\\vec{q}_l}{m_l})+ \\alpha_l \\vec\\nabla p&\\\\[1.5ex]\n",
80        "&+&\\Delta p \\nabla \\alpha_l -\\nu_l\\Delta \\vec{u}_l &= m_l\\vec{g}-K_lm_l||\\vec{u}_l||\\vec{u}_l,\\\\\n",
81        "\\end{array}\n",
82        "\\right.\n",
83        "$$\n",
84        "\n",
85        "Here :\n",
86        "- $\\nu_k$ is the viscosity of phase $k$,\n",
87        "- $\\Delta p$ denotes the pressure default $p-p_k$ between the bulk average pressure and the interfacial average pressure.\n",
88        "\n",
89        "where \n",
90        "$$ \n",
91        "\\left\\{\\begin{array}{clc}\n",
92        "\t\\alpha_g +\\alpha_l &=& 1 \\\\[1.5ex]\n",
93        "\tm_k &=& \\alpha_k \\rho_k \\\\[1.5ex]\n",
94        "\t\\vec{q}_k &=& \\alpha_k \\rho_k \\vec{u}_k \\\\[1.5ex]\n",
95        "        \t\\end{array}\\right..\n",
96        "$$\n",
97        "\n",
98        "The parameters $\\lambda_k, \\nu_k,\\vec g, K_k $ and $\\Phi$ can be set by the user.\n",
99        "\n",
100        "[More details about the isothermal two-fluid model are available here](IsothermalPage.ipynb)\n",
101        "\n",
102        "\n",
103        "The five equation two-fluid model\n",
104        "-----------------------------------------------\n",
105        "\n",
106        "\n",
107        "The model consists in the phasic mass and momentum balance equations and one mixture total energy balance equation. \n",
108        "\n",
109        "The main unknowns are $\\alpha$,$P$,$\\vec{u}_g$,$\\vec{u}_l$ and $T=T_g=T_l$. \n",
110        "\n",
111        "The model uses stiffened gas laws $p_g(\\rho_g,T)$ and  $p_l(\\rho_l,T)$.\n",
112        "\n",
113        "$$\n",
114        "\\left\\{\n",
115        "\\begin{array}{ccll}\n",
116        " \\frac{\\partial m_g}{\\partial t}& +& \\nabla \\cdot \\vec{q}_g &= \\Gamma_g(h_g,\\Phi),\\\\[1.5ex]\n",
117        "\\frac{\\partial m_l}{\\partial t} &+ &\\nabla \\cdot \\vec{q}_l &= \\Gamma_l(h_l,\\Phi),\\\\[1.5ex]\n",
118        "\\frac{\\partial \\vec{q}_g}{\\partial t}& +& \\nabla \\cdot (\\vec{q}_g\\otimes\\frac{\\vec{q}_g}{m_g})+ \\alpha_g \\nabla p&\\\\[1.5ex] \n",
119        " &+&\\Delta p \\nabla \\alpha_g -\\nu_g(\\Delta \\frac{\\vec{q}_g}{m_g}) &= m_g\\vec{g}-K_gm_g||\\vec{u}_g||\\vec{u}_g\\\\[1.5ex]\n",
120        "\\frac{\\partial \\vec{q}_l}{\\partial t}& +& \\nabla \\cdot (\\vec{q}_l\\otimes\\frac{\\vec{q}_l}{m_l})+ \\alpha_l \\nabla p&\\\\[1.5ex]\n",
121        "&+&\\Delta p \\nabla \\alpha_l -\\nu_l(\\Delta \\frac{\\vec{q}_l}{m_l}) &= m_l\\vec{g}-K_lm_l||\\vec{u}_l||\\vec{u}_l,\\\\[1.5ex]\n",
122        "\\partial_t\\rho_mE_m&+&\\nabla\\cdot(\\alpha_g\\rho_g H_g{}^t\\vec{u}_g+\\alpha_l\\rho_l H_l{}^t\\vec{u}_l)&=\\Phi+\\rho\\vec{g}\\cdot\\vec{u}-K_gm_g||\\vec{u}_g||^3-K_lm_l||\\vec{u}_l||^3\n",
123        "\\end{array}\n",
124        "\\right. \\nonumber\n",
125        "$$\n",
126        "where\n",
127        "$$\n",
128        "\\begin{array}{ccl}\n",
129        "\\rho_m&=&\\alpha_g\\rho_g+\\alpha_l\\rho_l\\\\\n",
130        " E_m&=&\\frac{\\alpha_g\\rho_g E_g+\\alpha_l\\rho_l E_l}{\\alpha_g\\rho_g+\\alpha_l\\rho_l}.\n",
131        "\\end{array}\n",
132        "$$\n",
133        "\n",
134        "The phase change is modeled using the formula\n",
135        "\n",
136        "$$\n",
137        "\\Gamma_g=\\left\\{\\begin{array}{cc}\n",
138        "         \\frac{\\Phi}{\\mathcal{L}}&\\textrm{ if } h_l^{sat}\\leq h< h_g^{sat} \\textrm{ and } 0<\\alpha_g<1\\\\[1.5ex]\n",
139        "         0& \\textrm{ otherwise }\n",
140        "        \\end{array}\\right..\n",
141        "$$\n",
142        "\n",
143        "The parameters $\\lambda_k, \\nu_k,\\vec g, K_k $ and $\\Phi$ can be set by the user.\n",
144        "\n",
145        "[More details about the five equation two-fluid model are available here](TwoPhase/FiveEqPage.ipynb)\n",
146        "\n"
147       ],
148       "text/plain": [
149        "<IPython.core.display.Markdown object>"
150       ]
151      },
152      "metadata": {},
153      "output_type": "display_data"
154     }
155    ],
156    "source": [
157     "from IPython.display import display, Markdown\n",
158     "display(Markdown('TwoPhasePage.md'))"
159    ]
160   }
161  ],
162  "metadata": {
163   "kernelspec": {
164    "display_name": "Python 2",
165    "language": "python",
166    "name": "python2"
167   },
168   "language_info": {
169    "codemirror_mode": {
170     "name": "ipython",
171     "version": 2
172    },
173    "file_extension": ".py",
174    "mimetype": "text/x-python",
175    "name": "python",
176    "nbconvert_exporter": "python",
177    "pygments_lexer": "ipython2",
178    "version": "2.7.12"
179   }
180  },
181  "nbformat": 4,
182  "nbformat_minor": 2
183 }