53 PZError <<
"ERROR: " << __PRETTY_FUNCTION__ <<
" - Variable var " << var <<
" not found";
77 for(i = 0; i < n; i++){
78 Solout[i] = Sol[
EVx + i];
83 PZError <<
"Variable " << var <<
" does not have post processing or does not exist" << std::endl;
92 int numbersol = data.
sol.
size();
112 for(i = 0; i < dim; i++) V[i] = sol[
EVx+i];
116 for(i = 0; i < dim; i++) GradK[i] = dsol(i,
EK);
118 for(i = 0; i < dim; i++) GradEps[i] = dsol(i,
EEpsilon);
120 for(i = 0; i < dim; i++) GradPressure[i] = dsol(i,
EPressure);
122 for(i = 0; i < dim; i++){
123 for(j = 0; j < dim; j++){
124 GradV(i,j) = dsol(j,
EVx+i);
129 STATE Rt = K*K /(Eps*
fMU/
fRHO);
130 STATE muT =
fRHO *
fCmu * (K*K/Eps) *
exp(-2.5/(1.+Rt/50.));
134 const int nShape = phi.
Rows();
136 for(i = 0; i < dim; i++){
137 for(j = 0; j < dim; j++){
138 S(i,j) = 0.5 * (GradV(i,j) + GradV(j,i) );
141 STATE Diss = 2. *
fMU * (1. / (4. * K) ) * this->
Dot(GradK, GradK);
144 for(i = 0; i < nShape; i++){
146 for(k = 0; k < dim; k++) GradPhi[k] = dphi(k,i);
147 ef(i*nstate+
EK) += -1. *
fRHO * this->
Dot(V, GradPhi) * K
149 -2.0 * muT * this->
Dot(S,GradV)*phi[i]
150 +
fRHO * Eps * phi[i]
152 valor = -1. *
fRHO * this->
Dot(V, GradPhi) * K
154 -2.0 * muT * this->
Dot(S,GradV)*phi[i]
155 +
fRHO * Eps * phi[i]
160 for(i = 0; i < nShape; i++){
162 for(k = 0; k < dim; k++) GradPhi[k] = dphi(k,i);
165 -1. *
fCepsilon1 * (Eps/K) * 2. * muT * this->
Dot(S,GradV) * phi[i]
167 valor = -1. *
fRHO * this->
Dot(V, GradPhi) * Eps
169 -1. *
fCepsilon1 * (Eps/K) * 2. * muT * this->
Dot(S,GradV) * phi[i]
175 for(i = 0; i < nShape; i++){
178 for(k = 0; k < dim; k++) trGradV += GradV(k,k);
179 ef(i*nstate+
EPressure) += trGradV * phi[i];
180 valor = trGradV * phi[i];
187 T *= (
fMU + muT ) *2.;
188 for(i = 0; i < dim; i++) T(i,i) += -1. * Pressure;
190 for(j = 0; j < dim; j++){
191 for(i = 0; i < nShape; i++){
193 for(k = 0; k < dim; k++) GradPhi[k] = dphi(k,i);
194 valor =
fRHO * this->
Dot(V, GradV, j) * phi[i]
195 -1. * this->
Dot(GradPhi, T, j)
197 ef(i*nstate+
EVx+j) += valor;
220 int i, j, rows, cols;
223 for(i = 0; i < rows; i++){
224 for(j = 0; j < cols; j++){
225 sum += A(i,j) * B(i,j);
235 for(i = 0; i < dim; i++){
245 for(i = 0; i < dim; i++){
246 sum += A[i] * B(BRow,i);
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual int ClassId() const override
Define the class id associated with the class.
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
TPZIncNavierStokesKEps(int id, int dimension)
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var. var is obtained by cal...
TPZGradSolVec dsol
vector of the derivatives of the solution at the integration point
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
virtual void Print(std::ostream &out=std::cout)
Prints out the data associated with the material.
This abstract class defines the behaviour which each derived class needs to implement.
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
Returns the solution associated with the var index based on the finite element approximation.
int64_t size() const
Returns the number of elements of the vector.
void GetParameters(STATE &MU, STATE &RHO, STATE &Cmu, STATE &SigmaK, STATE &SigmaEps, STATE &Cepsilon1, STATE &Cepsilon2, TPZVec< STATE > &BodyForce)
virtual ~TPZIncNavierStokesKEps()
#define DebugStop()
Returns a message to user put a breakpoint in.
This class defines the boundary condition for TPZMaterial objects.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
Computes contribution to the tangent matrix and residual at an integration point. ...
int64_t Rows() const
Returns number of rows.
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
int32_t Hash(std::string str)
Contains the TPZIncNavierStokesKEps class which implements an imcompressible Navier-Stokes formulatio...
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Computes contribution to the stiffness matrix and right hand side at the integration point of a bound...
int ClassId() const override
Unique identifier for serialization purposes.
TPZVec< STATE > fBodyForce
int64_t Cols() const
Returns number of cols.
void SetParameters(STATE MU, STATE RHO, STATE Cmu, STATE SigmaK, STATE SigmaEps, STATE Cepsilon1, STATE Cepsilon2, TPZVec< STATE > &BodyForce)
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ exp
int64_t NElements() const
Returns the number of elements of the vector.
virtual int Dimension() const override
Returns the integrable dimension of the material.
This class implements an imcompressible Navier-Stokes formulation with modified KEpsilon turbulence m...
TPZSolVec sol
vector of the solutions at the integration point
virtual void Print(std::ostream &out=std::cout) override
Print out the data associated with the material.
STATE Dot(TPZFMatrix< STATE > &A, TPZFMatrix< STATE > &B)
Dot for matrices with same dimensions. No consistence test is made.
#define PZError
Defines the output device to error messages and the DebugStop() function.