-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathbarra3d.fee
More file actions
84 lines (65 loc) · 2.42 KB
/
Copy pathbarra3d.fee
File metadata and controls
84 lines (65 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
category: thermal
intro: |
# Transient heat conduction from steady-state by "turning off" BCs
This problem solves the transient over a slender cylider arising from "turning off" a heat source that provided a fixed heat flux at both ends, while the cylindrical surface is subject to convection conditions.
The transient goes from $t=0~\text{s}$ up to end time $t=1000~\text{s}$.
We force the time stepper to pass exactly through the following times $t$
* 1
* 10
* 100
* `end_time`/2
At these times, the special variable `in_time_path` is true.
We use an `IF` condition to write the profile along the $x$ axis on
1. a single file named `profiles.dat` with an extra column for the time $t$
2. one file for each time step `profile-t.dat`
for the selected times (or during the static step at $t=0$ and the final step at $t=1000$).
terminal: |
$ gmsh -3 barra3d.geo
$ feenox barra3d.fee
...
# "barra" means "rod" in Spanish
PROBLEM thermal 3d MESH barra3d.msh
# times
end_time = 1000
TIME_PATH 1 10 100 end_time/2
# problem constants [SI]
# D = 0.02
# A = pi*(0.5*D)^2
# instead of computing the area from the geometry we can ask
# feenox to do it for us by explicitly defining a physical
# group with the right dimension, we'll have the variable
# hot_area available with, well you guessed, the group's area
PHYSICAL_GROUP hot DIMENSION 2
L = 1 # length
k = 50 # conductivity
rho = 8000 # density
cp = 400 # heat capaccity
# boundary conditions
# 30 watts, turned off starting at t=eps and ending at t=2*eps
eps = 1e-2
BC hot q=30/hot_area*(1-heaviside(t-eps,eps)) # "hot" has two areas
BC cool h=10 Tref=300
# advance one step
SOLVE_PROBLEM
# sample the 1d profile along the x axis at the time paths
profile(x) = T(x,0,0)
IF in_static|in_time_path|done
# one single file with all the profiles
PRINT_FUNCTION profile t MIN 0 MAX L NSTEPS 100 FILE profiles.dat
# one file fore ach profile
FILE profilet PATH profile-%g.dat t
PRINT_FUNCTION profile MIN 0 MAX L NSTEPS 100 FILE profilet
CLOSE profilet
ENDIF
# print the progress so we know how much is left when we run it
PRINT t T(0.1,0,0)
# write the full transient in a .msh and vtu (+pvd)
WRITE_RESULTS FILE barra3d-transient.msh
WRITE_RESULTS FILE barra3d.vtu
# TODO
# WRITE_RESULTS FILE barra3d-transient.vtk
---
figures: |
{width=100%}
...