waves
Basic FE playground
wProblem.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 University of Liège
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef WPROBLEM_H
18 #define WPROBLEM_H
19 
20 #include "flow.h"
21 #include "wObject.h"
22 #include "wF1Ct.h"
23 #include <memory>
24 #include <iostream>
25 #include <vector>
26 #include <Eigen/Dense>
27 
28 namespace flow
29 {
30 
37 class FLOW_API Problem : public fwk::wSharedObject
38 {
39 public:
40  std::shared_ptr<tbox::MshData> msh;
41  int nDim;
42  // Freestream
43  double alpha;
44  double beta;
45  double M_inf;
46  // Reference values
47  double S_ref;
48  double c_ref;
49  Eigen::Vector3d x_ref;
50 #ifndef SWIG
51  // Loads direction
52  F1CtDrag dirD; // drag
53  F1CtSide dirS; // sideforce
54  F1CtLift dirL; // lift
55  // Physical groups
56  std::shared_ptr<Medium> medium;
57  std::vector<std::shared_ptr<Boundary>> bnds;
58  std::shared_ptr<Initial> iIC;
59  std::vector<std::shared_ptr<Dirichlet>> dBCs;
60  std::vector<std::shared_ptr<Freestream>> fBCs;
61  std::vector<std::shared_ptr<Wake>> wBCs;
62  std::vector<std::shared_ptr<Kutta>> kSCs;
63  std::vector<std::shared_ptr<Blowing>> bBCs;
64  // Observers
65  std::vector<fwk::Observer *> obs;
66 #endif
67 
68  Problem(std::shared_ptr<tbox::MshData> _msh, int dim, double aoa, double aos,
69  double minf, double sref, double cref, double xref, double yref,
70  double zref);
71  virtual ~Problem() { std::cout << "~Problem()\n"; }
72 
73  void set(std::shared_ptr<Medium> m);
74  void add(std::shared_ptr<Boundary> b);
75  void set(std::shared_ptr<Initial> i);
76  void add(std::shared_ptr<Dirichlet> d);
77  void add(std::shared_ptr<Freestream> f);
78  void add(std::shared_ptr<Wake> w);
79  void add(std::shared_ptr<Kutta> k);
80  void add(std::shared_ptr<Blowing> b);
81  void update(double aoa);
82 
83 #ifndef SWIG
84  void check() const;
85  void pin();
86  void initElems();
87  void initGradElems();
88  virtual void write(std::ostream &out) const override;
89 #endif
90 };
91 
92 } // namespace flow
93 
94 #endif //WPROBLEM_H
flow::Problem::fBCs
std::vector< std::shared_ptr< Freestream > > fBCs
Freestream boundary conditions.
Definition: wProblem.h:60
flow::Problem::obs
std::vector< fwk::Observer * > obs
classes depending on problem variables
Definition: wProblem.h:65
flow::Problem::beta
double beta
Angle of sideslip.
Definition: wProblem.h:44
flow::Problem::iIC
std::shared_ptr< Initial > iIC
Initial condition.
Definition: wProblem.h:58
flow::F1CtSide
Sideforce direction.
Definition: wF1Ct.h:62
FLOW_API
#define FLOW_API
Definition: flow.h:29
flow::Problem::dirS
F1CtSide dirS
Definition: wProblem.h:53
flow::Problem::dBCs
std::vector< std::shared_ptr< Dirichlet > > dBCs
Dirichlet boundary conditions.
Definition: wProblem.h:59
flow::Problem::alpha
double alpha
Angle of attack.
Definition: wProblem.h:43
flow
Namespace for flow module.
Definition: flow.h:37
flow::F1CtDrag
Drag direction.
Definition: wF1Ct.h:43
flow::Problem::dirD
F1CtDrag dirD
Definition: wProblem.h:52
flow::Problem::bBCs
std::vector< std::shared_ptr< Blowing > > bBCs
Blowing (transpiration) boundary condition.
Definition: wProblem.h:63
flow::Problem::kSCs
std::vector< std::shared_ptr< Kutta > > kSCs
Kutta condition.
Definition: wProblem.h:62
wF1Ct.h
flow::Problem::S_ref
double S_ref
Reference surface.
Definition: wProblem.h:47
flow::Problem::c_ref
double c_ref
Reference chord.
Definition: wProblem.h:48
flow::Problem
Manage the problem.
Definition: wProblem.h:37
flow::Problem::dirL
F1CtLift dirL
Definition: wProblem.h:54
flow::F1CtLift
Lift direction.
Definition: wF1Ct.h:81
flow::Problem::~Problem
virtual ~Problem()
Definition: wProblem.h:71
flow::Problem::medium
std::shared_ptr< Medium > medium
Fluid.
Definition: wProblem.h:56
flow::Problem::x_ref
Eigen::Vector3d x_ref
Reference center point (for moment computation)
Definition: wProblem.h:49
flow::Problem::wBCs
std::vector< std::shared_ptr< Wake > > wBCs
Wake boundary condition.
Definition: wProblem.h:61
flow::Problem::M_inf
double M_inf
Mach number.
Definition: wProblem.h:45
flow::Problem::bnds
std::vector< std::shared_ptr< Boundary > > bnds
Boundaries.
Definition: wProblem.h:57
flow.h
flow::Problem::nDim
int nDim
Problem dimension.
Definition: wProblem.h:41
flow::Problem::msh
std::shared_ptr< tbox::MshData > msh
Mesh structure.
Definition: wProblem.h:40