Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
podlesny
dune-tectonic
Commits
3a625ee1
Commit
3a625ee1
authored
4 years ago
by
podlesny
Browse files
Options
Downloads
Patches
Plain Diff
fix Tresca friction
parent
7985c829
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/tectonic/data-structures/friction/frictionpotential.hh
+15
-12
15 additions, 12 deletions
dune/tectonic/data-structures/friction/frictionpotential.hh
with
15 additions
and
12 deletions
dune/tectonic/data-structures/friction/frictionpotential.hh
+
15
−
12
View file @
3a625ee1
...
@@ -34,14 +34,14 @@ class TruncatedRateState : public FrictionPotential {
...
@@ -34,14 +34,14 @@ class TruncatedRateState : public FrictionPotential {
:
fd
(
_fd
),
weight
(
_weight
),
weightedNormalStress
(
_weightedNormalStress
)
{}
:
fd
(
_fd
),
weight
(
_weight
),
weightedNormalStress
(
_weightedNormalStress
)
{}
double
coefficientOfFriction
(
double
V
)
const
override
{
double
coefficientOfFriction
(
double
V
)
const
override
{
if
(
V
<=
Vmin
or
Vmin
==
0.0
)
if
(
V
<=
Vmin
or
regularity
(
V
)
>
10e8
)
return
0.0
;
return
0.0
;
//std::cout << "V: " << V << " Vmin: " << Vmin << std::endl;
//std::cout << "V: " << V << " Vmin: " << Vmin << std::endl;
auto
res
=
fd
.
a
*
std
::
log
(
V
/
Vmin
);
auto
res
=
fd
.
a
*
std
::
log
(
V
/
Vmin
);
if
(
std
::
isinf
(
res
))
{
if
(
std
::
isinf
(
res
))
{
std
::
cout
<<
"V: "
<<
V
<<
" Vmin: "
<<
Vmin
<<
std
::
endl
;
//
std::cout << "V: " << V << " Vmin: " << Vmin << std::endl;
}
}
return
res
;
return
res
;
...
@@ -49,16 +49,19 @@ class TruncatedRateState : public FrictionPotential {
...
@@ -49,16 +49,19 @@ class TruncatedRateState : public FrictionPotential {
double
differential
(
double
V
)
const
override
{
double
differential
(
double
V
)
const
override
{
//std::cout << "differential: " << weight * fd.C - weightedNormalStress * coefficientOfFriction(V) << std::endl;
//std::cout << "differential: " << weight * fd.C - weightedNormalStress * coefficientOfFriction(V) << std::endl;
if
(
V
<=
Vmin
or
regularity
(
V
)
>
10e8
)
return
0.0
;
return
weight
*
fd
.
C
-
weightedNormalStress
*
coefficientOfFriction
(
V
);
return
weight
*
fd
.
C
-
weightedNormalStress
*
coefficientOfFriction
(
V
);
}
}
double
second_deriv
(
double
V
)
const
override
{
double
second_deriv
(
double
V
)
const
override
{
//std::cout << "second deriv: " << ((V<=Vmin) ? 0.0 : -weightedNormalStress * (fd.a / V)) << std::endl;
//std::cout << "second deriv: " << ((V<=Vmin) ? 0.0 : -weightedNormalStress * (fd.a / V)) << std::endl;
if
(
V
<=
Vmin
or
Vmin
==
0.0
)
if
(
V
<=
Vmin
)
return
0.0
;
return
0.0
;
return
-
weightedNormalStress
*
(
fd
.
a
/
V
);
return
-
weightedNormalStress
*
(
fd
.
a
/
V
);
}
}
double
regularity
(
double
V
)
const
override
{
double
regularity
(
double
V
)
const
override
{
...
@@ -71,10 +74,7 @@ class TruncatedRateState : public FrictionPotential {
...
@@ -71,10 +74,7 @@ class TruncatedRateState : public FrictionPotential {
}
}
double
evaluate
(
double
V
)
const
override
{
double
evaluate
(
double
V
)
const
override
{
if
(
V
<=
Vmin
or
regularity
(
V
)
>
10e8
)
//std::cout << "second deriv: " << ((V<=Vmin) ? 0.0 : weight * fd.C * V - weightedNormalStress * fd.a * V * (std::log(V / Vmin) - 1)) << std::endl;
if
(
V
<=
Vmin
or
Vmin
==
0.0
)
return
0.0
;
return
0.0
;
return
weight
*
fd
.
C
*
V
-
weightedNormalStress
*
fd
.
a
*
V
*
(
std
::
log
(
V
/
Vmin
)
-
1
);
return
weight
*
fd
.
C
*
V
-
weightedNormalStress
*
fd
.
a
*
V
*
(
std
::
log
(
V
/
Vmin
)
-
1
);
...
@@ -83,9 +83,7 @@ class TruncatedRateState : public FrictionPotential {
...
@@ -83,9 +83,7 @@ class TruncatedRateState : public FrictionPotential {
void
updateAlpha
(
double
alpha
)
override
{
void
updateAlpha
(
double
alpha
)
override
{
double
const
logrest
=
(
fd
.
mu0
+
fd
.
b
*
alpha
)
/
fd
.
a
;
double
const
logrest
=
(
fd
.
mu0
+
fd
.
b
*
alpha
)
/
fd
.
a
;
Vmin
=
fd
.
V0
/
std
::
exp
(
logrest
);
Vmin
=
fd
.
V0
/
std
::
exp
(
logrest
);
//Vmin = 0.0;
if
(
Vmin
==
0.0
)
std
::
cout
<<
" logrest: "
<<
logrest
<<
" alpha: "
<<
alpha
<<
std
::
endl
;
}
}
private
:
private
:
...
@@ -143,6 +141,8 @@ class Tresca : public FrictionPotential {
...
@@ -143,6 +141,8 @@ class Tresca : public FrictionPotential {
}
}
double
differential
(
double
V
)
const
override
{
double
differential
(
double
V
)
const
override
{
//if (std::isinf(regularity(V)))
// return 0.0;
return
-
weightedNormalStress
*
coefficientOfFriction
(
V
);
return
-
weightedNormalStress
*
coefficientOfFriction
(
V
);
}
}
...
@@ -151,11 +151,14 @@ class Tresca : public FrictionPotential {
...
@@ -151,11 +151,14 @@ class Tresca : public FrictionPotential {
}
}
double
regularity
(
double
V
)
const
override
{
double
regularity
(
double
V
)
const
override
{
if
(
std
::
abs
(
V
)
<
1e-14
)
// TODO
return
std
::
numeric_limits
<
double
>::
infinity
();
return
std
::
abs
(
second_deriv
(
V
));
return
std
::
abs
(
second_deriv
(
V
));
}
}
double
evaluate
(
double
V
)
const
override
{
double
evaluate
(
double
V
)
const
override
{
return
0
;
return
-
weightedNormalStress
*
fd
.
mu0
*
V
;
}
}
void
updateAlpha
(
double
alpha
)
override
{}
void
updateAlpha
(
double
alpha
)
override
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment