Skip to content

Commit

Permalink
Merge pull request firemodels#2038 from gforney/master
Browse files Browse the repository at this point in the history
add cases that generate large boundary, slice and particle files; make render time label sizes consistent
  • Loading branch information
gforney authored Sep 26, 2024
2 parents 2e07952 + f23102d commit 7acf7b4
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 7 deletions.
17 changes: 17 additions & 0 deletions Source/shared/string_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,23 @@ char *GetString(char *buffer){
return NULL;
}

/* ------------------ Time2RenderLabel ------------------------ */

char *Time2RenderLabel(float sv_time, float dt, float maxtime, char *timelabel){
char *timelabelptr, format[32], percen[2], period[2];
int ndigits_right, ndigits_left, total_digits;

strcpy(percen, "%");
strcpy(period, ".");
ndigits_right = MAX(-log10(dt), 0) + 2;
ndigits_left = MAX(1, log10(maxtime)+1);
total_digits = 1 + ndigits_left + ndigits_right;
sprintf(format, "%s0%i%s%if", percen, total_digits, period, ndigits_right);
sprintf(timelabel, format, sv_time);
timelabelptr=TrimFront(timelabel);
return timelabelptr;
}

/* ------------------ Time2TimeLabel ------------------------ */

char *Time2TimeLabel(float sv_time, float dt, char *timelabel, int fixed_point){
Expand Down
1 change: 1 addition & 0 deletions Source/shared/string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ EXTERNCPP float GetMantissaExponent(float x, int *exp10);
EXTERNCPP void GetGitInfo(char *githash, char *gitdate);
EXTERNCPP char *GetString(char *buffer);
EXTERNCPP char *Time2TimeLabel(float time, float dt, char *timelabel, int fixed_point);
EXTERNCPP char *Time2RenderLabel(float time, float dt, float maxtime, char *timelabel);
EXTERNCPP char *RandStr(char* str, int length);
EXTERNCPP void GetBaseTitle(char *progname, char *title_base);
EXTERNCPP void GetTitle(char *progname, char *fulltitle);
Expand Down
13 changes: 7 additions & 6 deletions Source/smokeview/renderimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,10 @@ int GetRenderFileName(int view_mode, char *renderfile_dir, char *renderfile_full
}
code = GetPlot3dTime(&time_local);
if(code == 1 && render_label_type == RENDER_LABEL_TIME){
char timelabel_local[20], *timelabelptr, dt = 1.0;
char timelabel_local[20], *timelabelptr;
float dt = 1.0, maxtime=100000.0;

timelabelptr = Time2TimeLabel(time_local, dt, timelabel_local, force_fixedpoint);
timelabelptr = Time2RenderLabel(time_local, dt, maxtime, timelabel_local);
strcat(suffix, "_");
strcat(suffix, timelabelptr);
strcat(suffix, "s");
Expand All @@ -352,12 +353,12 @@ int GetRenderFileName(int view_mode, char *renderfile_dir, char *renderfile_full
else{
float time_local;
char timelabel_local[20], *timelabelptr;
float dt;
float dt, maxtime;

time_local = global_times[itimes];
dt = global_times[1] - global_times[0];
if(dt < 0.0)dt = -dt;
timelabelptr = Time2TimeLabel(time_local, dt, timelabel_local, force_fixedpoint);
dt = ABS(global_times[1] - global_times[0]);
maxtime = global_times[nglobal_times-1];
timelabelptr = Time2RenderLabel(time_local, dt, maxtime, timelabel_local);
strcpy(suffix, timelabelptr);
strcat(suffix, "s");
}
Expand Down
22 changes: 22 additions & 0 deletions vistest/large/boundary/boundary.fds
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
&HEAD CHID='boundary',TITLE='Plume whirl case' /

&MESH IJK=128,128,4, XB=0.0,12.8,0.0,12.8,0.0,0.4/

&DUMP NFRAMES=50000 DT_BNDF=0.01 /

&INIT XB=0.2,12.6,0.2,12.6,0.1,0.3 TEMPERATURE=600.0 /

&TIME T_END=1000. / Total simulation time

&REAC SOOT_YIELD=0.01,FUEL='PROPANE'/

&VENT MB='XMAX', SURF_ID='OPEN' /

&SURF ID='BURNER',HRRPUA=600.0 / Ignition source
&VENT XB=6.0,8.0,6.0,8.0,0.2,0.2,SURF_ID='BURNER' /
&VENT XB=6.0,8.0,6.0,8.0,0.3,0.3,SURF_ID='BURNER' /
&OBST XB=6.0,8.0,6.0,8.0,0.2,0.3 /

&BNDF QUANTITY='WALL_TEMPERATURE' /

&TAIL /
23 changes: 23 additions & 0 deletions vistest/large/part/part.fds
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
&HEAD CHID='part' /

&MESH IJK=10,10,4, XB=0.0,1.0,0.0,1.0,0.0,0.4 /

&TIME T_END=60 /

&SURF ID='hot', GEOMETRY='SPHERICAL', HEAT_TRANSFER_COEFFICIENT=0., EMISSIVITY=1., TMP_FRONT=800, RADIUS=0.005 /

&PART ID='embers', SURF_ID='hot', SAMPLING_FACTOR=1, STATIC=T, QUANTITIES='PARTICLE TEMPERATURE', PROP_ID='ball shape' /

&PROP ID='ball shape', SMOKEVIEW_ID='SPHERE', SMOKEVIEW_PARAMETERS(1)='D=0.01' /

&INIT PART_ID='embers', N_PARTICLES=800000, XB=0.0,1.0,0.0,1.0,0.0,0.02 /

&VENT MB='ZMAX', SURF_ID='OPEN' /

&BNDF QUANTITY='GAUGE HEAT FLUX', CELL_CENTERED=T /
&BNDF QUANTITY='WALL TEMPERATURE', CELL_CENTERED=T /

&SLCF PBY=0.5, QUANTITY='RADIATION LOSS', CELL_CENTERED=T /
&SLCF PBY=0.5, QUANTITY='INTEGRATED INTENSITY', CELL_CENTERED=T /

&TAIL /
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
&HEAD CHID='plume001',TITLE='Plume whirl case' /
&HEAD CHID='slice',TITLE='Plume whirl case' /

&MESH IJK=64,64,64, XB=0.0,1.6,0.0,1.6,0.0,1.6/

Expand Down

0 comments on commit 7acf7b4

Please sign in to comment.