https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PIMPLE.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10// MOOSE includes
11#include "PIMPLE.h"
12#include "FEProblem.h"
13#include "AuxiliarySystem.h"
14#include "LinearSystem.h"
15
16registerMooseObject("NavierStokesApp", PIMPLE);
17
20{
23 "Solves the transient Navier-Stokes equations using the PIMPLE algorithm and "
24 "linear finite volume variables.");
25 params += PIMPLESolve::validParams();
26
27 return params;
28}
29
30PIMPLE::PIMPLE(const InputParameters & parameters) : TransientBase(parameters), _pimple_solve(*this)
31{
32 _fixed_point_solve->setInnerSolve(_pimple_solve);
33}
34
35void
43
44Real
46{
47 if (check_aux)
49 else
50 {
51 // Default criterion for now until we add a "steady-state-convergence-object" option
52 Real residual = 0;
53 for (const auto sys : _pimple_solve.systemsToSolve())
54 residual +=
55 std::pow(sys->solution().l2_norm_diff(sys->solutionOld()) / sys->solution().l2_norm(), 2);
56 return std::sqrt(residual);
57 }
58}
59
60std::set<TimeIntegrator *>
62{
63 // We use a set because time integrators were added to every system, and we want a unique
64 std::set<TimeIntegrator *> tis;
65 // Get all time integrators from the systems in the FEProblemSolve
66 for (const auto sys : _pimple_solve.systemsToSolve())
67 for (const auto & ti : sys->getTimeIntegrators())
68 tis.insert(ti.get());
69 return tis;
70}
registerMooseObject("NavierStokesApp", PIMPLE)
std::unique_ptr< FixedPointSolve > _fixed_point_solve
void addClassDescription(const std::string &doc_string)
const std::vector< LinearSystem * > systemsToSolve() const
Return pointers to the systems which are solved for within this object.
virtual void linkRhieChowUserObject() override
Fetch the Rhie Chow user object that is reponsible for determining face velocities and mass flux.
static InputParameters validParams()
Definition PIMPLESolve.C:16
Executioner set up to solve a transient thermal-hydraulics problem using the PIMPLE algorithm.
Definition PIMPLE.h:21
virtual std::set< TimeIntegrator * > getTimeIntegrators() const override
Definition PIMPLE.C:61
PIMPLE(const InputParameters &parameters)
Definition PIMPLE.C:30
virtual Real relativeSolutionDifferenceNorm(bool check_aux) const override
Definition PIMPLE.C:45
static InputParameters validParams()
Definition PIMPLE.C:19
PIMPLESolve _pimple_solve
The solve object performing the PIMPLE iteration.
Definition PIMPLE.h:35
virtual void init() override
Definition PIMPLE.C:36
void setupPressurePin()
Setup pressure pin if there is need for one.
NumericVector< Number > & solutionOld()
NumericVector< Number > & solution()
static InputParameters validParams()
virtual void init() override
AuxiliarySystem & _aux
Real l2_norm_diff(const NumericVector< T > &other_vec) const
virtual Real l2_norm() const=0