Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
SPINS_main
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
David Deepwell
SPINS_main
Commits
737aaf15
Commit
737aaf15
authored
Mar 25, 2019
by
David Deepwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add stress extrema to stress diagnostic file
Updated version to 2.0.1
parent
594cd925
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
23 deletions
+42
-23
src/BaseCase.cpp
src/BaseCase.cpp
+41
-22
src/VERSION
src/VERSION
+1
-1
No files found.
src/BaseCase.cpp
View file @
737aaf15
...
...
@@ -525,35 +525,45 @@ void BaseCase::stresses_top(TArrayn::DTArray & u, TArrayn::DTArray & v, TArrayn:
// top stress ( along channel - x )
top_stress_x
(
*
tx
,
u
,
temp
,
gradient_op
,
grid_type
,
size_z
(),
mu
);
double
top_tx_tot
=
pssum
(
sum
(
// integral values (the first is the surface force)
double
fx_tot
=
pssum
(
sum
(
(
*
get_quad_x
())(
ii
)
*
(
*
get_quad_y
())(
jj
)
*
(
*
tx
)));
double
top_t
x_abs
=
pssum
(
sum
(
double
f
x_abs
=
pssum
(
sum
(
(
*
get_quad_x
())(
ii
)
*
(
*
get_quad_y
())(
jj
)
*
abs
(
*
tx
)));
// extrema values
double
tx_max
=
psmax
(
max
(
*
tx
));
double
tx_min
=
psmin
(
min
(
*
tx
));
// top stress ( across channel - y )
top_stress_y
(
*
ty
,
v
,
temp
,
gradient_op
,
grid_type
,
size_z
(),
mu
);
double
top_ty_tot
=
pssum
(
sum
(
// integral values (the first is the surface force)
double
fy_tot
=
pssum
(
sum
(
(
*
get_quad_x
())(
ii
)
*
(
*
get_quad_y
())(
jj
)
*
(
*
ty
)));
double
top_t
y_abs
=
pssum
(
sum
(
double
f
y_abs
=
pssum
(
sum
(
(
*
get_quad_x
())(
ii
)
*
(
*
get_quad_y
())(
jj
)
*
abs
(
*
ty
)));
// total top stress
double
top_ts
=
pssum
(
sum
(
(
*
get_quad_x
())(
ii
)
*
(
*
get_quad_y
())(
jj
)
*
pow
(
pow
(
*
tx
,
2
)
+
pow
(
*
ty
,
2
),
0.5
)));
// extrema values
double
ty_max
=
psmax
(
max
(
*
ty
));
double
ty_min
=
psmin
(
min
(
*
ty
));
double
ts_max
=
psmax
(
max
(
pow
(
pow
(
*
tx
,
2
)
+
pow
(
*
ty
,
2
),
0.5
)));
// write to a stress diagnostic file
if
(
master
())
{
FILE
*
stresses_file
=
fopen
(
"stresses_top.txt"
,
"a"
);
assert
(
stresses_file
);
if
(
itercount
==
0
and
!
restarting
)
fprintf
(
stresses_file
,
"Time, "
"Top_tx_tot, Top_tx_abs, Top_ty_tot, Top_ty_abs, Top_ts
\n
"
);
"tx_max, tx_min, ty_max, ty_min, ts_max, "
"fx_tot, fx_abs, fy_tot, fy_abs
\n
"
);
fprintf
(
stresses_file
,
"%.17f, "
"%.17g, %.17g, %.17g, %.17g, %.17g
\n
"
,
"%.17g, %.17g, %.17g, %.17g, %.17g, "
"%.17g, %.17g, %.17g, %.17g
\n
"
,
time
,
top_tx_tot
,
top_tx_abs
,
top_ty_tot
,
top_ty_abs
,
top_ts
);
tx_max
,
tx_min
,
ty_max
,
ty_min
,
ts_max
,
fx_tot
,
fx_abs
,
fy_tot
,
fy_abs
);
fclose
(
stresses_file
);
}
}
...
...
@@ -570,24 +580,30 @@ void BaseCase::stresses_bottom(TArrayn::DTArray & u, TArrayn::DTArray & v, TArra
// bottom stress ( along channel - x )
bottom_stress_x
(
*
tx
,
Hprime
,
u
,
w
,
temp
,
gradient_op
,
grid_type
,
is_mapped
(),
mu
);
double
bot_tx_tot
=
pssum
(
sum
(
// integral values (the first is the surface force)
double
fx_tot
=
pssum
(
sum
(
(
*
get_quad_x
())(
ii
)
*
pow
(
1
+
pow
(
Hprime
,
2
),
0.5
)
*
(
*
get_quad_y
())(
jj
)
*
(
*
tx
)));
double
bot_t
x_abs
=
pssum
(
sum
(
double
f
x_abs
=
pssum
(
sum
(
(
*
get_quad_x
())(
ii
)
*
pow
(
1
+
pow
(
Hprime
,
2
),
0.5
)
*
(
*
get_quad_y
())(
jj
)
*
abs
(
*
tx
)));
// extrema values
double
tx_max
=
psmax
(
max
(
*
tx
));
double
tx_min
=
psmin
(
min
(
*
tx
));
// bottom stress ( across channel - y )
bottom_stress_y
(
*
ty
,
Hprime
,
v
,
temp
,
gradient_op
,
grid_type
,
is_mapped
(),
mu
);
double
bot_ty_tot
=
pssum
(
sum
(
// integral values (the first is the surface force)
double
fy_tot
=
pssum
(
sum
(
(
*
get_quad_x
())(
ii
)
*
pow
(
1
+
pow
(
Hprime
,
2
),
0.5
)
*
(
*
get_quad_y
())(
jj
)
*
(
*
ty
)));
double
bot_t
y_abs
=
pssum
(
sum
(
double
f
y_abs
=
pssum
(
sum
(
(
*
get_quad_x
())(
ii
)
*
pow
(
1
+
pow
(
Hprime
,
2
),
0.5
)
*
(
*
get_quad_y
())(
jj
)
*
abs
(
*
ty
)));
//
total bottom stres
s
double
bot_ts
=
pssum
(
sum
(
(
*
get_quad_x
())(
ii
)
*
pow
(
1
+
pow
(
Hprime
,
2
),
0.5
)
*
(
*
get_quad_y
())(
jj
)
*
pow
(
pow
(
*
tx
,
2
)
+
pow
(
*
ty
,
2
),
0.5
)));
//
extrema value
s
double
ty_max
=
psmax
(
max
(
*
ty
));
double
ty_min
=
psmin
(
min
(
*
ty
));
double
ts_max
=
psmax
(
max
(
pow
(
pow
(
*
tx
,
2
)
+
pow
(
*
ty
,
2
),
0.5
)));
// write to a stress diagnostic file
if
(
master
())
{
...
...
@@ -595,11 +611,14 @@ void BaseCase::stresses_bottom(TArrayn::DTArray & u, TArrayn::DTArray & v, TArra
assert
(
stresses_file
);
if
(
itercount
==
0
and
!
restarting
)
fprintf
(
stresses_file
,
"Time, "
"Bottom_tx_tot, Bottom_tx_abs, Bottom_ty_tot, Bottom_ty_abs, Bottom_ts
\n
"
);
"tx_max, tx_min, ty_max, ty_min, ts_max, "
"fx_tot, fx_abs, fy_tot, fy_abs
\n
"
);
fprintf
(
stresses_file
,
"%.17f, "
"%.17g, %.17g, %.17g, %.17g, %.17g
\n
"
,
"%.17g, %.17g, %.17g, %.17g, %.17g, "
"%.17g, %.17g, %.17g, %.17g
\n
"
,
time
,
bot_tx_tot
,
bot_tx_abs
,
bot_ty_tot
,
bot_ty_abs
,
bot_ts
);
tx_max
,
tx_min
,
ty_max
,
ty_min
,
ts_max
,
fx_tot
,
fx_abs
,
fy_tot
,
fy_abs
);
fclose
(
stresses_file
);
}
}
src/VERSION
View file @
737aaf15
MAJOR_VERSION=2
MINOR_VERSION=0
PATCH_VERSION=
0
PATCH_VERSION=
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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