Skip to content

Commit

Permalink
Adding qp for buoyancy type 1 (#1299)
Browse files Browse the repository at this point in the history
* Changes to EOS.H with moisture

* Change all functions in EOS.H to work with moisture

* Adding qp for buoyancy type 1

* Updating docs for buoyancy term

* Updating docs for buoyancy term

* Update docs for buoyancy

* Avoiding extra divide

* Update buoyancy docs

---------

Co-authored-by: Mahesh Natarajan <[email protected]>
Co-authored-by: Ann Almgren <[email protected]>
  • Loading branch information
3 people authored Nov 16, 2023
1 parent c769d1e commit 7fe006a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions Docs/sphinx_doc/theory/Buoyancy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@

.. _Buoyancy:

Density of the mixture
========================

The total density in a given cell is given by

.. math::
\rho = \frac{m}{V} = \frac{m_a + m_v + m_c + m_p}{V},
where :math:`m_a` is the mass of dry air, :math:`m_v` is the mass of water vapor, :math:`m_c` is the mass of liquid water, and :math:`m_p` is the mass of precipitate.
From the definitions of the mass mixing ratio (ratio of mass of a component to mass of dry air), we have for any component

.. math::
q_i \equiv = \frac{m_i}{m_a}.
Using this we can write

.. math::
\rho = m_a\frac{(1 + q_v + q_c + q_p)}{V}
= \rho_d(1 + q_v + q_c + q_p),
where :math:`\rho_d \equiv \cfrac{m_a}{V}` is the density of dry air.


Buoyancy
=========

Expand Down
4 changes: 2 additions & 2 deletions Source/TimeIntegration/ERF_make_buoyancy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ void make_buoyancy (Vector<MultiFab>& S_data,
amrex::ParallelFor(tbz, [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (1.0 + qv_data(i,j,k ) + qc_data(i,j,k )
+ qi_data(i,j,k )) - r0_arr(i,j,k );
+ qi_data(i,j,k )) + cell_data(i,j,k,RhoQp_comp) - r0_arr(i,j,k );
Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (1.0 + qv_data(i,j,k-1) + qc_data(i,j,k-1)
+ qi_data(i,j,k-1)) - r0_arr(i,j,k-1);
+ qi_data(i,j,k-1)) + cell_data(i,j,k-1,RhoQp_comp) - r0_arr(i,j,k-1);
buoyancy_fab(i, j, k) = grav_gpu[2] * 0.5 * ( rhop_hi + rhop_lo );
});
} // mfi
Expand Down

0 comments on commit 7fe006a

Please sign in to comment.