-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJetandpressure.c
77 lines (68 loc) · 1.8 KB
/
Jetandpressure.c
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
#include "axi.h"
#include "navier-stokes/centered.h"
#define FILTERED // Smear density and viscosity jumps
#include "two-phase.h"
#include "tension.h"
#include "tag.h"
#include "curvature.h"
#define VOFFOLDER "FVFVDb0.00delta0.00V0.18"
scalar pressure[];
double cfdbvbubblediameter = 0.00;
double PreFactor = 2*pi; // 2*pi; for theta integration okay
int main (int argc, char **argv)
{
run();
}
event init (t = 0)
{
double PressureDropMaxima;
double timebgn = 0.00;
double timestp = 0.01;
double timeend = 2.04;
;
char namefile[500];
char name[100];
double timeload;
FILE *ForceonLfet;
char folder[500];
strcpy(folder, "mkdir");
strcat(folder, VOFFOLDER);
system(folder);
for (timeload = timebgn; timeload <= timeend; timeload += timestp)
{
sprintf (namefile, "intermediate/snapshot-%5.4f", timeload);
printf ("load the file %s!\r\n", namefile);
restore (file = namefile);
//calculate the force on the substrate
double pleft = 0.;
double pForce = 0.;
static int nff = 0;
sprintf (name, "%s/ForceFVDb0.00delta0.00V0.18.txt", VOFFOLDER);
if (!nff)
ForceonLfet = fopen(name, "w");
else
ForceonLfet = fopen(name, "a");
double pdatum = 0, wt = 0;
foreach_boundary(top){
pdatum += 2*pi*y*pressure[]*(Delta);
wt += 2*pi*y*(Delta);
}
if (wt >0){
pdatum /= wt;
}
foreach_boundary(left)
{
pForce += 2*pi*y*(Delta)*(pressure[]-pdatum);
pleft += pressure[];
}
boundary((scalar *){f, u.x, u.y, pressure});
;
fprintf (ForceonLfet, "%f %.10f %.10f\r\n", timeload, pForce, pleft);
fclose (ForceonLfet);
nff++;
}
}
event end(t = 0.0)
{
printf("\r\n-------\r\nEND!\r\n");
}