NeoPZ
TPZReynoldsFlow.cpp
Go to the documentation of this file.
1 //
2 // TPZReynoldsFlow.cpp
3 // PZ
4 //
5 // Created by Cesar Lucci on 06/02/13.
6 //
7 //
8 
9 #include "TPZReynoldsFlow.h"
10 #include "pzbndcond.h"
11 
15 {
16  f_visc = 0.;
17  f_deltaT = 0.;
18  f_staticPotential = 0.;
19  f_nplus1Computation = false;
20 }
21 
22 TPZReynoldsFlow::TPZReynoldsFlow(int matId, REAL visc, REAL deltaT, REAL staticPotential) :
24 TPZMaterial(matId)
25 {
26  f_visc = visc;
27  f_deltaT = deltaT;
28  f_staticPotential = staticPotential;
29  f_nplus1Computation = false;
30 }
31 
34 TPZMaterial(cp)
35 {
36  f_visc = cp.f_visc;
37  f_deltaT = cp.f_deltaT;
40 }
41 
42 
44 {
45 
46 }
47 
48 
50 {
51  return 2;
52 }
53 
54 
56 {
57  return 1;
58 }
59 
61 {
62  if(f_nplus1Computation == false)//estamos no passo n
63  {
64  REAL simmetryy = 2.;
65  STATE wn = simmetryy;
66  wn *= data.sol[1][1];//data.sol = {{p},{ux,uy,uz}} e estamos interessados em uy
67  for(int i = 0; i < data.phi.Rows(); i++)
68  {
69  ef(i,0) += (STATE)(weight * (1./f_deltaT) * data.phi(i,0)) * wn;
70  }
71  }
72  else//estamos no passo n+1
73  {
74  REAL simmetryy = 2.;
75  STATE wnplus1 = (STATE)simmetryy * data.sol[1][1];//data.sol = {{p},{ux,uy,uz}} e estamos interessados em uy
76  STATE w3 = wnplus1*wnplus1*wnplus1;
77  REAL carterGAMMA = 1.;//TODO : Outra cmesh ou estrutura de dados? Lembre-se que valria com o tempo e no espaco!!!
78  for(int i = 0; i < data.phi.Rows(); i++)
79  {
80  ef(i,0) += (STATE)(weight*data.phi(i,0)) * ((STATE)(carterGAMMA * f_staticPotential) - wnplus1*(STATE)(1./f_deltaT));
81  }
82  for(int i = 0; i < data.phi.Rows(); i++)
83  {
84  for(int j = 0; j < data.phi.Rows(); j++)
85  {
86  ek(i,j) += w3 * (STATE)(weight * (1./(12.*f_visc)) * (data.dphix(0,j)*data.dphix(0,i) + data.dphix(1,j)*data.dphix(1,i)));
87  ek(i,j) += (STATE)(weight*carterGAMMA*data.phi(j,0)*data.phi(i,0));
88  }
89  }
90  }
91 }
92 
93 
95 {
96  if(f_nplus1Computation == false)
97  {
98  return;
99  }
100 
101  if(bc.Type() != 1)
102  {
103  DebugStop();
104  }
105 
106  for(int i = 0; i < data.phi.Rows(); i++)
107  {
108  ef(i,0) += (STATE)(weight* data.phi(i,0)) * bc.Val2()(0,0);
109  }
110 }
111 
112 
114 {
115  return new TPZReynoldsFlow(*this);
116 }
117 
118 void TPZReynoldsFlow::Write(TPZStream &buf, int withclassid) const
119 {
120  DebugStop();
121 }
122 
123 void TPZReynoldsFlow::Read(TPZStream &buf, void *context)
124 {
125  DebugStop();
126 }
127 
129  return Hash("TPZReynoldsFlow") ^ TPZMaterial::ClassId() << 1;
130 }
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual ~TPZReynoldsFlow()
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
int Type()
Definition: pzbndcond.h:249
virtual int Dimension() const override
Returns the integrable dimension of the material.
This abstract class defines the behaviour which each derived class needs to implement.
TPZFMatrix< STATE > & Val2(int loadcase=0)
Definition: pzbndcond.h:255
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
TPZFNMatrix< 660, REAL > dphix
values of the derivative of the shape functions
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
virtual TPZMaterial * NewMaterial() override
It computes a contribution to the stiffness matrix and load vector at one BC integration point to mul...
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to the stiffness matrix and load vector at one integration point...
virtual int ClassId() const override
Unique identifier for serialization purposes.
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
int ClassId() const override
Unique identifier for serialization purposes.
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to the stiffness matrix and load vector at one integration point to multip...
TPZSolVec sol
vector of the solutions at the integration point