You are on page 1of 6

Water Resources Computer Modeling

Finite differences method


General formula for y' , y'' , y''' , y''''
h h h h

𝑦𝑖−2 𝑦𝑖−1 𝑦𝑖 𝑦𝑖+1 𝑦𝑖+2


𝟏
𝒚′ = (𝒚𝒊+𝟏 − 𝒚𝒊−𝟏 )
𝟐𝒉
𝟏
𝒚′′ 𝒊 = (𝒚𝒊+𝟏 − 𝟐𝒚𝒊 + 𝒚𝒊−𝟏 )
𝒉𝟐
𝟏
𝒚′′′𝒊 = (𝒚 − 𝟐𝒚𝒊+𝟏 + 𝟐𝒚𝒊−𝟏 − 𝒚𝒊−𝟐 )
𝟐𝒉𝟑 𝒊+𝟐
𝟏
𝒚′′′′𝒊 = 𝟒 (𝒚𝒊+𝟐 − 𝟒𝒚𝒊+𝟏 + 𝟔𝒚𝒊 − 𝟒𝒚𝒊−𝟏 + 𝒚𝒊−𝟐 )
𝒉

Finite Differences - Application

1- Orifice Flow
As it is known the flow from a reservoir due to orifice has the following
relationship.
𝑑𝑦
𝐴(𝑦) = 𝑄𝑖𝑛 − 𝑄𝑜𝑢𝑡
𝑑𝑡
Where A (y) = cross sectional area for a depth y , which is depend on the
shape of the reservoir .
𝑑𝑦 𝑦𝑖+1 − 𝑦𝑖−1
∴ =
𝑑𝑡 2ℎ
𝑑𝑦
SO.→ 𝐴 (𝑌) = 𝑄𝑖𝑛 − 𝑄𝑜𝑢𝑡
𝑑𝑡
𝒚𝒊+𝟏 − 𝒚𝒊−𝟏
𝑖𝑠 𝑨(𝒀𝒊 ) = 𝑸𝒊𝒏 − 𝑸𝒐𝒖𝒕 ………….𝑎
𝟐𝒉
1
Example1: A conical tank with a diameter of (2m)
from the top and (5m) deep initially filled with water
.In the a pex of the conical there is a hole with
radius of (0.02m). Find the depth of water in the tank
through a period of: T =0 (25) 100 sec.
With y (100) = 4.6 m
Solution
𝑑𝑦
𝐴(𝑌) = 𝑄𝑖𝑛 − 𝑄𝑜𝑢𝑡
𝑑𝑡
At any depth A(y) = 𝝅𝒙𝟐
1 𝑥 𝑦
= →𝑥=
5 𝑦 5
𝑦 𝜋 2
∴ 𝐴(𝑌) = 𝜋𝑟 2 = 𝜋 ( )2 = 𝑦
5 25
Orifice area (a) = 𝜋𝑟 2
→ 𝑎 = 𝜋(0.02)2 = 4𝜋 10−4
𝑄𝑖𝑛 = 0 = 𝑧𝑒𝑟𝑜
𝑄𝑜𝑢𝑡 = 𝑐𝑑. 𝑎. 𝑉 = 𝑐𝑑. 𝑎. √2𝑔𝑦

= 𝑐𝑑 ∗ π ∗ (0.02)2 ∗ √2 ∗ 9.81√𝑦

𝑙𝑒𝑡 𝑐𝑑 = 1 → 𝑄𝑜𝑢𝑡 = 1 ∗ 𝜋 ∗ 4 ∗ 10−4 √2 ∗ 9.81√𝑦

= (𝜋)1.77 ∗ 10−3 √𝑦
𝑦 2 𝑑𝑦
𝑠𝑜. 𝜋 = 0 − 𝜋 ∗ 1.77 ∗ 10−3 √𝑦
25 𝑑𝑡
𝑦 2 𝑑𝑦
→ = −25 ∗ 1.77 ∗ 10−3
√𝑦 𝑑𝑡

2
‫𝑦𝑑‬
‫‪𝑦1.5‬‬ ‫‪= −0.0443‬‬
‫𝑡𝑑‬
‫‪𝑦𝑖+1 − 𝑦𝑖−1‬‬
‫‪∴ 𝑦𝑖1.5‬‬ ‫‪= −0.0443‬‬
‫‪2ℎ‬‬
‫𝟓‪→ 𝒚𝟏.‬‬
‫)𝑨( ‪𝒊 (𝒚𝒊+𝟏 − 𝒚𝒊−𝟏 ) = −𝟎. 𝟎𝟖𝟖𝟓 𝒉 … … … … . .‬‬

‫‪For i =1‬‬ ‫‪, t = 25‬‬


‫‪𝑦𝑖 = 𝑦1‬‬
‫)‪∴ 𝑦11.5 (𝑦2 − 𝑦0 ) = −0.0885(25‬‬
‫‪𝑦0 = 5‬‬
‫‪→ 𝑦11.5 (𝑦2 − 5) = −2.2125‬‬
‫‪→ 𝑦11.5 𝑦2 − 5𝑦11.5 = −2.2125‬‬ ‫)‪… … … … (1‬‬
‫‪𝑖=2‬‬ ‫‪→ 𝑡𝑖 = 𝑡2 = 50 , 𝑦𝑖 = 𝑦2‬‬
‫)‪𝑦21.5 (𝑦3 − 𝑦1 ) = −0.0885(25.0‬‬
‫‪𝑦21.5 𝑦3 − 𝑦1 𝑦21.5 = −2.2125‬‬ ‫)‪… … … . . (2‬‬ ‫‪Remark‬‬
‫‪𝑖 = 3 → 𝑡3 = 75, 𝑦𝑖 = 𝑦3‬‬ ‫‪Answer‬‬
‫)‪→ 𝑦31.5 (𝑦4 − 𝑦2 ) = −0.0885(25‬‬ ‫𝑚 ‪𝑦1 ≈ 4.9‬‬
‫‪𝑦4 𝑦31.5 − 𝑦2 𝑦31.5 = −2.2125‬‬ ‫𝑚 ‪𝑦2 ≈ 4.8‬‬
‫‪𝐵𝑢𝑡 𝑦4 = 4.6‬‬ ‫𝑚 ‪𝑦3 ≈ 4.69‬‬
‫)‪→∴ 4.6 𝑦31.5 − 𝑦2 𝑦31.5 = −2.2125 … … … … . (3‬‬

‫الحظ ان هذه المعادالت الثالث هي معادالت غير خطيه وعليه فال يجوز حلها باستخدام‬
‫الطرق الخاصه بنضام المعادالت الخطيه ولذالك البد من استخدام طريقه انيوتن‬
‫الخاصه بنضام المعادالت الغير خطيه‬

‫‪3‬‬
Example2
A cylindrical tank with a radius of 2m and a height of 4m has initially filled
with water . the water drain from the tank through an orifice of 2cm diameter.
Find the depth in the tank during a period of find 2000 sec.
Using h=500 sec and y(2000) = 3.56m
Solution
𝑑𝑦
𝐴(𝑦) = 𝑄𝑖𝑛 − 𝑄𝑜𝑢𝑡
𝑑𝑡
𝐴(𝑦) = 𝜋𝑅 2 = 𝜋(2)2 = 4𝜋
𝑄𝑜𝑢𝑡 = 𝑎 . 𝑣 = 𝑎 √2𝑔𝑦
1 2 1 2
𝑎 = 𝜋𝑟 2 = 𝜋( ) =( ) 𝜋
100 100
1 2
𝑄𝑜𝑢𝑡 = ( ) 𝜋 √2𝑔𝑦 = 1.392 ∗ 10−3 √𝑦
100
𝑄𝑖𝑛 = 0
𝑑𝑦
∴ 4𝜋 = 𝑄𝑖𝑛 − 𝑄𝑜𝑢𝑡
𝑑𝑡
𝑑𝑦
4𝜋 = 0 − 1.392 ∗ 10−3 √𝑦
𝑑𝑡
𝑑𝑦
→ = −1.11 ∗ 10−4 √𝑦
𝑑𝑡
𝑑𝑦
∴ + 1.11 ∗ 10−4 √𝑦 = 0
𝑑𝑡
𝑦𝑖+1 − 𝑦𝑖−1
+ 1.11 ∗ 10−4 √𝑦𝑖 = 0
2ℎ
𝑦𝑖+1 − 𝑦𝑖−1 + 1.11 ∗ 10−4 (2ℎ)√𝑦𝑖 = 0
𝑓𝑜𝑟 ℎ = 500 →

4
‫‪𝑦𝑖+1 − 𝑦𝑖−1 + 1.11 ∗ 10−4 (2 ∗ 500)√𝑦𝑖 = 0‬‬

‫)𝑨( ‪→ 𝒚𝒊+𝟏 − 𝒚𝒊−𝟏 + 𝟎. 𝟏𝟏√𝒚𝒊 = 𝟎 … … … … … … … .‬‬

‫‪Now:‬‬
‫‪𝑖 = 1 → 𝑦𝑖 = 𝑦1 , 𝑡1 = 500‬‬
‫‪𝑦2 − 𝑦0 + 0.11√𝑦1 = 0‬‬
‫‪𝐵𝑢𝑡 𝑦0 = 4 ,‬‬
‫)‪∴ 𝑦2 + 0.11√𝑦1 = 4 … … … … … … … … … . (1‬‬
‫‪𝑖 = 2 → 𝑦𝑖 = 𝑦2 , 𝑡1 = 1000‬‬
‫)‪𝑦3 − 𝑦1 + 0.11√𝑦2 = 4 … … … … … … … … … . . (2‬‬
‫‪𝑖 = 3 → 𝑦𝑖 = 𝑦3 & 𝑡3 = 1500‬‬
‫‪𝑦4 − 𝑦2 + 0.11√𝑦3 = 0‬‬ ‫‪,‬‬ ‫‪𝐵𝑢𝑡 𝑦4 = 3.56‬‬

‫)‪∴ −𝑦2 + 0.11√𝑦3 = −3.56 … … … … … … … (3‬‬


‫اذن لدينا ثالث معادالت بثالثة مجاهيل هي ‪𝑦1 , 𝑦2 , 𝑦3‬‬
‫تحل آنيا لحساب المجاهيل مع مالحظة ان هذه المعادالت غير خطية‬
‫‪Note: the answer is‬‬
‫𝑠‪𝑦1 = 3.89 𝑚 𝑎𝑡 𝑡1 = 500‬‬
‫𝑠‪𝑦2 = 3.78 𝑚 𝑎𝑡 𝑡2 = 1000‬‬
‫𝑠‪𝑦3 = 3.68 𝑚 𝑎𝑡 𝑡3 = 1500‬‬

‫‪5‬‬
Home work
An inverse conical tank with a diameter of (2 m) and height of (5 m) filled with
water. A hole has a radius of (0.02 m) in the center of the base. After a time of 100
s the depth at the tank became 2.185 m. Find the depths through the time
t = 0 (25) 100

You might also like