Particle Tracer work in progress

This commit is contained in:
2023-08-05 19:35:16 +02:00
parent b50dbe7d4b
commit 7b83a34e47
46 changed files with 60399 additions and 23269 deletions

View File

@@ -47,13 +47,13 @@ gamma 0.9 # upwind differencing factor gamma
# Visualization Data:
# ------------------
traceStart 10.0 # time for starting visualization
traceStart 0.0 # time for starting visualization
traceWrite 2.0 # time stepsize for saving particle data
traceInject 2.0 # time stepsize for particle injection
lineX1 2.0 # Coordinates of line segment for particle injection
lineY1 0.5
lineX2 2.0
lineY2 3.5
nparticles 30 # number of particles to inject
lineX1 1.0 # Coordinates of line segment for particle injection
lineY1 0.0
lineX2 1.0
lineY2 4.0
nparticles 50 # number of particles to inject
#===============================================================================

View File

@@ -1,5 +1,5 @@
# Supported: GCC, CLANG, ICC
TAG ?= CLANG
TAG ?= ICC
ENABLE_OPENMP ?= false
#Feature options

File diff suppressed because it is too large Load Diff

View File

@@ -178,7 +178,7 @@ void solve(Solver* solver)
it++;
}
#ifdef VERBOSE
#ifndef VERBOSE
printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
#endif
}

View File

@@ -77,7 +77,6 @@ static void advanceParticles(
double yn = y + delt * vn;
m[particleId * NCOORD + Y] = yn;
printf("P%i VEL %f %f dt %f OP %f %f NP %f %f\n", i, un, vn, delt, x, y, xn, yn);
}
double xlength = t->grid.xlength;
@@ -107,7 +106,6 @@ static void injectParticles(Tracing* t)
double* m = t->memorypool;
for (int i = 0; i < t->numParticles; i++) {
printf("Inject %d as %d mem %d\n", i, t->totalParticles, t->cursor);
t->particles[t->totalParticles] = t->cursor;
m[(t->cursor) * NCOORD + X] = line[i * NCOORD + X];
m[(t->cursor) * NCOORD + Y] = line[i * NCOORD + Y];
@@ -145,14 +143,11 @@ void trace(Tracing* t, double* restrict u, double* restrict v, double time)
{
if (time >= t->traceStart) {
if ((time - t->lastUpdate[INJECT]) > t->traceInject) {
printf("Inject at %f\n", time);
printState(t);
injectParticles(t);
t->lastUpdate[INJECT] = time;
}
if ((time - t->lastUpdate[WRITE]) > t->traceWrite) {
printf("Write at %f\n", time);
writeParticles(t);
t->lastUpdate[WRITE] = time;
}
@@ -199,7 +194,7 @@ void initTrace(Tracing* t, Parameter* p)
double x = spacing * x1 + (1.0 - spacing) * x2;
double y = spacing * y1 + (1.0 - spacing) * y2;
printf("S: %f x: %f y: %f\n", spacing, x, y);
//printf("S: %f x: %f y: %f\n", spacing, x, y);
line[i * NCOORD + X] = x;
line[i * NCOORD + Y] = y;
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB