You are not making yourself clear. Looking at the code you posted in Post #11, beginning on the line
everything is constant. (Incidentally, the line "h=Pb" should end with a semicolon ; not a comma.) Therefore, all of those lines should appear before the loop, not inside it.
#include <stdio.h>
#include <math.h> // provides math and trig functions
int main()
{
int n; // it is preferable to use integer for counting to avoid rounding problems
double x,y,z,h; // eliminated p because p is a 3-valued point;
double BETA, AAZI, PHI, LTIME, SMER, LMER, N, ITIME, FTIME, LTUBE, IDTUBE, ODTUBE;
double THLCOEF, TCEF, ETAP, TCD, ATEMP, IAMC, CFFCT0, CFFCT1,CFFCTK,ALT, ALBEDO, FCS1, PI;
double B, P, E,E1,Tcorr, stime, del, omega, cos_theta1,cos_theta2, cos_theta3;
double cos_theta4, cos_theta5, cos_theta, theta, Ai, iam, cos_thetaz, Rb, Gon;
double a0c, a1c,kc, a0, a1, k, Atb, Gb, iamd,Pb, x1,x3, Z;
double f12, fcs, Atd, Gd, Pd, Ggr, Pgr, Pu;
double lower,upper,step;
// don't declare math.h functions: double cos (), sin(), tan(), acos(), pow(), sqrt();
// place all of the constant definitions next
x=87.5; // x is apparently constant
// next is the loop; I made n an integer from 0 to 10, so I divide by
// 10 in the expressions for y and z
for( n = 0; n < 11; n++ )
{
y = 126.1620 -(1004.0820*n/10);
z= 166.1620 -(-1004.0880*n/10);
// now do something with these values: define points? store them in an array? ...
// otherwise, the values will be overwritten (and lost) on the next iteration
// so you have to add some code here, inside the loop
}
// main function continues ...
}
as it is meaningless without a definition for p. Perhaps the Fluent system provides a definition (structure) for a point. If so, you must use the syntax they provide; I can't help you with that. Otherwise, you have to define "point". For example, a point might be defined this way:
Then you could create an array of 10 points and assign values to the first point in the array like this:
There are many other ways to do this -- it all depends on how you are going to use it.