Fully working 3D PT

This commit is contained in:
Aditya Ujeniya 2023-08-14 14:54:01 +02:00
parent 6c238198ed
commit e00e375b6a
3 changed files with 127981 additions and 127956 deletions

View File

@ -38,7 +38,7 @@ kmax 40 # number of interior cells in z-direction
# Time Data: # Time Data:
# --------- # ---------
te 10.0 # final time te 50.0 # final time
dt 0.02 # time stepsize dt 0.02 # time stepsize
tau 0.5 # safety factor for time stepsize control (<0 constant delt) tau 0.5 # safety factor for time stepsize control (<0 constant delt)
@ -50,4 +50,19 @@ eps 0.001 # stopping tolerance for pressure iteration
rho 0.5 rho 0.5
omg 1.7 # relaxation parameter for SOR iteration omg 1.7 # relaxation parameter for SOR iteration
gamma 0.9 # upwind differencing factor gamma gamma 0.9 # upwind differencing factor gamma
# Particle Tracing Data:
# -----------------------
numberOfParticles 30
startTime 10
injectTimePeriod 3.0
writeTimePeriod 1.0
x1 0.1
y1 0.0
z1 1.0
x2 1.0
y2 4.0
z2 1.0
#=============================================================================== #===============================================================================

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,7 @@
#define W(i, j, k) w[(k) * (imax + 2) * (jmax + 2) + (j) * (imax + 2) + (i)] #define W(i, j, k) w[(k) * (imax + 2) * (jmax + 2) + (j) * (imax + 2) + (i)]
static int ts = 0; static int ts = 0;
unsigned int seed = 32767;
void printParticles(ParticleTracer* particletracer) void printParticles(ParticleTracer* particletracer)
{ {
for(int i = 0; i < particletracer->totalParticles; ++i) for(int i = 0; i < particletracer->totalParticles; ++i)
@ -31,9 +32,14 @@ void injectParticles(ParticleTracer* particletracer)
for(int i = 0; i < particletracer->numberOfParticles; ++i) for(int i = 0; i < particletracer->numberOfParticles; ++i)
{ {
particletracer->particlePool[particletracer->pointer].x = particletracer->linSpaceLine[i].x; // particletracer->particlePool[particletracer->pointer].x = particletracer->linSpaceLine[i].x;
particletracer->particlePool[particletracer->pointer].y = particletracer->linSpaceLine[i].y; // particletracer->particlePool[particletracer->pointer].y = particletracer->linSpaceLine[i].y;
particletracer->particlePool[particletracer->pointer].z = particletracer->linSpaceLine[i].z; // particletracer->particlePool[particletracer->pointer].z = particletracer->linSpaceLine[i].z;
particletracer->particlePool[particletracer->pointer].x = particletracer->x1;
particletracer->particlePool[particletracer->pointer].y = (double) rand() / RAND_MAX * particletracer->ylength;
particletracer->particlePool[particletracer->pointer].z = (double) rand() / RAND_MAX * particletracer->zlength;
particletracer->particlePool[particletracer->pointer].flag = true; particletracer->particlePool[particletracer->pointer].flag = true;
++(particletracer->pointer); ++(particletracer->pointer);
@ -226,10 +232,14 @@ void initParticleTracer(ParticleTracer* particletracer, Parameter* params)
for (int i = 0; i < particletracer->numberOfParticles; ++i) for (int i = 0; i < particletracer->numberOfParticles; ++i)
{ {
double spacing = (double)i / (double)(particletracer->numberOfParticles - 1); // double spacing = (double)i / (double)(particletracer->numberOfParticles - 1);
particletracer->linSpaceLine[i].x = spacing * particletracer->x1 + (1.0 - spacing) * particletracer->x2; // particletracer->linSpaceLine[i].x = spacing * particletracer->x1 + (1.0 - spacing) * particletracer->x2;
particletracer->linSpaceLine[i].y = spacing * particletracer->y1 + (1.0 - spacing) * particletracer->y2; // particletracer->linSpaceLine[i].y = spacing * particletracer->y1 + (1.0 - spacing) * particletracer->y2;
particletracer->linSpaceLine[i].z = spacing * particletracer->z1 + (1.0 - spacing) * particletracer->z2; // particletracer->linSpaceLine[i].z = spacing * particletracer->z1 + (1.0 - spacing) * particletracer->z2;
particletracer->linSpaceLine[i].x = particletracer->x1;
particletracer->linSpaceLine[i].y = (double) rand() / RAND_MAX * particletracer->ylength;
particletracer->linSpaceLine[i].z = (double) rand() / RAND_MAX * particletracer->zlength;
particletracer->linSpaceLine[i].flag = true; particletracer->linSpaceLine[i].flag = true;
} }