Skip to content

Commit

Permalink
Add option to look at conservation in var den cyl problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgilet committed Oct 4, 2023
1 parent 8e19eee commit a60210a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/incflo_advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a60210a

Please sign in to comment.