| | |
calculating solar time (stime)
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2009
Posts: 9
Reputation:
Solved Threads: 0
# include “udf.h”
/* definition variables LTIME =local time, SMER=standard meridian on which local time is based (in degrees), LMER= meridian of the observer (in degrees), N = nth day of the year*/
#define LTIME 12:00
#define SMER 116.25
#define LMER 123.44
#define N 173
DEFINE_PROFILE(heat_flux, t, i)
{
Real B, E, stime,
/* Tcorr= time correction in minutes*/
This is part of the C code that I want to use for calculating solar time. This is the time based on apparent angular motion of the sun across the sky, with solar noon the time the sun crosses the meridian of the observer.
I want to use this code in a Computational Fluid Dynamics (CFD) package, Fluent. When I try to interpret the code into fluent, I am getting the following error:
Error:E:\simulation\first energy example.c line 46:parse error.
Line 46 is the line to calculate stime. Please can you help me with a formula for adding hours and minutes
/* definition variables LTIME =local time, SMER=standard meridian on which local time is based (in degrees), LMER= meridian of the observer (in degrees), N = nth day of the year*/
#define LTIME 12:00
#define SMER 116.25
#define LMER 123.44
#define N 173
DEFINE_PROFILE(heat_flux, t, i)
{
Real B, E, stime,
C Syntax (Toggle Plain Text)
B= 360*(N-81)/364; E=987*sin(2*B)-7.53*cos(B)-1.5*sin(B); E1=4*(SMER-LMER); Tcorr = E+E1; stime = LTIME +Tcorr;
This is part of the C code that I want to use for calculating solar time. This is the time based on apparent angular motion of the sun across the sky, with solar noon the time the sun crosses the meridian of the observer.
I want to use this code in a Computational Fluid Dynamics (CFD) package, Fluent. When I try to interpret the code into fluent, I am getting the following error:
Error:E:\simulation\first energy example.c line 46:parse error.
Line 46 is the line to calculate stime. Please can you help me with a formula for adding hours and minutes
LTIME must be either 12 (for hours) or 720 (for minutes), it cannot be 12:00 since that is not a proper C constant. Since you are implying that Tcorr is minutes, make LTIME 720. Then if you need the time in hours and minutes:
C Syntax (Toggle Plain Text)
hours = stime % 60; minutes = stime / 60;
![]() |
Other Threads in the C Forum
- Previous Thread: Expose and Rehide a Hidden Partition
- Next Thread: error problems/array help
| Thread Tools | Search this Thread |
Tag cloud for C
#include adobe ansi array arrays asterisks binarysearch calculate centimeter changingto char convert copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic fflush file fork forloop framework getlasterror givemetehcodez grade graphics gtkgcurlcompiling hacking hardware histogram homework inches include incrementoperators input iso kernel km lazy linked linkedlist linux linuxsegmentationfault list lists locate logical_drives looping loopinsideloop. lowest match matrix microsoft motherboard multi mysql number opendocumentformat opensource owf pattern pdf performance pointer posix problem probleminc process program programming radix recursion recv research reversing scanf scripting segmentationfault sequential shape socket socketprograming spoonfeeding standard string strings structures student systemcall testing threads turboc unix user variable voidmain() wab windows.h windowsapi





