\documentclass[11pt,reqno]{article}
\usepackage{graphicx}
\usepackage{xspace}
\usepackage{doublespace}
\usepackage{calc,ifthen}
\usepackage{version}
\usepackage{array}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{lscape}
\usepackage[raggedright,figtopcap,TABTOPCAP,tight]{subfigure}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{amsmath_jsb}
\usepackage[notcite,saferef,notref]{saferef_jsb}
\usepackage{url_jsb}
\usepackage{float_jsb}
\usepackage{variables_jsb3}
\usepackage{jsb}
\headheight 0.in %added 1/25/90
\headsep 0.in %added 1/25/90
\textheight 9.in %from 8.in before 1/25/90
\textwidth 6.46in
\oddsidemargin 0.02in
\evensidemargin 0.02in
\parskip 0.6ex


\setstretch{1.2}
\renewcommand{\arraystretch}{1.2}
\begin{document}

%From SRD final report
\include{JSB_definitions.1999-09-02}

\excludeversion{test}
\excludeversion{comment}

\setlength{\topmargin}{-0.5in}
\setlength{\headsep}{0.5in}
\pagestyle{fancy}
\lhead{\textsc{PeGn624a}}
\chead{Compositional Modeling - Application to Enhanced Oil Recovery }
\rhead{Spring 2009}
\lfoot{}
\cfoot{\thepage\ of \pageref{LastPage}}
\rfoot{}

%========  v TitlePage v =======================
{\huge\textbf{\textsc{PeGn624} Homework \# 13}}
\begin{itemize}
\item Assigned: Monday, February 23, 2009
\item Due: Monday, March 2, 2009
\end{itemize}


%========  v Definitions v =======================

\refname{figure}{Figure}{Figures}
\refname[Fig]{figure}{Fig.}{Figs.}
\refname[Figure]{figure}{Figure}{Figures}

\refname{table}{Table}{Tables}
\refname[Tab]{table}{Table}{Tables}
\refname[Table]{table}{Table}{Tables}

\refname{section}{Section}{Sections}
\refname[Sec]{section}{Sec.}{Secs.}
\refname[Section]{section}{Section}{Sections}

\refname{equation}{Eq.}{Eqs.}
\refname[Eq]{equation}{Eq.}{Eqs.}
\refname[Equation]{equation}{Equation}{Equations}

\newcommand{\XX}{\textsf{X}}
\newcommand{\fug}{\mathfrak{f}}
\newcommand{\ff}{\textsf{f}}
\newcommand{\liq}{\textsc{l}}
\newcommand{\vap}{\textsc{v}}

\newcolumntype{R}{>{$}r<{$}}
\newcolumntype{C}{>{$}c<{$}}

%========  v Main Paper v =======================

\section{Question 1: Left-Hand-Side Expansion}

The primary variables are $P_o$, $S_o$, $T$.
When $T<T_s$, $S_g=0$ and $T_s$ is used as the fourth primary variable.
When $T\geq T_s$, $S_g$ is used as the fourth primary variable.

\subsection{Part (a): Water Equation}
\Eqref{water} represents the left-hand-side of the water component equation.
In homework \#10, you expanded this in terms of $P^{n+1}$.
Now complete this expansion in terms of $\delta P_o$ for a 1D problem.
Collect terms for $\delta P_o$.

\begin{equation} \label{water}
\textsf{LHSW} =
  \Delta\left(T_w^n \zeta_w^n X_{w1}^{n} (\Delta P_{w}^{n+1} - \gamma_w^n \Delta D \right) +
  \Delta\left(T_g^n \zeta_g^n Y_{w1}^{n} (\Delta P_{g}^{n+1} - \gamma_g^n \Delta D \right) +
  q_w \zeta_w X_{w1} + q_g \zeta_g Y_{w1}
\end{equation}

\subsection{Part (b): Oil Equation}
\Eqref{oil} represents the left-hand-side of the oil component equation.
In homework \#10, you expanded this in terms of $P^{n+1}$.
Now complete this expansion in terms of $\delta P_o$ for a 1D problem.
Collect terms for $\delta P_o$.

\begin{equation} \label{oil}
\textsf{LHSO} =
  \Delta\left(T_o^n \zeta_o^n X_{w1}^{n} (\Delta P_{o}^{n+1} - \gamma_o^n \Delta D \right) +
  q_o \zeta_o X_{o2}
\end{equation}


\section{Question 2: Energy Equation Expansion}

For the energy equation expansions, note that $H(T)$ is a function of $T$ only.
$U$ is a function of $H(T)$, $P$, and $\zeta(P,T)$.

\subsection{Part (a): Left-Hand-Side for $T<T_s$}
\Eqref{energyL} represents the left-hand-side of the energy equation.
Complete this expansion in terms of the primary variables for a 1D problem.
Collect terms for $\delta P_o$, $\delta T$, $\delta S_o$, and $\delta T_s$.

\begin{multline} \label{energyL}
\textsf{LHSE} =
  \Delta\left(T_w^n \zeta_w^n X_{w1}^{n} H_w^n (\Delta P_{w}^{n+1} - \gamma_w^n \Delta D \right) +
  \Delta\left(T_g^n \zeta_g^n Y_{w1}^{n} H_g^n (\Delta P_{g}^{n+1} - \gamma_g^n \Delta D \right) + \\
  \Delta\left(T_o^n \zeta_o^n X_{w1}^{n} H_o^n (\Delta P_{o}^{n+1} - \gamma_o^n \Delta D \right) +
  \Delta\left( T_e^n \Delta T\right) +
  q_w \zeta_w X_{w1} H_w + q_g \zeta_g Y_{w1} H_g + q_o \zeta_o X_{o2} H_o
\end{multline}

\subsection{Part (b): Left-Hand-Side for $T\geq T_s$}
\Eqref{energyL} represents the left-hand-side of the energy equation.
Complete this expansion in terms of the primary variables for a 1D problem.
Collect terms for $\delta P_o$, $\delta T$, $\delta S_o$, and $\delta S_g$.

\subsection{Part (c): Right-Hand-Side for $T<T_s$}
\Eqref{energyR} represents the right-hand-side of the energy equation.
Complete this expansion in terms of the primary variables for a 1D problem.
Collect terms for $\delta P_o$, $\delta T$, $\delta S_o$, and $\delta T_s$.

\begin{equation} \label{energyR}
\textsf{RHSE} =
   \frac{\textsf{VR}}{\Delta t} \Delta_{t} \left( \phi (S_w \xi_w X_{w1} U_w + S_g \xi_g Y_{w1} U_g + S_o \xi_o X_{o2} U_o) \right) +
   \frac{\textsf{VR}}{\Delta t} \Delta_{t} \left( (1-\phi) (\rho_R C_R T) \right)
\end{equation}

\subsection{Part (d): Right-Hand-Side for $T\geq T_s$}
\Eqref{energyR} represents the right-hand-side of the energy equation.
Complete this expansion in terms of the primary variables for a 1D problem.
Collect terms for $\delta P_o$, $\delta T$, $\delta S_o$, and $\delta S_g$.



\end{document}






