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 85 86 87 88 89 90 91 92 93 94
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define PI 3.14159265
int ii = 512, jj = 16, tt = 1440, Niter = 200000;
double T_huile = 100., T_init = 150;
double L, l, R_L;
double hx, hy, ht;
double K_acier, K_huile, ro, D, ki, H_air, Cp, E, sigma_RMS, nu, Ep, alpha;
double errmax, BornInfMin, x, BornInf, BornSup;
float VitL, VitC, Pos, For, Ray;
FILE *ValMail, *SaveTpeau, *FichErr, *FichCalc, *Contact, *TFinale, *Test,
*Calc, *Calc2;
double **T, **Tmax;
double *h, *mu, *xs, *V_L, *V_C, *F, *R, *Rc, *Q, *Qmoy;
double Debit = 1.4, Coeff = 72, CoeffCont = 0.2, Q0 = 215;
void init (void)
{
int i;
h = malloc ((tt + 1) * sizeof (double));
mu = malloc ((tt + 1) * sizeof (double));
xs = malloc ((tt + 1) * sizeof (double));
V_L = malloc ((tt + 1) * sizeof (double));
V_C = malloc ((tt + 1) * sizeof (double));
F = malloc ((tt + 1) * sizeof (double));
R = malloc ((tt + 1) * sizeof (double));
Rc = malloc ((tt + 1) * sizeof (double));
Q = malloc ((tt + 1) * sizeof (double));
Qmoy = calloc ((ii + 1), sizeof (double));
T = malloc ((ii + 1) * sizeof (double *));
for (i = 0; i <= ii; i++)
T[i] = malloc ((jj + 1) * sizeof (double));
Tmax = malloc ((ii + 1) * sizeof (double *));
for (i = 0; i <= ii; i++)
Tmax[i] = malloc ((jj + 1) * sizeof (double));
}
void solve (void)
{
}
void writefile (void)
{
}
int main (void)
{
int i;
time_t t;
FILE *Horaire, *FluMoy;
time (&t); /* t contient maintenant l'heure et la date courante */
Horaire = fopen ("Temps.txt", "w");
fprintf (Horaire, "Début = %s", ctime (&t));
ValMail = fopen ("Valeur Maillage.txt", "w"); /*fprintf(ValMail, "Début = %s", ctime(&t)); */
Contact = fopen ("Caract Contact.txt", "w");
SaveTpeau = fopen ("Température de peau.txt", "w");
fprintf (SaveTpeau, "%s\n",
"Fichier de sauvegarde de la température de peau");
FichErr = fopen ("Erreur.txt", "w");
fprintf (FichErr, "%s\n\n", "Valeur de l'erreur");
TFinale = fopen ("Température finale.txt", "w");
fprintf (TFinale, "Matrice de température du linguet\n\n"); /*Test = fopen("FichTest.txt", "w"); *//*Calc = fopen("FichCalc.txt", "w"); *//*Calc2 = fopen("FichCalc2.txt", "w"); */
init ();
solve ();
writefile ();
FluMoy = fopen ("Flux Moyen.txt", "w");
for (i = 0; i <= ii; i++)
fprintf (FluMoy, "%i %f\n", i, Qmoy[i]);
fclose (FluMoy); /*fclose(Calc); *//*fclose(Calc2); fclose(Test); */
fclose (TFinale);
fclose (SaveTpeau);
fclose (FichErr);
time (&t);
fprintf (Horaire, "\n Fin = %s", ctime (&t));
fclose (Horaire);
free (h);
free (mu);
free (xs);
free (V_L);
free (V_C);
free (F);
free (R);
free (Rc);
free (Q);
free (T);
free (Tmax);
return 0;
} |