You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
C
36 lines
1.1 KiB
C
#include <stdio.h>
|
|
#include <stddef.h>
|
|
#include <stdarg.h>
|
|
#include <stdlib.h>
|
|
#include "geostat.h"
|
|
#include "pressure.h"
|
|
|
|
|
|
|
|
/* total_pressure */
|
|
/* Build total pressure */
|
|
/* grid: structure defining the grid */
|
|
/* pression: structure defining the gradient pressure */
|
|
/* realout: structure defining a realization */
|
|
|
|
void total_pressure(struct grid_mod grid,struct pressure_mod gradient,struct realization_mod *realout)
|
|
{
|
|
int i,j,k,maille0,maille1;
|
|
double temp,reference;
|
|
|
|
reference=abs(gradient.x)*grid.NX*grid.DX+abs(gradient.y)*grid.NY*grid.DY+abs(gradient.z)*grid.NZ*grid.DZ;
|
|
/* pressure reconstruction */
|
|
for ( k = 0; k < grid.NZ; k++) {
|
|
for (j = 0; j < grid.NY; j++) {
|
|
for (i = 0; i < grid.NX; i++) {
|
|
maille1 = i+(j+k*grid.NY)*grid.NX;
|
|
/* temp=reference+gradient.x*i*grid.DX+gradient.y*j*grid.DY+gradient.z*k*grid.DZ+(*realout).vector[maille1]; */
|
|
temp=-gradient.x*(i+1)/grid.NX-gradient.y*(j+1)/grid.NY-gradient.z*(k+1)/grid.NZ+(*realout).vector[maille1];
|
|
(*realout).vector[maille1]=temp;
|
|
}
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|