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
_atmPress = _fzero;
_rhoSurf = _fzero;
_rhoSurfGrad = _fzerov;
_slip = false;
_from3D = false;
_linearSolverFrom3D = false;
_etaOld = NULL;
......@@ -562,7 +561,7 @@ dgConservationLawShallowWater2d::~dgConservationLawShallowWater2d() {
// 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> &solIn = cm.get(*function::getSolution(), 0);
size_t nQP = cm.nEvaluationPoint();
......@@ -573,32 +572,27 @@ void dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValu
const double ny = normals (i,1);
val(i, 0) = solIn(i, 0);
double un = solIn (i,1) * nx + solIn (i,2) * ny;
if (_slip) {
val(i,1) = solIn (i,1) - 2 * un * nx; // with utan different from 0
val(i,2) = solIn (i,2) - 2 * un * ny;
}
else {
val (i,1) = -un * nx; // with utan = 0
val (i,2) = -un * ny;
}
double ut = -solIn (i,1)*ny + solIn (i,2) * nx;
val (i,1) = -un*nx-slip_factor*ut*ny;
val (i,2) = -un*ny+slip_factor*ut*nx;
}
}
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);
size_t nQP = cm.nEvaluationPoint();
val.resize(nQP, 9, false);
//cm.setDefaultToSide0(true);
for (size_t i=0; i< nQP; i++) {
const double nx = normals (i,0);
const double ny = normals (i,1);
//const double nx = normals (i,0);
//const double ny = normals (i,1);
val(i, 0) = solGradIn(i, 0);
val(i, 1) = solGradIn(i, 1);
val(i, 2) = solGradIn(i, 2);
val(i, 5) = solGradIn(i, 5);
val(i, 8) = solGradIn(i, 8);
/*
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 utxIn = -solGradIn(i,3)*ny + solGradIn(i,6)*nx;// dudx*-ny+dvdx*nx
......@@ -624,19 +618,18 @@ void dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValu
val(i,6) = ny*unxOut + nx*utxOut;
val(i,7) = ny*unyOut + nx*utyOut;
}
else {
else {*/
val (i,3) = solGradIn(i,3);
val (i,4) = solGradIn(i,4);
val(i, 6) = solGradIn(i, 6);
val(i, 7) = solGradIn(i, 7);
}
//}
}
}
dgBoundaryCondition *dgConservationLawShallowWater2d::newBoundaryWall(bool slip){
dgBoundaryCondition *dgConservationLawShallowWater2d::newBoundaryWall(double slip_factor){
//return new boundaryWall(this);
_slip = slip;
functor *boundaryWallUV = newFunctorMember(*this, &dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValue);
functor *boundaryWallUV = newFunctorMember(*this, &dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValue, slip_factor);
functor *boundaryWallGradUV = newFunctorMember(*this, &dgConservationLawShallowWater2d::dgConservationLawShallowWater2dWallExtValueGrad);
std::vector<const functor*> *toReplace = new std::vector<const functor*>();
std::vector<const functor*> *replaceBy = new std::vector<const functor*>();
......
......@@ -19,7 +19,7 @@ class dgConservationLawShallowWater2d : public dgConservationLawFunction {
void diffusiveFlux(functorCache &cache,fullMatrix<double> &val) const;
void diffusivity(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;
//class boundaryWall;
......@@ -33,7 +33,6 @@ class dgConservationLawShallowWater2d : public dgConservationLawFunction {
bool _laxFriedrichs;
bool _nudgingVelIsTransport;
double _density;
bool _slip;
bool _from3D, _linearSolverFrom3D;
const functor *_bathymetry, *_bathymetryGradient;
......@@ -133,7 +132,7 @@ class dgConservationLawShallowWater2d : public dgConservationLawFunction {
// Boundary conditions
/**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 *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