Skip to content

Commit

Permalink
Small fixes to NS examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolin3 committed Feb 19, 2025
1 parent 0fc94e1 commit 99bfd2d
Show file tree
Hide file tree
Showing 7 changed files with 606 additions and 9 deletions.
5 changes: 5 additions & 0 deletions miniapps/navier-monolithic-ecm2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ if (MFEM_USE_MPI)
EXTRA_HEADERS ${MFEM_MINIAPPS_COMMON_HEADERS}
LIBRARIES mfem mfem-common navier_monolithic_ecm2)

add_mfem_miniapp(navier-time-convergence-monolithic
MAIN tests/navier_time_convergence.cpp
EXTRA_HEADERS ${MFEM_MINIAPPS_COMMON_HEADERS}
LIBRARIES mfem mfem-common navier_monolithic_ecm2)

add_mfem_miniapp(navier-flowaroundcyl-monolithic
MAIN tests/navier_flowaroundcyl.cpp
EXTRA_HEADERS ${MFEM_MINIAPPS_COMMON_HEADERS}
Expand Down
4 changes: 2 additions & 2 deletions miniapps/navier-monolithic-ecm2/lib/time_adaptivity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ namespace mfem
{
static constexpr real_t chi_min = 0.1;
static constexpr real_t chi_max = 5;
static constexpr real_t chi_reject = 0.5;
static constexpr real_t chi_reject = 0.25;
static constexpr real_t chi_tol = 1e-3;
static constexpr real_t chi_safety = 1.05; // >= 1.0
static constexpr real_t chi_safety = 1.5; // >= 1.0
static constexpr real_t dt_min = 1e-6;
static constexpr real_t dt_max = 1e-1;

Expand Down
3 changes: 3 additions & 0 deletions miniapps/navier-monolithic-ecm2/tests/navier_backstep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ int main(int argc, char *argv[])
naviersolver->WriteFields(step, t);
}

if (pmesh->GetMyRank() == 0)
mfem::out << "CFL: " << CFL << std::endl;

}


Expand Down
6 changes: 3 additions & 3 deletions miniapps/navier-monolithic-ecm2/tests/navier_convergence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct s_NavierContext // Navier Stokes params
real_t kinvis = 0.01;
real_t a = 2.0;
real_t dt = 1e-3;
real_t t_final = 50 * dt;
real_t t_final = 10 * dt;
bool verbose = false;
int fun = 1;
int bdf = 1;
Expand Down Expand Up @@ -304,11 +304,11 @@ int main(int argc, char *argv[])

if (Mpi::Root())
{
cout << "----------------------------------------------------------------------------------------"
cout << "------------------------------------------------------------------------------------------------------------"
<< endl;
cout << left << setw(16) << "DOFs u " << setw(16) << "DOFs p " << setw(16) << "h " << setw(16) << "L^2 error (u) " << setw(16) << "L^2 error (p) " << setw(16);
cout << "L^2 rate (u)" << setw(16) << "L^2 rate (p)" << setw(16) << endl;
cout << "----------------------------------------------------------------------------------------"
cout << "------------------------------------------------------------------------------------------------------------"
<< endl;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ int main(int argc, char *argv[])
if (pmesh->GetMyRank() == 0)
mfem::out << "CFL: " << CFL << std::endl;

if( NS_ctx.paraview && accept_step)
if( NS_ctx.paraview && accept_step )
{
naviersolver->WriteFields(step, t);
}
Expand Down
6 changes: 3 additions & 3 deletions miniapps/navier-monolithic-ecm2/tests/navier_mms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
// Sample run:
//
// 1. Yosida block preconditioner + ApproximateDiscreteLaplacian Schur complement preconditioner
// mpirun -np 4 ./navier-mms-monolithic -d 2 -e 1 -n 10 -rs 0 -rp 0 -ou 2 -op 1 -dt 1e-3 -tf 1e-2 -f 1 -bcs 1 --preconditioner 4 --schur-preconditioner 5
// mpirun -np 4 ./navier-mms-monolithic -d 2 -e 1 -n 10 -rs 0 -rp 0 -ou 2 -op 1 -dt 1e-3 -tf 1e-2 -f 3 -bcs 0 --preconditioner 4 --schur-preconditioner 5
//
// 2. Mass lumping
// mpirun -np 4 ./navier-mms-monolithic -d 2 -e 1 -n 10 -rs 0 -rp 0 -ou 2 -op 1 -dt 1e-3 -tf 1e-2 -f 1 -bcs 1 --preconditioner 4 --schur-preconditioner 5 --mass-lumping
// mpirun -np 4 ./navier-mms-monolithic -d 2 -e 1 -n 10 -rs 0 -rp 0 -ou 2 -op 1 -dt 1e-3 -tf 1e-2 -f 3 -bcs 0 --preconditioner 4 --schur-preconditioner 5 --mass-lumping
//
// 3. Stiff strain
// mpirun -np 4 ./navier-mms-monolithic -d 2 -e 1 -n 10 -rs 0 -rp 0 -ou 2 -op 1 -dt 1e-3 -tf 1e-2 -f 1 -bcs 1 --preconditioner 4 --schur-preconditioner 5 --stiff-strain
// mpirun -np 4 ./navier-mms-monolithic -d 2 -e 1 -n 10 -rs 0 -rp 0 -ou 2 -op 1 -dt 1e-3 -tf 1e-2 -f 3 -bcs 0 --preconditioner 4 --schur-preconditioner 5 --stiff-strain
//

#include "lib/navier_solver.hpp"
Expand Down
Loading

0 comments on commit 99bfd2d

Please sign in to comment.