From a60210a8e9b450ab12ea5e947e04e4b1c1b571c0 Mon Sep 17 00:00:00 2001 From: cgilet Date: Wed, 4 Oct 2023 14:38:52 -0400 Subject: [PATCH] Add option to look at conservation in var den cyl problem. --- src/incflo_advance.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/incflo_advance.cpp b/src/incflo_advance.cpp index 3ca3896e..a93a4b45 100644 --- a/src/incflo_advance.cpp +++ b/src/incflo_advance.cpp @@ -100,15 +100,19 @@ void incflo::Advance(Real orig_mass, Real& prev_mass, Real& prev_vol) vol *= dx[0] * dx[1] * dx[2]; #endif - amrex::Print() << "Pred:Change in domain volume " << (vol - prev_vol) << std::endl; + amrex::Print() << "Pred:Change in domain volume " << (vol - prev_vol) << std::endl; + // For plane geoms: amrex::Print() << "Pred:Change in domain mass " << (sum - prev_mass) << std::endl; amrex::Print() << "Pred:Change error " << (sum - prev_mass - vol + prev_vol)/ (vol-prev_vol) << std::endl; - //amrex::Print() << "Pred:Change in domain mass 2D" << (sum - prev_mass - (2.45*.1*.001*16 - .1*.001*16) ) << std::endl; - //amrex::Print() << "Pred:Change in domain mass 3D" << (sum - prev_mass - (0.1*.1*.001*16*16 - 0.1*.1*.001*16) ) << std::endl; - // amrex::Print() << "Pred:Sum of mass at time = " << m_cur_time+m_dt << " " << sum << " " << std::endl; amrex::Print() << "Pred:Change over time in last time step divided by time and area " << (sum - prev_mass) / m_dt / 1.6 << " using " << sum << " " << prev_mass << " " << m_dt << std::endl; + // For cyl/sphere : + // amrex::Print() << "Pred:Change in domain mass 2D " << (sum - prev_mass - (2.45*.1*.001*16 - .1*.001*16) ) << std::endl; + // amrex::Print() << "Pred:Change error " << (sum - prev_mass - (2.45*.1*.001*16 - .1*.001*16) - 1.*(vol - prev_vol))/ (1.*(vol-prev_vol)) << std::endl; + //amrex::Print() << "Pred:Change in domain mass 3D" << (sum - prev_mass - (0.1*.1*.001*16*16 - 0.1*.1*.001*16) ) << std::endl; + // amrex::Print() << "Pred:Sum of mass at time = " << m_cur_time+m_dt << " " << sum << " " << std::endl; + #endif // if (m_advection_type == "MOL") { @@ -151,7 +155,7 @@ void incflo::Advance(Real orig_mass, Real& prev_mass, Real& prev_vol) // " using " << sum << " " << prev_mass << " " << m_dt << std::endl; prev_mass = sum; - prev_vol = vol; + prev_vol = vol; #endif // Stop timing current time step