Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dg
dg
Commits
a08f08d5
Commit
a08f08d5
authored
Jun 01, 2017
by
Jonathan Lambrechts
Browse files
partial slip boundary
parent
6698eb32
Pipeline
#2074
failed with stage
in 32 minutes and 11 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
modules/shallowWater/dgConservationLawShallowWater2d.cpp
View file @
a08f08d5
...
...
@@ -467,7 +467,6 @@ dgConservationLawShallowWater2d::dgConservationLawShallowWater2d() : dgConservat
_atmPress
=
_fzero
;
_rhoSurf
=
_fzero
;
_rhoSurfGrad
=
_fzerov
;
_slip
=
false
;
_from3D
=
false
;
_linearSolverFrom3D
=
false
;
_etaOld
=
NULL
;
...
...
@@ -562,43 +561,38 @@ dgConservationLawShallowWater2d::~dgConservationLawShallowWater2d() {
// BC : Wall
void
dgConservationLawShallowWater2d
::
dgConservationLawShallowWater2dWallExtValue
(
functorCache
&
cm
,
fullMatrix
<
double
>
&
val
)
const
{
const
fullMatrix
<
double
>
&
normals
=
cm
.
get
(
*
function
::
getNormals
(),
0
);
const
fullMatrix
<
double
>
&
solIn
=
cm
.
get
(
*
function
::
getSolution
(),
0
);
size_t
nQP
=
cm
.
nEvaluationPoint
();
val
.
resize
(
nQP
,
3
,
false
);
//cm.setDefaultToSide0(true);
for
(
size_t
i
=
0
;
i
<
nQP
;
i
++
)
{
const
double
nx
=
normals
(
i
,
0
);
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
;
}
}
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
();
val
.
resize
(
nQP
,
3
,
false
);
//cm.setDefaultToSide0(true);
for
(
size_t
i
=
0
;
i
<
nQP
;
i
++
)
{
const
double
nx
=
normals
(
i
,
0
);
const
double
ny
=
normals
(
i
,
1
);
val
(
i
,
0
)
=
solIn
(
i
,
0
);
double
un
=
solIn
(
i
,
1
)
*
nx
+
solIn
(
i
,
2
)
*
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
*>
();
...
...
modules/shallowWater/dgConservationLawShallowWater2d.h
View file @
a08f08d5
...
...
@@ -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);
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment