libMesh
examples
fem_system
fem_system_ex1
naviersystem.h
Go to the documentation of this file.
1
// The libMesh Finite Element Library.
2
// Copyright (C) 2002-2024 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either
7
// version 2.1 of the License, or (at your option) any later version.
8
9
// This library is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
// Lesser General Public License for more details.
13
14
// You should have received a copy of the GNU Lesser General Public
15
// License along with this library; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18
// DiffSystem framework files
19
#include "libmesh/fem_system.h"
20
21
using namespace
libMesh
;
22
23
// The Navier-Stokes system class.
24
// FEMSystem, TimeSolver and NewtonSolver will handle most tasks,
25
// but we must specify element residuals
26
class
NavierSystem
:
public
FEMSystem
27
{
28
public
:
29
// Constructor
30
NavierSystem
(
EquationSystems
& es,
31
const
std::string & name_in,
32
const
unsigned
int
number_in)
33
:
FEMSystem
(es, name_in, number_in), Reynolds(1.), application(0) {}
34
35
// System initialization
36
virtual
void
init_data ();
37
38
// Context initialization
39
virtual
void
init_context(
DiffContext
& context);
40
41
// Element residual and jacobian calculations
42
// Time dependent parts
43
virtual
bool
element_time_derivative (
bool
request_jacobian,
44
DiffContext
& context);
45
46
// Constraint parts
47
virtual
bool
element_constraint (
bool
request_jacobian,
48
DiffContext
& context);
49
virtual
bool
side_constraint (
bool
request_jacobian,
50
DiffContext
& context);
51
52
// Mass matrix part
53
virtual
bool
mass_residual (
bool
request_jacobian,
54
DiffContext
& context);
55
56
// Postprocessed output
57
virtual
void
postprocess ();
58
59
// Indices for each variable;
60
unsigned
int
p_var, u_var, v_var,
w_var
;
61
62
// The Reynolds number to solve for
63
Real
Reynolds
;
64
65
// The application number controls what boundary conditions and/or
66
// forcing functions are applied. Current options are:
67
// 0 - discontinuous lid velocity driven cavity
68
// 1 - homogeneous Dirichlet BC with smooth forcing
69
unsigned
int
application
;
70
71
// Returns the value of a forcing function at point p. This value
72
// depends on which application is being used.
73
Point
forcing(
const
Point
& p);
74
};
libMesh::EquationSystems
This is the EquationSystems class.
Definition:
equation_systems.h:68
NavierSystem::w_var
unsigned int w_var
Definition:
naviersystem.h:60
libMesh::DiffContext
This class provides all data required for a physics package (e.g.
Definition:
diff_context.h:55
NavierSystem::application
unsigned int application
Definition:
naviersystem.h:69
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
libMesh::FEMSystem
This class provides a specific system class.
Definition:
fem_system.h:53
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition:
libmesh_common.h:143
NavierSystem::NavierSystem
NavierSystem(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Definition:
naviersystem.h:30
NavierSystem::Reynolds
Real Reynolds
Definition:
naviersystem.h:63
libMesh::Point
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition:
point.h:39
NavierSystem
Definition:
naviersystem.h:26
Generated on Fri Mar 29 2024 04:50:02 for libMesh by
1.8.14