Skip to content
Snippets Groups Projects
Commit 58ef9bfc authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Move coefficient logic to a function

parent 1a5d975c
No related branches found
No related tags found
No related merge requests found
......@@ -139,6 +139,13 @@ template <class FunctionMap> void initPython(FunctionMap &functions) {
.toC<typename FunctionMap::Base>(functions);
}
double computeCOF(double mu0, double a, double b, double V0, double L, double V,
double log_state) {
double const mu =
mu0 + a * std::log(V / V0) + b * (log_state + std::log(V0 / L));
return (mu > 0) ? mu : 0;
}
int main(int argc, char *argv[]) {
try {
Dune::Timer timer;
......@@ -158,7 +165,7 @@ int main(int argc, char *argv[]) {
auto const E = parset.get<double>("body.E");
auto const nu = parset.get<double>("body.nu");
auto const mu = parset.get<double>("boundary.friction.mu");
auto const mu0 = parset.get<double>("boundary.friction.mu0");
auto const a = parset.get<double>("boundary.friction.a");
auto const b = parset.get<double>("boundary.friction.b");
auto const V0 = parset.get<double>("boundary.friction.V0");
......@@ -480,8 +487,8 @@ int main(int argc, char *argv[]) {
state_writer << alpha[i][0] << " ";
displacement_writer << u[i][0] << " ";
velocity_writer << ud[i][0] << " ";
coefficient_writer << mu + a *std::log(ud[i].two_norm() / V0) +
b * (alpha[i] + std::log(V0 / L)) << " ";
coefficient_writer << computeCOF(mu0, a, b, V0, L, ud[i].two_norm(),
alpha[i]) << " ";
}
state_writer << std::endl;
......
......@@ -50,7 +50,7 @@ acceptFactor = 1.0
requiredResidual = 1e-12
[boundary.friction]
mu = 0.6
mu0 = 0.6
a = 0.010
b = 0.015
V0 = 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment