Closed RaphaelPile closed 1 year ago
I got some help from @AleksandarJ1984 : solved removing "r" (radius) and using w_vec = interpolate(Constant((1.7e5, )), W). However, I don't get the expected analytical results.
By the way, when I have finished this part, I will try to do a PR asap since it is linked to #3
If someone has an explanation for the following source term:
f = Expression('exp(-(pow(x[0]-w*t, 2))/(4.0*D*t)+alpha*w*t)*(w*alpha)/(8*pow(pi,1.5)*pow(D*t, 1.5))', D = 0.12, w = 1.7e5, alpha = 5009.51, t = t, pi=pi, degree = 2) # Defining source term
The first part corresponds to the analytical expression of ne, multiplied by the velocity and alpha. So why it is not in logarithmic scale for the "ne" expression ?
In fact, the source term definition does not change whether the log formulation is used or not. With log formulation the time derivative term changes to n_e*dN_e/dt, where n_e = exp(N_e). The equation is solved for N_e = log(n_e) but the rest of the equation, including the source term, remains unchanged (using n_e and not N_e).
I got some help from @AleksandarJ1984 : solved removing "r" (radius) and using w_vec = interpolate(Constant((1.7e5, )), W). However, I don't get the expected analytical results.
Make sure that you consider the proper analytical solution to compare with when the problem is reduced to 1D.
The equation is solved for N_e = log(n_e) but the rest of the equation, including the source term, remains unchanged (using n_e and not N_e).
Thank you very much for this information. I understand better the Logarithmic stabilization method now.
Make sure that you consider the proper analytical solution to compare with when the problem is reduced to 1D.
Yes you are right, but I will be looking in this direction.
This is working now, I will do a PR as soon as possible.
@RaphaelPile Thank you very much for making the 1D example. I will check it out and merge it with other examples.
Hello there !
I am working on 1D version of time of flight example. I have not modified the beginning and the end of the code, just the boundaries and the mesh at first. I got a first problem with the velocity vector, which wa solved by using
w_vec = Expression(('1.7e5', 0.), element=W.ufl_element())
instead ofw = interpolate(Constant(('0','1.7e5')), W)
in the flux Gamma calculation.But now I am a bit stuck with the error I get below. Maybe my previous modification was a mistake, I don't really know....
Here is my code (the modified part of time-of-flight.py) and the error log.
Any help is welcome.