Commit d73ee7f6 authored by Alain O' Miniussi's avatar Alain O' Miniussi
Browse files

Symplifiy initial radiation init.

parent 8d45f454
......@@ -626,39 +626,31 @@ namespace fargOCA {
int const ni = grid.nbLayer();
int const ns = grid.nbSector();
auto temper = disk.temperature()->data();
arr3d<real const> temper = disk.temperature()->data();
ScalarField radiativeEnergy("radiative_energy", grid);
auto energyrad = radiativeEnergy.data();
arr3d<real> energyrad = radiativeEnergy.data();
for (int i = 1; i < nr-1; ++i) {
for (int h = 1; h < ni-1; ++h) {
for (int j = 0; j < ns; ++j) {
energyrad(i,h,j) = (temper(i,h,j) - eta.eta1(i,h,j))/eta.eta2(i,h,j);
}
}
}
kk::parallel_for("int_energy_rad", grid.range3({1,1,0}, {nr-1, ni-1, ns}),
LBD(int i, int h, int j) {
energyrad(i,h,j) = (temper(i,h,j) - eta.eta1(i,h,j))/eta.eta2(i,h,j);
});
real boundEcode = disk.physic().adiabatic->radiative->zBoundaryEnergy();
if (grid.first()) {
kk::deep_copy(kk::subview(energyrad, 0, kk::ALL(), kk::ALL()),
kk::subview(energyrad, 1, kk::ALL(), kk::ALL()));
kk::deep_copy(ring(energyrad, 0), ring(energyrad, 1));
}
if (grid.last()) {
kk::deep_copy(kk::subview(energyrad, nr-1, kk::ALL(), kk::ALL()),
kk::subview(energyrad, nr-2, kk::ALL(), kk::ALL()));
kk::deep_copy(ring(energyrad, nr-1), ring(energyrad, nr-2));
}
for (int i=0; i<nr; i++){
auto energradh0 = kk::subview(energyrad, i, 0, kk::ALL());
kk::parallel_for("set_j0", energradh0.size(), LBD(int const j) { energradh0(j) = boundEcode; });
kk::deep_copy(ring(energyrad, i, 0), boundEcode);
}
if (disk.physic().shape.gas.half){
for (int i=0; i<nr; i++){
kk::deep_copy(kk::subview(energyrad, i, ni-1,kk::ALL()),
kk::subview(energyrad, i, ni-2,kk::ALL()));
kk::deep_copy(ring(energyrad, i, ni-1), ring(energyrad, i, ni-2));
}
} else {
for (int i=0; i<nr; i++){
auto energradh0 = kk::subview(energyrad, i, ni-1, kk::ALL());
kk::parallel_for("set_j0", energradh0.size(), LBD(int const j) { energradh0(j) = boundEcode; });
kk::deep_copy(ring(energyrad, i, ni-1), boundEcode);
}
}
return radiativeEnergy;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment