Commit a08f08d5 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

partial slip boundary

parent 6698eb32
Pipeline #2074 failed with stage
in 32 minutes and 11 seconds
...@@ -467,7 +467,6 @@ dgConservationLawShallowWater2d::dgConservationLawShallowWater2d() : dgConservat ...@@ -467,7 +467,6 @@ dgConservationLawShallowWater2d::dgConservationLawShallowWater2d() : dgConservat
_atmPress = _fzero; _atmPress = _fzero;
_rhoSurf = _fzero; _rhoSurf = _fzero;
_rhoSurfGrad = _fzerov; _rhoSurfGrad = _fzerov;
_slip = false;
_from3D = false; _from3D = false;
_linearSolverFrom3D = false; _linearSolverFrom3D = false;
_etaOld = NULL; _etaOld = NULL;
...@@ -562,43 +561,38 @@ dgConservationLawShallowWater2d::~dgConservationLawShallowWater2d() { ...@@ -562,43 +561,38 @@ dgConservationLawShallowWater2d::~dgConservationLawShallowWater2d() {
// BC : Wall // BC : Wall
void dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValue(functorCache &cm, fullMatrix<double> &val) const { void dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValue(functorCache &cm, fullMatrix<double> &val, double slip_factor) const {
const fullMatrix<double> &normals = cm.get(*function::getNormals(), 0); const fullMatrix<double> &normals = cm.get(*function::getNormals(), 0);
const fullMatrix<double> &solIn = cm.get(*function::getSolution(), 0); const fullMatrix<double> &solIn = cm.get(*function::getSolution(), 0);
size_t nQP = cm.nEvaluationPoint(); size_t nQP = cm.nEvaluationPoint();
val.resize(nQP, 3, false); val.resize(nQP, 3, false);
//cm.setDefaultToSide0(true); //cm.setDefaultToSide0(true);
for (size_t i=0; i< nQP; i++) { for (size_t i=0; i< nQP; i++) {
const double nx = normals (i,0); const double nx = normals (i,0);
const double ny = normals (i,1); const double ny = normals (i,1);
val(i, 0) = solIn(i, 0); val(i, 0) = solIn(i, 0);
double un = solIn (i,1) * nx + solIn (i,2) * ny; double un = solIn (i,1) * nx + solIn (i,2) * ny;
if (_slip) { double ut = -solIn (i,1)*ny + solIn (i,2) * nx;
val(i,1) = solIn (i,1) - 2 * un * nx; // with utan different from 0 val (i,1) = -un*nx-slip_factor*ut*ny;
val(i,2) = solIn (i,2) - 2 * un * ny; val (i,2) = -un*ny+slip_factor*ut*nx;
} }
else {
val (i,1) = -un * nx; // with utan = 0
val (i,2) = -un * ny;
}
}
} }
void dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValueGrad(functorCache &cm, fullMatrix<double> &val) const { void dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValueGrad(functorCache &cm, fullMatrix<double> &val) const {
const fullMatrix<double> &normals = cm.get(*function::getNormals(), 0); // const fullMatrix<double> &normals = cm.get(*function::getNormals(), 0);
const fullMatrix<double> &solGradIn = cm.get(*function::getSolutionGradient(), 0); const fullMatrix<double> &solGradIn = cm.get(*function::getSolutionGradient(), 0);
size_t nQP = cm.nEvaluationPoint(); size_t nQP = cm.nEvaluationPoint();
val.resize(nQP, 9, false); val.resize(nQP, 9, false);
//cm.setDefaultToSide0(true); //cm.setDefaultToSide0(true);
for (size_t i=0; i< nQP; i++) { for (size_t i=0; i< nQP; i++) {
const double nx = normals (i,0); //const double nx = normals (i,0);
const double ny = normals (i,1); //const double ny = normals (i,1);
val(i, 0) = solGradIn(i, 0); val(i, 0) = solGradIn(i, 0);
val(i, 1) = solGradIn(i, 1); val(i, 1) = solGradIn(i, 1);
val(i, 2) = solGradIn(i, 2); val(i, 2) = solGradIn(i, 2);
val(i, 5) = solGradIn(i, 5); val(i, 5) = solGradIn(i, 5);
val(i, 8) = solGradIn(i, 8); val(i, 8) = solGradIn(i, 8);
/*
double unxIn = solGradIn(i,3)*nx + solGradIn(i,6)*ny;// dudx*nx+dvdx*ny double unxIn = solGradIn(i,3)*nx + solGradIn(i,6)*ny;// dudx*nx+dvdx*ny
double unyIn = solGradIn(i,4)*nx + solGradIn(i,7)*ny;// dudy*nx+dvdy*ny double unyIn = solGradIn(i,4)*nx + solGradIn(i,7)*ny;// dudy*nx+dvdy*ny
double utxIn = -solGradIn(i,3)*ny + solGradIn(i,6)*nx;// dudx*-ny+dvdx*nx double utxIn = -solGradIn(i,3)*ny + solGradIn(i,6)*nx;// dudx*-ny+dvdx*nx
...@@ -624,19 +618,18 @@ void dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValu ...@@ -624,19 +618,18 @@ void dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValu
val(i,6) = ny*unxOut + nx*utxOut; val(i,6) = ny*unxOut + nx*utxOut;
val(i,7) = ny*unyOut + nx*utyOut; val(i,7) = ny*unyOut + nx*utyOut;
} }
else { else {*/
val (i,3) = solGradIn(i,3); val (i,3) = solGradIn(i,3);
val (i,4) = solGradIn(i,4); val (i,4) = solGradIn(i,4);
val(i, 6) = solGradIn(i, 6); val(i, 6) = solGradIn(i, 6);
val(i, 7) = solGradIn(i, 7); val(i, 7) = solGradIn(i, 7);
} //}
} }
} }
dgBoundaryCondition *dgConservationLawShallowWater2d::newBoundaryWall(bool slip){ dgBoundaryCondition *dgConservationLawShallowWater2d::newBoundaryWall(double slip_factor){
//return new boundaryWall(this); //return new boundaryWall(this);
_slip = slip; functor *boundaryWallUV = newFunctorMember(*this, &dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValue, slip_factor);
functor *boundaryWallUV = newFunctorMember(*this, &dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValue);
functor *boundaryWallGradUV = newFunctorMember(*this, &dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValueGrad); functor *boundaryWallGradUV = newFunctorMember(*this, &dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValueGrad);
std::vector<const functor*> *toReplace = new std::vector<const functor*>(); std::vector<const functor*> *toReplace = new std::vector<const functor*>();
std::vector<const functor*> *replaceBy = new std::vector<const functor*>(); std::vector<const functor*> *replaceBy = new std::vector<const functor*>();
......
...@@ -19,7 +19,7 @@ class dgConservationLawShallowWater2d : public dgConservationLawFunction { ...@@ -19,7 +19,7 @@ class dgConservationLawShallowWater2d : public dgConservationLawFunction {
void diffusiveFlux(functorCache &cache,fullMatrix<double> &val) const; void diffusiveFlux(functorCache &cache,fullMatrix<double> &val) const;
void diffusivity(functorCache &cache,fullMatrix<double> &val) const; void diffusivity(functorCache &cache,fullMatrix<double> &val) const;
void riemann(functorCache &cache,fullMatrix<double> &val) const; void riemann(functorCache &cache,fullMatrix<double> &val) const;
void dgConservationLawShallowWater2dWallExtValue(functorCache &cache,fullMatrix<double> &val) const; void dgConservationLawShallowWater2dWallExtValue(functorCache &cache,fullMatrix<double> &val, double slip_factor) const;
void dgConservationLawShallowWater2dWallExtValueGrad(functorCache &cache,fullMatrix<double> &val) const; void dgConservationLawShallowWater2dWallExtValueGrad(functorCache &cache,fullMatrix<double> &val) const;
//class boundaryWall; //class boundaryWall;
...@@ -33,7 +33,6 @@ class dgConservationLawShallowWater2d : public dgConservationLawFunction { ...@@ -33,7 +33,6 @@ class dgConservationLawShallowWater2d : public dgConservationLawFunction {
bool _laxFriedrichs; bool _laxFriedrichs;
bool _nudgingVelIsTransport; bool _nudgingVelIsTransport;
double _density; double _density;
bool _slip;
bool _from3D, _linearSolverFrom3D; bool _from3D, _linearSolverFrom3D;
const functor *_bathymetry, *_bathymetryGradient; const functor *_bathymetry, *_bathymetryGradient;
...@@ -133,7 +132,7 @@ class dgConservationLawShallowWater2d : public dgConservationLawFunction { ...@@ -133,7 +132,7 @@ class dgConservationLawShallowWater2d : public dgConservationLawFunction {
// Boundary conditions // Boundary conditions
/**slip wall boundary */ /**slip wall boundary */
dgBoundaryCondition *newBoundaryWall(bool slip = false); dgBoundaryCondition *newBoundaryWall(double slip_factor = 0);
dgBoundaryCondition *newForcedDischarge(dgDofContainer *solution, const functor *discharge, std::string tag); dgBoundaryCondition *newForcedDischarge(dgDofContainer *solution, const functor *discharge, std::string tag);
//dgBoundaryCondition *newBoundaryCouplingSW1D(const functor *solExtF); //dgBoundaryCondition *newBoundaryCouplingSW1D(const functor *solExtF);
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment