Skip to content

Commit ce5015b

Browse files
committed
TESTING: trying to get this to work!
1 parent 4a9735a commit ce5015b

File tree

1 file changed

+32
-21
lines changed

1 file changed

+32
-21
lines changed

src/solver_vertical_rusanov.cpp

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,6 @@ void calc_facevalues_alts_rusanov(Grid &grid,
7676
for (iY = nGCs; iY < nYs - nGCs; iY++)
7777
dVarLimited(iX, iY, iZ) =
7878
limiter_mc(dVarUp(iX, iY), dVarDown(iX, iY), beta);
79-
80-
// TEMPORARY!!!
81-
iZ = 18;
82-
ida = 2.0 / grid.dalt_lower_scgc.slice(iZ + 1);
83-
dVarUp = ida %
84-
(factor1 * (inVar.slice(iZ + 1) - inVar.slice(iZ)) -
85-
factor2 * (inVar.slice(iZ + 2) - inVar.slice(iZ - 1)));
86-
87-
ida = 2.0 / grid.dalt_lower_scgc.slice(iZ);
88-
dVarDown = ida %
89-
(factor1 * (inVar.slice(iZ) - inVar.slice(iZ - 1)) -
90-
factor2 * (inVar.slice(iZ + 1) - inVar.slice(iZ - 2)));
91-
92-
// End TEMP
9379

9480
for (iZ = nGCs; iZ < nZs - nGCs + 1; iZ++) {
9581
outLeft.slice(iZ) =
@@ -309,7 +295,6 @@ void Neutrals::solver_vertical_rusanov(Grid grid,
309295
// calculate vertical momentum due to eddy diffusion:
310296
vertical_momentum_eddy(grid);
311297

312-
313298
// -----------------------------------------------------------
314299
// Now calculate new states:
315300
precision_t mass;
@@ -339,7 +324,7 @@ void Neutrals::solver_vertical_rusanov(Grid grid,
339324
- species[iSpecies].acc_eddy
340325
- acc_coriolis[2]
341326
- grid.cent_acc_vcgc[2]
342-
+ 0.25 * (temperature_scgc % gradLogN_s[iSpecies] * cKB / mass
327+
+ 1.0 * (temperature_scgc % gradLogN_s[iSpecies] * cKB / mass
343328
+ gradTemp * cKB / mass
344329
+ abs(grid.gravity_vcgc[2])))
345330
+ dt * diffVertVel_s[iSpecies];
@@ -389,8 +374,8 @@ void Neutrals::solver_vertical_rusanov(Grid grid,
389374

390375
for (iSpecies = 0; iSpecies < nSpecies; iSpecies++)
391376
if (species[iSpecies].DoAdvect)
392-
species[iSpecies].newVelocity_vcgc[2].clamp(-150,150);
393-
newTemperature_scgc.clamp(10, 1e32);
377+
species[iSpecies].newVelocity_vcgc[2].clamp(-200,200);
378+
newTemperature_scgc.clamp(150, 1e32);
394379

395380
for (iX = nGCs; iX < nXs - nGCs; iX++)
396381
for (iY = nGCs; iY < nYs - nGCs; iY++)
@@ -411,17 +396,43 @@ void Neutrals::solver_vertical_rusanov(Grid grid,
411396
}
412397
}
413398

399+
iX = 2;
400+
iY = 4;
414401
// Force the neutrals to move together with friction:
402+
iSpecies = 3;
403+
std::cout << "ver sol, before friction: "
404+
<< species[iSpecies].velocity_vcgc[2](iX,iY,1) << " "
405+
<< species[iSpecies].velocity_vcgc[2](iX,iY,2) << " "
406+
<< species[iSpecies].velocity_vcgc[2](iX,iY,3) << " "
407+
<< species[iSpecies].velocity_vcgc[2](iX,iY,4) << "\n";
408+
409+
mass = species[iSpecies].mass;
410+
411+
for (int iAlt = 0; iAlt < 20; iAlt++) {
412+
std::cout << iAlt << " "
413+
<< log(species[iSpecies].density_scgc(iX, iY,iAlt)) << " "
414+
<< temperature_scgc(iX,iY,iAlt) << " "
415+
<< species[iSpecies].velocity_vcgc[2](iX,iY,iAlt) << " "
416+
<< temperature_scgc(10,10,iAlt) * gradLogN_s[iSpecies](iX,iY,iAlt) * cKB / mass << " "
417+
<< gradTemp(iX,iY,iAlt) * cKB / mass << " "
418+
<< abs(grid.gravity_vcgc[2](iX,iY,iAlt)) << "\n";
419+
}
420+
415421
calc_neutral_friction();
416-
/*
422+
std::cout << "ver acc, after friction: "
423+
<< species[iSpecies].acc_neutral_friction[2](iX,iY,1) << " "
424+
<< species[iSpecies].acc_neutral_friction[2](iX,iY,2) << " "
425+
<< species[iSpecies].acc_neutral_friction[2](iX,iY,3) << " "
426+
<< species[iSpecies].acc_neutral_friction[2](iX,iY,4) << "\n";
427+
417428
for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) {
418429
if (species[iSpecies].DoAdvect) {
419430
species[iSpecies].velocity_vcgc[2] =
420431
species[iSpecies].velocity_vcgc[2] + dt *
421-
species[iSpecies].acc_neutral_friction[iDir];
432+
species[iSpecies].acc_neutral_friction[2];
422433
}
423434
}
424-
*/
435+
std::cout << "here\n";
425436
calc_mass_density();
426437
// Calculate bulk vertical winds:
427438
velocity_vcgc[2].zeros();

0 commit comments

Comments
 (0)