Skip to content
Snippets Groups Projects
Commit fac34c60 authored by first version's avatar first version
Browse files

move the RadiationDiffusion example into the RadiativeTransfer folder

parent 406b0524
No related branches found
No related tags found
No related merge requests found
{
"git.ignoreLimitWarning": true
}
\ No newline at end of file
......@@ -21,11 +21,13 @@ import h5py
from numpy import *
#define a function to generate Gaussian (also diffusion solution):
#Ecr0 # total radiation energy
#kappa # Diffusion Coefficient
#offset # width of the initial Gaussian
def diffusionsol(Ecr0,kappa,time,rneed,offset=0.,dim=1.):
"""
define a function to generate Gaussian (also diffusion solution):
Ecr0 # total radiation energy
kappa # Diffusion Coefficient
offset # width of the initial Gaussian
"""
ecr = Ecr0/power(2.*pi*(2.*kappa*time+offset*offset),dim/2.)*exp(-rneed*rneed/2./(2.*kappa*time+offset*offset))
return ecr
......
......@@ -18,18 +18,16 @@
#
##############################################################################
# Computes the analytical solution of the Sod shock and plots the SPH answer
# Computes the analytical solution of the simple diffusion of a Gaussian packet and plots the SPH answer
# Generates the analytical solution for the Sod shock test case
# The script works for a given left (x<0) and right (x>0) state and computes the solution at a later time t.
# This follows the solution given in (Toro, 2009)
#define a function to generate Gaussian (also diffusion solution):
#Ecr0 # total radiation energy
#kappa # Diffusion Coefficient
#offset # width of the initial Gaussian
def diffusionsol(Ecr0,kappa,time,rneed,offset=0.,dim=1.):
"""
define a function to generate Gaussian (also diffusion solution):
Ecr0 # total radiation energy
kappa # Diffusion Coefficient
offset # width of the initial Gaussian
"""
ecr = Ecr0/power(2.*pi*(2.*kappa*time+offset*offset),dim/2.)*exp(-rneed*rneed/2./(2.*kappa*time+offset*offset))
return ecr
......
......@@ -324,14 +324,12 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_gradient(
/* Get the kernel for overline(Wij)=0.5*(W(rij,hi)+W(rij,hj)) */
const float wij_dr = 0.5f * (wi_dr + wj_dr);
const float kradi_nl = pi->diffusionrad.cred / pi->diffusionrad.kappa / pi->rho;
const float fradmag = -kradi_nl * pj->mass * (pi->urad/pj->rho + pi->urad/pi->rho) * wij_dr;
int i;
for (i=0; i<=hydro_dimension-1; i++)
{
pi->frad[i] += fradmag * dx[i]/r;
}
pi->frad[0] += fradmag * dx[0]/r;
pi->frad[1] += fradmag * dx[1]/r;
pi->frad[2] += fradmag * dx[2]/r;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment