esonusharma.github.io academy2024-03-14T00:00:00Zhttps://esonusharma.github.io/sonu sharmaFree/Libre and Open-Source Software2024-03-14T00:00:00Zhttps://esonusharma.github.io/free-libre-and-open-source-software.html<h3>Resources</h3>
<ul>
<li><a href="https://www.fsf.org/about/">Free Software Foundation</a></li>
<li><a href="https://www.gnome.org/">Gnome</a></li>
<li><a href="https://ubuntu.com/download/desktop">Ubuntu</a></li>
<li><a href="https://www.virtualbox.org/wiki/Downloads">Virtualbox</a></li>
<li><a href="https://code.visualstudio.com/">VS Code</a></li>
<li><a href="https://github.com/">Github</a></li>
<li><a href="https://www.w3schools.com/">W3Schools</a></li>
</ul>
<h3>Objectives</h3>
<ul>
<li>Familiarization with Free/Libre and Open Source Software (FLOSS) terminology.</li>
<li>Introduction to Linux (focusing on Ubuntu) and virtual machines (Oracle Virtualbox).</li>
<li>Navigate the Linux environment: Install and manage software, utilize the shell for basic operations and scripting.</li>
<li>Leverage Open Source applications: Explore web development (HTML, CSS, Javascript), office productivity (LibreOffice), code editors (VS Code, Gedit, Nano), and version control (Github).</li>
<li>Integrate Open Source into teaching: Gain practical experience with various software relevant to different disciplines.</li>
</ul>
<h3>Outcomes</h3>
<p>Participants will be able to:</p>
<ul>
<li>Define and explain key FLOSS concepts.</li>
<li>Install and operate a Linux system (Ubuntu) within a virtual machine environment (using Oracle Virtualbox).</li>
<li>Navigate the Linux shell, perform basic installations, and utilize scripting for automation.</li>
<li>Employ Open Source tools for web development (HTML, CSS, Javascript), document creation (LibreOffice), code editing (VS Code, Gedit, Nano), and manage code collaboratively (Github).</li>
<li>Incorporate Open Source software into their teaching curriculum, catering to the specific needs of their discipline.</li>
</ul>
<h3>Content</h3>
<ul>
<li>Introduction to Free/Libre and Open Source Terminology</li>
<li>Linux</li>
<li>Ubuntu</li>
<li>Oracle Virtualbox</li>
<li>Installation tips for Ubuntu</li>
<li>Installation of software in Ubuntu</li>
<li>Shell</li>
<li>Automating tasks with shell</li>
<li>Ubuntu settings and tools</li>
<li>Programming</li>
<li>C++</li>
<li>HTML, CSS, Javascript</li>
<li>Evolution and Google Accounts</li>
<li>Gedit and Nano</li>
<li>LibreOffice</li>
<li>Github</li>
<li>VS Code</li>
<li>FreeCAD</li>
</ul>
<h3>References</h3>
<ul>
<li><a href="https://esonusharma.github.io/free-libre-and-open-source-software.html">Source 1</a></li>
<li><a href="https://esonusharma.github.io/free-libre-and-open-source-software.html">Source 2</a></li>
</ul>
Pressure2024-02-26T00:00:00Zhttps://esonusharma.github.io/pressure.html<h3>Resources</h3>
<ol>
<li><a href="https://esonusharma.github.io/pressure.html">Video Lecture</a></li>
</ol>
<h3>Total pressure</h3>
<p>Total pressure is the pressure a fluid would have if brought to rest isentropically.</p>
<p>Total pressure (stagnation pressure) = static pressure + dynamic pressure + hydrostatic pressure</p>
<p>$$
p_{stag}=p_{static}+\frac{1}{2}(\rho u^{2})+\rho gh~(along~a~streamline)
$$</p>
<h3>References</h3>
<ul>
<li><a href="https://esonusharma.github.io/pressure.html">Source 1</a></li>
<li><a href="https://esonusharma.github.io/pressure.html">Source 2</a></li>
</ul>
Pointer2024-02-23T00:00:00Zhttps://esonusharma.github.io/pointer.html<pre><code>#include<iostream>
using namespace std;
int main()
{
int x, *y;
x=7;
y=&x;
cout<<"x= "<<x<<endl;
cout<<"*y= "<<*y<<endl;
cout<<"&x= "<<&x<<endl;
cout<<"y= "<<y<<endl;
return 0;
}
Output:
x= 7
*y= 7
&x= 0x8kkkkkkkwn6c
y= 0x8kkkkkkkwn6c
</code></pre>
Mathematical Symbols2024-02-23T00:00:00Zhttps://esonusharma.github.io/mathematical-symbols.html<table>
<thead>
<tr>
<th style="text-align:center"><strong>Symbol</strong></th>
<th style="text-align:center"><strong>Symbol Name</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">$\approx$</td>
<td style="text-align:center">approximately equal</td>
</tr>
<tr>
<td style="text-align:center">$\neq$</td>
<td style="text-align:center">not equal to</td>
</tr>
<tr>
<td style="text-align:center">$\leq$</td>
<td style="text-align:center">inequality, less than or equal to</td>
</tr>
<tr>
<td style="text-align:center">$\geq$</td>
<td style="text-align:center">inequality, greater than or equal to</td>
</tr>
<tr>
<td style="text-align:center">$\equiv$</td>
<td style="text-align:center">equivalence</td>
</tr>
<tr>
<td style="text-align:center">( )</td>
<td style="text-align:center">parentheses</td>
</tr>
<tr>
<td style="text-align:center">[ ]</td>
<td style="text-align:center">brackets</td>
</tr>
<tr>
<td style="text-align:center">{ }</td>
<td style="text-align:center">braces</td>
</tr>
<tr>
<td style="text-align:center">$mod$</td>
<td style="text-align:center">modulo</td>
</tr>
<tr>
<td style="text-align:center">$a^b$</td>
<td style="text-align:center">power</td>
</tr>
<tr>
<td style="text-align:center">$\infty$</td>
<td style="text-align:center">lemniscate, infinity</td>
</tr>
<tr>
<td style="text-align:center">$\nabla$</td>
<td style="text-align:center">nabla, del</td>
</tr>
<tr>
<td style="text-align:center">$\partial$</td>
<td style="text-align:center">partial</td>
</tr>
<tr>
<td style="text-align:center">$\cdot$</td>
<td style="text-align:center">period, scalar product, dot product</td>
</tr>
<tr>
<td style="text-align:center">$\times$</td>
<td style="text-align:center">multiply, vector product, cross product</td>
</tr>
<tr>
<td style="text-align:center">$\otimes$</td>
<td style="text-align:center">tensor product</td>
</tr>
<tr>
<td style="text-align:center">$\forall$</td>
<td style="text-align:center">For all</td>
</tr>
<tr>
<td style="text-align:center">$\cup$</td>
<td style="text-align:center">union</td>
</tr>
<tr>
<td style="text-align:center">$\cap$</td>
<td style="text-align:center">intersection</td>
</tr>
<tr>
<td style="text-align:center">$\subset$</td>
<td style="text-align:center">subset</td>
</tr>
<tr>
<td style="text-align:center">$\in$</td>
<td style="text-align:center">in</td>
</tr>
<tr>
<td style="text-align:center">$\notin$</td>
<td style="text-align:center">not in</td>
</tr>
</tbody>
</table>
Greek Letters2024-02-23T00:00:00Zhttps://esonusharma.github.io/greek-letters.html<table>
<thead>
<tr>
<th style="text-align:center"><strong>English</strong></th>
<th style="text-align:center"><strong>Greek</strong></th>
<th style="text-align:center"><strong>Upper Case</strong></th>
<th style="text-align:center"><strong>Lower Case</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">a</td>
<td style="text-align:center">Alpha</td>
<td style="text-align:center">A</td>
<td style="text-align:center">$\alpha$</td>
</tr>
<tr>
<td style="text-align:center">b</td>
<td style="text-align:center">Beta</td>
<td style="text-align:center">B</td>
<td style="text-align:center">$\beta$</td>
</tr>
<tr>
<td style="text-align:center">g</td>
<td style="text-align:center">Gamma</td>
<td style="text-align:center">$\Gamma$</td>
<td style="text-align:center">$\gamma$</td>
</tr>
<tr>
<td style="text-align:center">d</td>
<td style="text-align:center">Delta</td>
<td style="text-align:center">$\Delta$</td>
<td style="text-align:center">$\delta$</td>
</tr>
<tr>
<td style="text-align:center">e</td>
<td style="text-align:center">Epsilon</td>
<td style="text-align:center">E</td>
<td style="text-align:center">$\epsilon, \varepsilon$</td>
</tr>
<tr>
<td style="text-align:center">z</td>
<td style="text-align:center">Zeta</td>
<td style="text-align:center">Z</td>
<td style="text-align:center">$\zeta$</td>
</tr>
<tr>
<td style="text-align:center">h</td>
<td style="text-align:center">Eta</td>
<td style="text-align:center">H</td>
<td style="text-align:center">$\eta$</td>
</tr>
<tr>
<td style="text-align:center">th</td>
<td style="text-align:center">Theta</td>
<td style="text-align:center">$\Theta$</td>
<td style="text-align:center">$\theta, \vartheta$</td>
</tr>
<tr>
<td style="text-align:center">i</td>
<td style="text-align:center">Iota</td>
<td style="text-align:center">I</td>
<td style="text-align:center">$\iota$</td>
</tr>
<tr>
<td style="text-align:center">k</td>
<td style="text-align:center">Kappa</td>
<td style="text-align:center">K</td>
<td style="text-align:center">$\kappa$</td>
</tr>
<tr>
<td style="text-align:center">l</td>
<td style="text-align:center">Lambda</td>
<td style="text-align:center">$\Lambda$</td>
<td style="text-align:center">$\lambda$</td>
</tr>
<tr>
<td style="text-align:center">m</td>
<td style="text-align:center">Mu</td>
<td style="text-align:center">M</td>
<td style="text-align:center">$\mu$</td>
</tr>
<tr>
<td style="text-align:center">n</td>
<td style="text-align:center">Nu</td>
<td style="text-align:center">N</td>
<td style="text-align:center">$\nu$</td>
</tr>
<tr>
<td style="text-align:center">x</td>
<td style="text-align:center">Xi</td>
<td style="text-align:center">$\Xi$</td>
<td style="text-align:center">$\xi$</td>
</tr>
<tr>
<td style="text-align:center">o</td>
<td style="text-align:center">Omicron</td>
<td style="text-align:center">O</td>
<td style="text-align:center">o</td>
</tr>
<tr>
<td style="text-align:center">p</td>
<td style="text-align:center">Pi</td>
<td style="text-align:center">$\Pi$</td>
<td style="text-align:center">$\pi$</td>
</tr>
<tr>
<td style="text-align:center">r</td>
<td style="text-align:center">Rho</td>
<td style="text-align:center">P</td>
<td style="text-align:center">$\rho, \varrho$</td>
</tr>
<tr>
<td style="text-align:center">s</td>
<td style="text-align:center">Sigma</td>
<td style="text-align:center">$\Sigma$</td>
<td style="text-align:center">$\sigma$</td>
</tr>
<tr>
<td style="text-align:center">t</td>
<td style="text-align:center">Tau</td>
<td style="text-align:center">T</td>
<td style="text-align:center">$\tau$</td>
</tr>
<tr>
<td style="text-align:center">u</td>
<td style="text-align:center">Upsilon</td>
<td style="text-align:center">$\Upsilon$</td>
<td style="text-align:center">$\upsilon$</td>
</tr>
<tr>
<td style="text-align:center">ph</td>
<td style="text-align:center">Phi</td>
<td style="text-align:center">$\Phi$</td>
<td style="text-align:center">$\phi, \varphi$</td>
</tr>
<tr>
<td style="text-align:center">ch</td>
<td style="text-align:center">Chi</td>
<td style="text-align:center">X</td>
<td style="text-align:center">$\chi$</td>
</tr>
<tr>
<td style="text-align:center">ps</td>
<td style="text-align:center">Psi</td>
<td style="text-align:center">$\Psi$</td>
<td style="text-align:center">$\psi$</td>
</tr>
<tr>
<td style="text-align:center">o</td>
<td style="text-align:center">Omega</td>
<td style="text-align:center">$\Omega$</td>
<td style="text-align:center">$\omega$</td>
</tr>
</tbody>
</table>
Turbulence2024-02-21T00:00:00Zhttps://esonusharma.github.io/turbulence.html<h3>Resources</h3>
<ol>
<li><a href="https://esonusharma.github.io/turbulence.html">Video Lecture</a></li>
</ol>
<h3>How to Quantify Turbulence?</h3>
<p>In CFD, turbulence intensity $(I)$ is an important parameter as its numerical value can be further used to calculate the turbulence parameters.</p>
<p>Mathematically,</p>
<p>$$
I~=~\frac{u^{\prime}}{\bar{u}}
$$</p>
<p>$u^{\prime}~=~root~mean~square~(rms)~/~standard~deviation~(\sigma)~of~the~turbulent~velocity~fluctuations$
$at~a~particular~location~over~a~specified~time~period$</p>
<p>$\bar{u} = velocity~average~at~same~location~over~same~time~period$</p>
<h3>References</h3>
<ul>
<li><a href="https://esonusharma.github.io/turbulence.html">Source 1</a></li>
<li><a href="https://esonusharma.github.io/turbulence.html">Source 2</a></li>
</ul>
Solvers2024-02-21T00:00:00Zhttps://esonusharma.github.io/solvers.html<h3>Resources</h3>
<ol>
<li><a href="https://esonusharma.github.io/solvers.html">Video Lecture</a></li>
</ol>
<h3><a href="https://esonusharma.github.io/solvers.html">Jacobi Method</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">Gauss-Jordan Method</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">Gauss-Seidel method</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">Symmetric Gauss-Seidel</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">Conjugate gradient method</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">diagonal-based incomplete Cholesky (DIC)</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">diagonal-based incomplete LU (DILU)</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">Biconjugate gradient stabilised method</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">preconditioned CG (PCG) method</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">preconditioned biconjugate gradient (PBiCG)</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">preconditioned biconjugate gradient stabilised method (PBiCGStab)</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">PCG with DIC Preconditioning</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">PBiCGStab with DILU preconditioning</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">Multi-grid method</a></h3>
<h3><a href="https://esonusharma.github.io/solvers.html">GAMG method</a></h3>
<h3>References</h3>
<ul>
<li><a href="https://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf">Source 1</a></li>
<li><a href="https://doc.cfd.direct/notes/cfd-general-principles/algorithms-and-solvers">Source 2</a></li>
</ul>
CFD Equations2024-02-21T00:00:00Zhttps://esonusharma.github.io/cfd-equations.html<h3>Resources</h3>
<ol>
<li><a href="https://esonusharma.github.io/cfd-equations.html">Video Lecture</a></li>
</ol>
<h3><a href="https://esonusharma.github.io/leibniz-integral-rule.html">Leibniz integral rule</a></h3>
<h3><a href="https://esonusharma.github.io/leibniz-rule-material-volume.html">Leibniz rule material volume</a></h3>
<h3><a href="https://esonusharma.github.io/reynolds-transport-theorem.html">Reynolds transport theorem / Reynolds theorem</a></h3>
<h3><a href="https://esonusharma.github.io/greens-theorem.html">Green's theorem</a></h3>
<h3><a href="https://esonusharma.github.io/gauss-divergence-theorem.html">Divergence theorem / Gauss divergence theorem / Gauss’ theorem / Ostrogradsky’s theorem / Gauss-Ostrogradsky theorem</a></h3>
<h3><a href="https://esonusharma.github.io/stokes-theorem.html">Stokes theorem</a></h3>
<h3><a href="https://esonusharma.github.io/material-derivative.html">Material derivative</a></h3>
<h3><a href="https://esonusharma.github.io/cauchy-stress-tensor.html">Cauchy stress tensor</a></h3>
<h3><a href="https://esonusharma.github.io/navier-stokes-equation.html">Navier-Stokes equation</a></h3>
Stokes theorem2024-02-20T00:00:00Zhttps://esonusharma.github.io/stokes-theorem.html<h3>Resources</h3>
<ol>
<li><a href="https://esonusharma.github.io/stokes-theorem.html">Video Lecture</a></li>
</ol>
<p>Stokes theorem relates an integral over an open surface to an integral over the curve bounding that surface.</p>
<p>$$
\int_{S} \nabla \times \overrightarrow{A} \cdot \overrightarrow{n} da=\oint_{C} \overrightarrow{A} \cdot \overrightarrow{d}l
$$</p>
<h3>References</h3>
<ul>
<li><a href="https://eng.libretexts.org/Bookshelves/Electrical_Engineering/Electro-Optics/Book%3A_Electromagnetics_I_(Ellingson)/04%3A_Vector_Analysis/4.09%3A_Stokes'_Theorem">Source 1</a></li>
</ul>
Reynolds transport theorem2024-02-20T00:00:00Zhttps://esonusharma.github.io/reynolds-transport-theorem.html<h3>Resources</h3>
<ol>
<li><a href="https://esonusharma.github.io/reynolds-transport-theorem.html">Video Lecture</a></li>
</ol>
<h3>Reynolds transport theorem / Reynolds theorem</h3>
<p>Reynolds Transport theorem is a generalization of the Leibniz rule and thus the same arguments are used. The only difference is that the velocity has three components and only the perpendicular component enters into the calculations.</p>
<p>$$
\frac{D}{DT} \int_{sys} f \rho dV = \frac{d}{dt} \int_{c.v.} f \rho dV + \int_{S_{c.v.}} f \rho U_{rn} dA
$$</p>
<h3>References</h3>
<ul>
<li><a href="https://eng.libretexts.org/Bookshelves/Civil_Engineering/Book%3A_Fluid_Mechanics_(Bar-Meir)/05%3A_The_Control_Volume_and_Mass_Conservation/5.4%3A_Reynolds_Transport_Theorem">Source 1</a></li>
</ul>
Navier-Stokes equation2024-02-20T00:00:00Zhttps://esonusharma.github.io/navier-stokes-equation.html<h3>Resources</h3>
<ol>
<li><a href="https://esonusharma.github.io/navier-stokes-equation.html">Video Lecture</a></li>
</ol>
<h3>Einstein summation convention</h3>
<p>$$ \frac{\partial \rho}{\partial t} + \frac{\partial(\rho u_{i})}{\partial x_{i}} = 0 $$</p>
<p>$$ \frac{\partial (\rho u_{i})}{\partial t} + \frac{\partial[\rho u_{i}u_{j}]}{\partial x_{j}} = -\frac{\partial p}{\partial x_{i}} + \frac{\partial \tau_{ij}}{\partial x_{j}} + \rho f_{i} $$</p>
<p>$$ \frac{\partial (\rho e)}{\partial t} + (\rho e+p)\frac{\partial u_{i}}{\partial x_{i}} = \frac{\partial(\tau_{ij}u_{j})}{\partial x_{i}} + \rho f_{i}u_{i} + \frac{\partial(\dot{ q_{i}})}{\partial x_{i}} + r $$</p>
<h3>References</h3>
<ul>
<li><a href="https://esonusharma.github.io/navier-stokes-equation.html">Source 1</a></li>
</ul>
Leibniz rule material volume2024-02-20T00:00:00Zhttps://esonusharma.github.io/leibniz-rule-material-volume.html<h3>Resources</h3>
<ol>
<li><a href="https://esonusharma.github.io/leibniz-rule-material-volume.html">Video Lecture</a></li>
</ol>
<p>$$
\frac{D}{D t} \int_{V_{m}(t)} f(\vec{x}, t) d V=\int_{V_{m}(t)}\left(\frac{\partial f}{\partial t}+\vec{\nabla} \cdot f \vec{u}\right) dV
$$</p>
<h3>References</h3>
<ul>
<li><a href="https://eng.libretexts.org/Bookshelves/Civil_Engineering/Book%3A_All_Things_Flow_-_Fluid_Mechanics_for_the_Natural_Sciences_(Smyth)/06%3A_Fluid_Dynamics/6.01%3A_Solution_methods#EQN+6.1.4">Source 1</a></li>
</ul>
Leibniz integral rule2024-02-20T00:00:00Zhttps://esonusharma.github.io/leibniz-integral-rule.html<h3>Resources</h3>
<ol>
<li><a href="https://esonusharma.github.io/leibniz-integral-rule.html">Video Lecture</a></li>
</ol>
<p>Leibniz integral rule gives a formula for differentiation of a definite integral whose limits are functions of the differential variable.</p>
<p>$$
\frac{d}{d t} \int_{V(t)} f(\vec{x}, t) d V=\int_{V(t)} \frac{\partial f}{\partial t} d V+\int_{A(t)} f \vec{u}_{A} \cdot \hat{n} dA
$$</p>
<h3>References</h3>
<ul>
<li><a href="https://eng.libretexts.org/Bookshelves/Civil_Engineering/Book%3A_All_Things_Flow_-_Fluid_Mechanics_for_the_Natural_Sciences_(Smyth)/06%3A_Fluid_Dynamics/6.01%3A_Solution_methods">Source 1</a></li>
</ul>
Greens theorem2024-02-20T00:00:00Zhttps://esonusharma.github.io/greens-theorem.html<h3>Resources</h3>
<ol>
<li><a href="https://esonusharma.github.io/greens-theorem.html">Video Lecture</a></li>
</ol>
<p>Green’s theorem relates the line integral around a closed curve with a double integral over the region inside the curve:</p>
<p>$$
\int_{C} F \cdot ds = \int \int_{D} (curl F)\cdot k dA
$$</p>
<p>$$
\oint_C \textbf{f}\cdot d\textbf{r} = \iint\limits_R \left( \frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y} \right)dA
$$</p>
<h3>References</h3>
<ul>
<li><a href="https://math.libretexts.org/Bookshelves/Calculus/Vector_Calculus_(Corral)/04%3A_Line_and_Surface_Integrals/4.03%3A_Greens_Theorem">Source 1</a></li>
</ul>
Gauss divergence theorem2024-02-20T00:00:00Zhttps://esonusharma.github.io/gauss-divergence-theorem.html<h3>Resources</h3>
<ol>
<li><a href="https://esonusharma.github.io/gauss-divergence-theorem.html">Video Lecture</a></li>
</ol>
<h3>Divergence theorem / Gauss divergence theorem / Gauss’ theorem / Ostrogradsky’s theorem / Gauss-Ostrogradsky theorem</h3>
<p>The divergence theorem relates an integral over a volume to an integral over the surface bounding that volume. The divergence theorem states that the integral of the divergence of a vector field over a volume is equal to the flux of that field through the surface bounding that volume.</p>
<p>$$
\int_{\mathcal V} \left( \nabla \cdot {\bf A} \right) dv = \oint_{\mathcal S} {\bf A}\cdot d{\bf s}
$$</p>
<h3>References</h3>
<ul>
<li><a href="https://eng.libretexts.org/Bookshelves/Electrical_Engineering/Electro-Optics/Book%3A_Continuum_Electromechanics_(Melcher)/02%3A_Electrodynamic_Laws_Approximations_and_Relations/2.06%3A_Integral_Theorems">Source 1</a></li>
</ul>
cfdCode cpp 1D Diffusion Equation2024-02-06T00:00:00Zhttps://esonusharma.github.io/cfdcode-cpp-1d-diffusion-equation.html<ol>
<li>source file</li>
</ol>
<pre><code>#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include "gnuplot-iostream.h"
using namespace std;
int main() {
Gnuplot gp;
int nx = 41;
double dx = 2.0 / (nx - 1);
int nt = 20;
double nu = 0.3;
double k = 0.2;
double dt = k * pow(dx, 2) / nu;
vector<double> u(nx, 1.0);
for (int i = int(0.5 / dx); i <= int(1 / dx); i++) {
u[i] = 2.0;
}
vector<double> un(nx, 1.0);
for (int n = 1; n <= nt; n++) {
un = u;
for (int i = 1; i < nx - 1; i++) {
u[i] = un[i] + nu * dt / pow(dx, 2) * (un[i+1] - 2 * un[i] + un[i-1]);
}
}
ofstream outfile("output.dat");
for (int i = 0; i < nx; i++) {
outfile << i * dx << " " << u[i] << "\n";
}
outfile.close();
gp << "set title 'x vs u graph'\n";
gp << "set xlabel 'x'\n";
gp << "set ylabel 'u'\n";
gp << "set grid\n";
gp << "set xtics rotate by 90 right\n";
// gp << "set term png\n";
// gp << "set output 'sample-csv.png'\n";
gp << "plot('output.dat') using 2:xticlabel(1) with linespoints\n";
return 0;
}
</code></pre>
<ol start="2">
<li><a href="https://github.com/dstahlke/gnuplot-iostream/blob/master/gnuplot-iostream.h">gnuplot header file</a></li>
</ol>
<p>copy the text from above link, paste it in a text file, save this file with extension ".h" as "gnuplot-iostream.h" in the same folder of the source code.</p>
Solved Nomenclature Not Generated in PDF Created by Visual Studio Code LaTeX Workshop Extension2023-07-14T00:00:00Zhttps://esonusharma.github.io/solved-nomenclature-not-generated-in-pdf-created-by-visual-studio-code-latex-workshop-extension.html<p>The problem regarding not generation of nomenclature in pdf documents created by Visual Studio Code is finally solved.</p>
<p>You may have gone through search engines following the advice to display nomenclature but nothing worked like:</p>
<ul>
<li><a href="https://github.com/James-Yu/LaTeX-Workshop/issues/384">Solution 1</a></li>
<li><a href="https://latex.org/forum/viewtopic.php?t=34350">Solution 2</a></li>
<li><a href="https://latex.org/forum/viewtopic.php?t=27292">Solution 3</a></li>
<li><a href="https://tex.stackexchange.com/questions/62061/problem-with-the-nomenclature">Solution 4</a></li>
<li><a href="https://stackoverflow.com/questions/58895384/how-to-modify-makeindex-script-in-vs-code-for-latex">Solution 5</a></li>
<li><a href="https://tex.stackexchange.com/questions/577405/printnomenclature-doesnt-work">Solution 6</a></li>
</ul>
<p>Popular searches regarding the same:</p>
<pre><code>- Problem with the nomenclature
- nomencl latex won't show output
</code></pre>
<h3>Solution</h3>
<ul>
<li>Step 1. In Visual Studio Code, Open File -> Preferences -> Settings and search for "latex-workshop.latex.tools" in that.</li>
<li>Step 2. Add the following code inside the "latex-workshop.latex.tools"</li>
</ul>
<pre><code>{
"name": "makeindex",
"command": "makeindex",
"args": [
"%DOCFILE%.nlo",
"-s",
"nomencl.ist",
"-o",
"%DOCFILE%.nls"
],
"env": {}
},
</code></pre>
<ul>
<li>Step 3. Again Open File -> Preferences -> Settings and search for "latex-workshop.latex.recipes" in that. Modify the following command:</li>
</ul>
<pre><code>{
"name": "pdflatex -> bibtex -> pdflatex * 2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
</code></pre>
<p>like the below command:</p>
<pre><code>{
"name": "pdflatex -> bibtex -> makeindex -> pdflatex * 2",
"tools": [
"pdflatex",
"bibtex",
"makeindex",
"pdflatex",
"pdflatex"
]
},
</code></pre>
<ul>
<li>Step 4. Save the file.</li>
<li>Step 5. Open the "LaTeX Workshop" Extension Menu in Visual Studio Code and run the command with "pdflatex -> bibtex -> makeindex -> pdflatex * 2" name.</li>
</ul>
Difference between SCI and SCIE2020-07-18T00:00:00Zhttps://esonusharma.github.io/difference-between-sci-and-scie.html<h3>Master Journal List : Removal of SCI</h3>
<p>SCI has been removed from the Clarivate Analytics Master Journal List, the details can be found on an official link <a href="https://support.clarivate.com/ScientificandAcademicResearch/s/article/Master-Journal-List-Removal-of-SCI?language=en_US">here</a>.</p>
<p>Present Master Journal List can be found <a href="https://mjl.clarivate.com/collection-list-downloads">here</a>.</p>
OpenFOAM Installation2020-06-25T00:00:00Zhttps://esonusharma.github.io/openfoam-installation.html<p>If you are unable to install OpenFOAM in Ubuntu, then you are at the right place.</p>
<p>The installation of OpenFOAM is pretty straight forward in Ubuntu, you just need to follow the instructions <a href="https://openfoam.org/download/">here</a>.</p>
<p>At the time of writing this article, OpenFOAM Version 7 is the latest, so the instructions are specific to that, but you can use the same instructions for other versions with minor changes in names.</p>
<p>I will suggest you to follow the latest instructions on the official site <a href="http://openfoam.org/">OpenFOAM</a>.</p>
<p>Besides that, you can always take a cue from this post too.</p>
<p>Also, you should be connected to internet for installing OpenFOAM.</p>
<h3>Steps to install OpenFOAM on Ubuntu</h3>
<ul>
<li>Open the terminal using the icon or Shortcut “Ctrl+Alt+T”.</li>
<li>Type following commands one by one pressing enter at the end of each command.</li>
</ul>
<p>Commands that need to be executed only once for a given system:</p>
<pre><code> sudo sh -c "wget -O - <https://dl.openfoam.org/gpg.key> | apt-key add -"
sudo add-apt-repository <http://dl.openfoam.org/ubuntu>
</code></pre>
<p>Then Update the system:</p>
<pre><code> sudo apt-get update
</code></pre>
<p>Finally install the OpenFOAM using command below:</p>
<pre><code> sudo apt-get -y install openfoam7
</code></pre>
<p>It will take some time to install it. This will install OpenFOAM as well as paraviewopenfoam as a dependency.</p>
<p>You can find the installed programs in the /opt directory of the Computer system in separate directories.</p>
<p>Don’t worry about the updates, as when you update the Ubuntu, these programs get updated automatically.</p>
<p>At last, you need to do the following after installing before you use OpenFOAM.</p>
<p>Open the bashrc file in your system using following command on the terminal:</p>
<pre><code> gedit ~/.bashrc
</code></pre>
<p>Add the following line at the end of the file:</p>
<pre><code> source /opt/openfoam7/etc/bashrc
</code></pre>
<p>Open a new terminal (<-this is important), and test that OpenFOAM is working by typing on the terminal:</p>
<pre><code> simpleFoam -help
</code></pre>
<p>If successful, output will be something like below:</p>
<pre><code> Usage: simpleFoam [OPTIONS]
options:
-case <dir> specify alternate case directory, default is the cwd
-fileHandler <handler>
override the fileHandler
-hostRoots <(((host1 dir1) .. (hostN dirN))>
slave root directories (per host) for distributed running
-libs <(lib1 .. libN)>
pre-load libraries
-listFunctionObjects
List functionObjects
-listFvOptions List fvOptions
-listRegisteredSwitches
List switches registered for run-time modification
-listScalarBCs List scalar field boundary conditions (fvPatchField<scalar>)
-listSwitches List switches declared in libraries but not set in
etc/controlDict
-listTurbulenceModels
List turbulenceModels
-listUnsetSwitches
List switches declared in libraries but not set in
etc/controlDict
-listVectorBCs List vector field boundary conditions (fvPatchField<vector>)
-noFunctionObjects
do not execute functionObjects
-parallel run in parallel
-postProcess Execute functionObjects only
-roots <(dir1 .. dirN)>
slave root directories for distributed running
-srcDoc display source code in browser
-doc display application documentation in browser
-help print the usage
Using: OpenFOAM-7 (see <https://openfoam.org>)
Build: 7-3bcbaf946ae9
</code></pre>
<p>After that you need to add a project directory in your home folder for your simulation projects using following command on the terminal:</p>
<pre><code> mkdir -p $FOAM_RUN
</code></pre>
<p>The above command will create a directory named OpenFOAM with a subdirectory named “<code><USERNAME></code>-<code><OpenFOAM Version Number></code>” like “x-7” for the username x and version 7 of OpenFOAM.</p>
<p>Errors and solutions encountered in installation of OpenFOAM on Ubuntu:</p>
<p>Check that internet is connected.
Avoid using a proxy.
If you get an error related to ca-certificates then just run the following command on the terminal:</p>
<pre><code> sudo dpkg-reconfigure ca-certificates
</code></pre>
<p>If the problem still persists, then follow the best answer on this <a href="https://superuser.com/questions/437330/how-do-you-add-a-certificate-authority-ca-to-ubuntu">page</a>.</p>
Solved errors were encountered while processing grub efi amd64 signed2020-06-24T00:00:00Zhttps://esonusharma.github.io/solved-errors-were-encountered-while-processing-grub-efi-amd64-signed.html<h3>Execute commands below to solve this problem</h3>
<pre><code>sudo apt-get purge grub\*
sudo apt-get install grub-efi
sudo apt-get autoremove
sudo update-grub
</code></pre>
Fix the Error "debconf DbDriver "config" /var/cache/debconf/config.dat is locked by another process Resource temporarily unavailable2020-06-02T00:00:00Zhttps://esonusharma.github.io/fix-the-error-debconf-dbdriver-config-var-cache-debconf-config-dat-is-locked-by-another-process-resource-temporarily-unavailable.html<p>You have encountered the above error in Debian or Debian based GNU/Linux Distribution.</p>
<p>This may cause problems like:</p>
<pre><code>- errors in sudo apt-get update, sudo apt-get upgrade, sudo apt-get install, and other processes.
- dpkg: error processing package
- post-installation script subprocess returned error exit status 1
- Errors were encountered while processing
- E: Sub-process /usr/bin/dpkg returned an error code (1)
</code></pre>
<h3>Solution</h3>
<ul>
<li>Step 1. Execute command in terminal</li>
</ul>
<pre><code>sudo fuser -v /var/cache/debconf/config.dat
</code></pre>
<ul>
<li>Step 2. You will get result in following format. Copy the PID from it.</li>
</ul>
<pre><code> USER PID ACCESS COMMAND
</code></pre>
<ul>
<li>Step 3. Execute command. Replace PID with your actual PID. If the first command works, then second command will give output “No such process”</li>
</ul>
<pre><code> sudo kill PID
or
sudo kill -9 PID
</code></pre>
<ul>
<li>Step 4. Now you will not get the error.</li>
</ul>
How to Transfer Email from One Account to Another?2019-05-29T00:00:00Zhttps://esonusharma.github.io/how-to-transfer-email-from-one-account-to-another.html<p>A step by step procedure to transfer specific emails from one email account to another.</p>
<p>This method is free and easy to implement.</p>
<p>It is easier to move all old and new emails from one account to another.</p>
<p>But sometimes one needs to transfer only a specific set of emails from one account to another.</p>
<p>The best and easy way to do this is by using an email client over IMAP.</p>
<p>The one I have personally used is Mozilla’s <a href="https://www.mozilla.org/en-US/thunderbird">Thunderbird</a> email client.</p>
<p>Yes, it is not very fancy looking, but it works.</p>
<h3>You can use this method:</h3>
<ul>
<li>If changing the name of a business.</li>
<li>To copy your emails from office email account to personal email account.</li>
</ul>
<p>Download Thunderbird and install it on your Laptop or PC.</p>
<p>Now you have to add the email accounts in Thunderbird between which you want to transfer emails.</p>
<h3>Stepwise Procedure to transfer emails</h3>
<ul>
<li>Launch Thunderbird Client.</li>
<li>Click on Accounts>Create a new account>Email, a pop-up will emerge.</li>
<li>At the bottom of pop-up click the button with the text “Skip this and use my existing email”.</li>
<li>In the next pop-up, specify your name, email, and password and click on continue.</li>
<li>Choose IMAP option now and click on “Done”.</li>
<li>Now, in the next screen log in to your email account with username and password as asked.</li>
<li>Allow the permission to connect with Thunderbird client then.</li>
<li>Now, the email account will be visible in your Thunderbird client on the left side.</li>
<li>You will now notice no or few folders listed under the account name in the client.</li>
<li>To add all the folders and labels in your email account, Click on Advanced Features>Manage Folder Subscriptions or right-click on the email on the left side and click on Subscribe.</li>
<li>A pop-up will emerge, check the boxes in front of all those folders you want to add, click on subscribe and then OK.</li>
<li>Wait a minute, collapse and expand the email link on the left side, now you will see all the specified labels.</li>
<li>Repeat this procedure to add all the email accounts to the Thunderbird client.</li>
<li>Now, select the emails which you want to move or copy from one Gmail account to another, either one by one or ctr+select multiple emails from your email account and right-click, select the move or copy option, then select the target email account and the target label or folder to move or copy selected emails to that.</li>
</ul>
<p>You can use this procedure for various email service providers Thunderbird can connect to.</p>
How to Install Latest Julia Version on Linux?2019-05-29T00:00:00Zhttps://esonusharma.github.io/how-to-install-latest-julia-version-on-linux.html<p>Step-by-Step easy to follow procedure to install Julia programming language on Ubuntu and other Linux based operating systems.</p>
<p>I know how frustrated you are trying to successfully install the latest version of the Julia programming language on Linux.</p>
<p>Installation of Julia is straight-forward in Windows, as you just have to double-click the downloaded exe file and follow the instructions.</p>
<p>These are instructions for installation of Julia on Ubuntu but can be adapted on different Linux distributions such as Fedora etc.</p>
<p>When we want to install the latest version of Julia on Linux distributions, there are no specific instructions.</p>
<p>There is an easy way listed on some sites through a PPA available at <a href="https://launchpad.net/~staticfloat/+archive/ubuntu/juliareleases">https://launchpad.net/~staticfloat/+archive/ubuntu/juliareleases</a>, which has some direct commands to be executed for installing Julia, but the version of the Julia you will get may not be the latest and also this is unsupported and untrusted as mentioned on the above link.</p>
<p>If you try to install Julia from the “Ubuntu Software Centre” or “Synaptic Package Manager” or directly using the command “sudo apt-get install julia”, you are probably going to get a very old version of Julia.</p>
<p>I also faced all these problems as I wanted to install an official, pure, untouched fresh copy of the latest version of Julia to learn and use it.</p>
<p>So finally I embarked upon the hard way of getting the latest Julia stable release version installed on my Ubuntu laptop.</p>
<p>Firstly, we have to download the latest released Julia version from the location “<a href="https://julialang.org/downloads/">https://julialang.org/downloads/</a>”</p>
<p>I used the “Generic Linux Binaries for x86” version. The choice between x86 and ARM depends on the processor of your machine. Also, choose between 32 bit and 64-bit versions based on the Operating system and processor you have on your machine.</p>
<p>After download, you will get a compressed tar.gz archive having a name similar to “julia-0.6.2-linux-x86_64.tar.gz”. As the “julia-0.6.2-linux-x86_64.tar.gz” name suggests that I downloaded the Julia version 0.6.2 which is latest at the time of writing this article, generic Linux binaries i.e. this can be used for any Linux system including Ubuntu, Fedora, Centos and more, x86 system and 64-bit operating system.</p>
<p>The names may differ. Adapt the names accordingly.</p>
<p>Remember these are binaries, these don’t need to be installed as they can be directly used from the directory they are extracted.</p>
<p>These instructions can be followed for getting Julia working on most of the Linux operating systems with little or no modifications, but I cannot guarantee the perfect result. Try it at your own risk.</p>
<p>I am assuming that the downloaded file is in your Downloads directory of Ubuntu.</p>
<p>Open the terminal and navigate to the directory where the downloaded tar.gz file resides, in the present case the Downloads directory.</p>
<p>The terminal when just opened will show</p>
<pre><code> x@xpc:~$
</code></pre>
<p>where x should be replaced by your username and xpc should be replaced by your computer name</p>
<p>Navigate to the Downloads directory using “cd Downloads” command on the terminal written as</p>
<pre><code> x@xpc:~$ cd Downloads
</code></pre>
<p>and then press enter to get following terminal</p>
<pre><code> x@xpc:~/Downloads$
</code></pre>
<p>Extract the tar.gz file using the command “tar -zxvf julia-0.6.2-linux-x86_64.tar.gz” as shown below</p>
<pre><code> x@xpc:~/Downloads$ tar -zxvf julia-0.6.2-linux-x86_64.tar.gz
</code></pre>
<p>Now a directory with extracted contents will be generated in the same parent directory as of the compressed archive with a name similar to “julia-xxxxxxxxxx” where xxxxxxxxxx may be a combination of alphabets and numerals.</p>
<p>This is the final directory you need to run the latest Julia version, no installation is needed.</p>
<p>To run Julia, you can directly run using the Julia file in location “julia-xxxxxxxxxx/bin/julia” as discussed below</p>
<p>Navigate to the bin directory in the extracted directory using the command “cd /Downloads/julia-xxxxxxxxxx/bin” as expressed below</p>
<pre><code> x@xpc:~$ cd /Downloads/julia-xxxxxxxxxx/bin
</code></pre>
<p>The terminal will now be like</p>
<pre><code> x@xpc:~/Downloads/julia-xxxxxxxxxx/bin$
</code></pre>
<p>Now run the command “./julia” to run Julia on the terminal as shown below</p>
<pre><code> x@xpc:~/Downloads/julia-xxxxxxxxxx/bin$ ./julia
</code></pre>
<p>The terminal will now change to Julia as presented below.</p>
<pre><code> julia>
</code></pre>
<p>But the problem is that I have to navigate to the directory every-time to run Julia.</p>
<p>Many people have discussed on the internet about defining the path and alias through very complex procedures and as I am not a hardcore computer geek, it was really difficult for me to understand.</p>
<p>I came to know about making a soft-link.</p>
<p>So I decided to make a soft-link to the Julia to run it directly from anywhere with a short command without navigating to the directory containing it.</p>
<p>I always try to do things neatly, so I decided to keep the extracted directory named “julia-xxxxxxxxxx” in the “/opt” directory of my system as most of my important programs reside in that.</p>
<p>You need superuser terminal to copy a file into the “/opt” directory.</p>
<p>So I used the command “sudo su” and then provided the password to get the superuser privileges as expressed below</p>
<pre><code> x@xpc:~$ sudo su
[sudo] password for x:
root@xpc:/home/x#
</code></pre>
<p>Now navigate to the directory presently containing the extracted directory as expressed below</p>
<pre><code> root@xpc:/home/x# cd /Downloads/
root@xpc:/home/x/Downloads#
</code></pre>
<p>Copy the directory using the command “cp -r julia-xxxxxxxxxx /opt” as shown below</p>
<pre><code> root@xpc:/home/x/Downloads# cp -r julia-xxxxxxxxxx /opt
</code></pre>
<p>After the directory is copied to the destination, now we will make the soft-link in a directory which is in the system path so that the soft-link can be called from any location to run Julia.</p>
<p>To find out the directories in the system PATH use command “echo $PATH”, you will get a list of paths of directories separated by a colon(:) such as “/usr/local/bin”. You can use any of them. I used “/usr/local/bin” for the soft-link.</p>
<p>Navigate to the chosen folder</p>
<pre><code> root@xpc:/home/x# cd /usr/local/bin
</code></pre>
<p>The terminal will become</p>
<pre><code> root@xpc:/home/x/usr/local/bin#
</code></pre>
<p>Create the soft-link using the command “sudo ln -s /opt/julia-xxxxxxxxxx/bin/julia julia” as shown below</p>
<pre><code> root@xpc:/home/x/usr/local/bin# sudo ln -s /opt/julia-xxxxxxxxxx/bin/julia julia
</code></pre>
<p>Now return to the normal user terminal using command “ctrl+D” at the empty terminal “root@xpc:/home/x/usr/local/bin#”.</p>
<p>The terminal will become</p>
<pre><code> x@xpc:~$
</code></pre>
<p>Type the newly made soft-link i.e. “julia” on the terminal as shown below</p>
<pre><code> x@xpc:~$ julia
</code></pre>
<p>This is where the magic happens and you get this</p>
<pre><code> julia>
</code></pre>
How to 301 Permanent Redirect Blogger-Blogspot Blog to Domain?2019-05-28T00:00:00Zhttps://esonusharma.github.io/how-to-301-permanent-redirect-blogger-blogspot-blog-to-domain.html<p>I know its difficult to migrate blogger/blogspot blog hosted at bare blogspot domain “<a href="https://your-blog-name.blogspot.com/">https://your-blog-name.blogspot.com</a>” to newly bought branded domain name something like “<a href="https://yoursite.com/">https://yoursite.com</a>”.</p>
<h3>So what exactly is SEO Redirection or 301 Redirection?</h3>
<p>When you want that a blog post or blog page of your blog should transfer its traffic and google search ranking authority to a new URL where this content is shifted, then you need SEO Redirection.</p>
<p>As you are <strong>permanently</strong> moving your blog content under a <strong>new domain name</strong>, you need to tell Google about it, so that Google acknowledges the change and transfers the authority of your content to a new address and does not treat the same content at a new URL as plagiarised content and deny <strong>rankings</strong>.</p>
<p>You can inform this to Google by providing a <strong>301 Redirect</strong> at the old address of the content.</p>
<p>301 Redirect tells Google that the content present at that location is <strong>permanently shifted</strong> to a new address.</p>
<p>The traffic is shifted permanently by Google instantly when it finds this redirect.</p>
<p>But the rankings transfer takes some time.</p>
<p>Normally you can easily create a 301 Redirect for a personal domain name you own.</p>
<h3>301 Redirect can be created by</h3>
<ul>
<li>Defining it in the <strong>.htaccess</strong> file available in the hosting if you have hosting.</li>
<li><strong>Forwarding</strong> the domain name in your domain control panel provided by the domain name provider choosing the <strong>permanent redirect</strong>/forward option if you don’t have hosting.</li>
</ul>
<p>But it seems next to impossible to do the same in the case when you don’t own the domain name as the case in <strong>blogger/blogspot</strong> naked domain.</p>
<p>Now I am going to share a method in which you can achieve this.</p>
<p>I have tried this method when I was shifting from blogger to my own domain name and I was successful in <strong>transferring</strong> the ranking of my popular blog posts to a <strong>new web address</strong> but I cannot guarantee you the same as this is dependent on google and varies on case basis.</p>
<p>Insert the code shown below just after the <code><head></code> tag in the <strong>blogger template</strong> after replacing the generalized content to your own in the code below.</p>
<pre><code> <b:if cond="’data:blog.url" =="“<http://your-blog-name.blogspot.com/YEAR/MONTH/BLOG-POST-SLUG.html>”‘"><meta content="’0;url=http://yoursite.com/NEW-BLOG-POST-SLUG.html’" http-equiv="’refresh’/"></b:if>
<b:if cond="’data:blog.url" =="“<http://your-blog-name.blogspot.com/p/BLOG-PAGE-SLUG.html>”‘"><meta content="’0;url=http://yoursite.com/NEW-BLOG-PAGE-SLUG.html’" http-equiv="’refresh’/"></b:if>
<b:if cond="’data:blog.url" =="“<http://your-blog-name.blogspot.com/>”‘"><meta content="’0;url=http://yoursite.com/’" http-equiv="’refresh’/"></b:if>
</code></pre>
<p>If you are fortunate enough, after a few days of doing this you can see your new URL in place of the old URL in google search.</p>