Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for Navier-Stokes problem with stabilisation #61

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
97 changes: 97 additions & 0 deletions tests/weak_forms/step-navier_stokes-beltrami-variant_01a.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/* $Id: NavierStokes-Beltrami.cc 2008-04-15 10:54:52CET martinkr $ */
/* Author: Martin Kronbichler, Uppsala University, 2008 */
/* $Id: NavierStokes-Beltrami.cc 2008-04-15 10:54:52CET martinkr $ */
/* Version: $Name$ */
/* */
/* Copyright (C) 2008 by the author */
/* */
/* This file is subject to QPL and may not be distributed */
/* without copyright and license information. Please refer */
/* to the file deal.II/doc/license.html for the text and */
/* further information on this license. */

// ---------------------------------------------------------------------
//
// Copyright (C) 2021 - 2022 by Jean-Paul Pelteret
//
// This file is part of the Weak forms for deal.II library.
//
// The Weak forms for deal.II library is free software; you can use it,
// redistribute it, and/or modify it under the terms of the GNU Lesser
// General Public License as published by the Free Software Foundation;
// either version 3.0 of the License, or (at your option) any later
// version. The full text of the license can be found in the file LICENSE
// at the top level of the Weak forms for deal.II distribution.
//
// ---------------------------------------------------------------------

// This program implements an algorithm for the incompressible Navier-Stokes
// equations solving the whole system at once, i.e., without any projection
// equation.
// It is used as a baseline for the weak form tests.
//
// This variant has no stablisation enabled.


#include "../weak_forms_tests.h"
#include "wf_common_tests/step-navier_stokes-beltrami.h"

namespace StepNavierStokesBeltrami
{
template <int dim>
class NavierStokesProblem : public NavierStokesProblemBase<dim>
{
public:
NavierStokesProblem()
: NavierStokesProblemBase<dim>(0 /*stabilization*/)
{}
};

} // namespace StepNavierStokesBeltrami


int
main(int argc, char **argv)
{
initlog();
deallog << std::setprecision(9);

deallog.depth_file(1);

Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, testing_max_num_threads());

using namespace dealii;
try
{
const int dim = 2;
StepNavierStokesBeltrami::NavierStokesProblem<dim> navier_stokes_problem;
navier_stokes_problem.run();
}
catch (std::exception &exc)
{
std::cerr << std::endl
<< std::endl
<< "----------------------------------------------------"
<< std::endl;
std::cerr << "Exception on processing: " << std::endl
<< exc.what() << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
return 1;
}
catch (...)
{
std::cerr << std::endl
<< std::endl
<< "----------------------------------------------------"
<< std::endl;
std::cerr << "Unknown exception!" << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
return 1;
}
return 0;
}
113 changes: 113 additions & 0 deletions tests/weak_forms/step-navier_stokes-beltrami-variant_01a.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@

DEAL::
DEAL::Time step #1, advancing to t = 0.00640000000 (dt = 0.00640000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [0.000794935913 / 31]
DEAL:: [8.81690581e-05 / 23]
DEAL:: [2.01620663e-08 / 9]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000218979535
DEAL:: ||e_u||_L2 = 1.51215688e-06
DEAL::
DEAL::Time step #2, advancing to t = 0.0464000000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [0.000528302119 / 35]
DEAL:: [1.48399900e-06 / 24]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000206823664
DEAL:: ||e_u||_L2 = 4.11385875e-06
DEAL::
DEAL::Time step #3, advancing to t = 0.0864000000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [2.78743000e-05 / 36]
DEAL:: [2.73603459e-06 / 26]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000202304574
DEAL:: ||e_u||_L2 = 5.17193853e-06
DEAL::
DEAL::Time step #4, advancing to t = 0.126400000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [2.98918388e-05 / 36]
DEAL:: [2.78155124e-06 / 26]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000199699183
DEAL:: ||e_u||_L2 = 5.46486124e-06
DEAL::
DEAL::Time step #5, advancing to t = 0.166400000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [3.05522577e-05 / 36]
DEAL:: [2.78542768e-06 / 26]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000197707075
DEAL:: ||e_u||_L2 = 5.49514628e-06
DEAL::
DEAL::Time step #6, advancing to t = 0.206400000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [3.08047451e-05 / 36]
DEAL:: [2.77665107e-06 / 26]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000195847654
DEAL:: ||e_u||_L2 = 5.45559756e-06
DEAL::
DEAL::Time step #7, advancing to t = 0.246400000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [3.08356009e-05 / 36]
DEAL:: [2.76451480e-06 / 26]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000193993901
DEAL:: ||e_u||_L2 = 5.40498472e-06
DEAL::
DEAL::Time step #8, advancing to t = 0.286400000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [3.07914394e-05 / 36]
DEAL:: [2.75162885e-06 / 26]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000192132203
DEAL:: ||e_u||_L2 = 5.35571082e-06
DEAL::
DEAL::Time step #9, advancing to t = 0.326400000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [3.07316626e-05 / 36]
DEAL:: [2.73864553e-06 / 26]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000190272288
DEAL:: ||e_u||_L2 = 5.30797359e-06
DEAL::
DEAL::Time step #10, advancing to t = 0.366400000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [3.06727381e-05 / 36]
DEAL:: [2.72570752e-06 / 26]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000188422857
DEAL:: ||e_u||_L2 = 5.26040943e-06
DEAL::
DEAL::Time step #11, advancing to t = 0.406400000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [3.06169993e-05 / 36]
DEAL:: [2.71283995e-06 / 26]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000186588320
DEAL:: ||e_u||_L2 = 5.21234131e-06
DEAL::
DEAL::Time step #12, advancing to t = 0.446400000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [3.05635492e-05 / 36]
DEAL:: [2.70009163e-06 / 25]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000184770219
DEAL:: ||e_u||_L2 = 5.16372868e-06
DEAL::
DEAL::Time step #13, advancing to t = 0.486400000 (dt = 0.0400000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [3.05113083e-05 / 36]
DEAL:: [2.68736444e-06 / 25]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000182969048
DEAL:: ||e_u||_L2 = 5.11480698e-06
DEAL::
DEAL::Time step #14, advancing to t = 0.500000000 (dt = 0.0136000000).
DEAL:: Nonlinear iteration [nl error / lin. its]:
DEAL:: [6.93996177e-06 / 26]
DEAL:: L2-Errors:
DEAL:: ||e_p||_L2 = 0.000182962104
DEAL:: ||e_u||_L2 = 5.09134335e-06
Loading