-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved silver-muller conditions #537
Comments
Note: surround code parts with ``` |
You could make a new variable E_val and another variable similar to xyz |
Hi all! It seemes that i managed to do it - now Ey is constant, but after finishing work i have exception in destructor. |
I suggest you fork the Smilei repository in your own account, then modify the files there, so that it is easier to follow your modifications. |
Please also show the error you get. Note: you probably have something wrong in the definition of your variable |
already done exception in destructor magically disappeared "
Stack trace (most recent call last): i don't fully understand how grid is arranged and which indexes i should use |
The Yee grid is staggered according to this: https://smileipic.github.io/Smilei/algorithms.html#time-and-space-discretization Basically, we speak about primal and dual directions. Dual directions have 1 more point than the primal directions because the first point of the dual grid is at -1/2 compared to the first point of the primal grid at 0. Each field can be primal in some directions, and dual in other directions. But for something simpler, look at those lines:
You can see that what matters is the value of axis_. If ==0, then use iB_[0], otherwise use iB_[1]. |
Thanks a lot! will fix it now |
did as you said, looks like works |
The problem and the context
The standard SM conditions supposed that electric field should be zero, otherwise they create some unphysical oscillation even in simple case of constant field.
Current Sm conditions are:
( *B[1] )( iB_[1], j )
= Alpha_ * ( *E[2] )( iB_[0] , j )
+ Beta_ * ( ( *B[1] )( iB_[1]-sign_, j )-B_val[1][j] )
+ Gamma_ * b1[j]
+ Delta_ * ( ( B[0] )( iB_[0], j+1 )-B_val[0][j+1] )
+ Epsilon_ ( ( *B[0] )( iB_[0], j )-B_val[0][j ] )
+ B_val[1][j];
The first term in this equation creates problems if E = const != 0. So I suggest to use E_val similary to E_val and rewrite conditions as
( *B[1] )( iB_[1], j )
= Alpha_ * (( *E[2] )( iB_[0] , j ) - E_val[2])
+ Beta_ * ( ( *B[1] )( iB_[1]-sign_, j )-B_val[1][j] )
+ Gamma_ * b1[j]
+ Delta_ * ( ( B[0] )( iB_[0], j+1 )-B_val[0][j+1] )
+ Epsilon_ ( ( *B[0] )( iB_[0], j )-B_val[0][j ] )
+ B_val[1][j];
where only difference from constant level will matter
Failed attempts
I tried to introduced it myself and found some strange things like
void ElectroMagnBC2D_SM::save_fields( Field *my_field, Patch *patch )
{
Field2D *field2D=static_cast<Field2D *>( my_field );
What happens when we get here with E field? xyz = 0 and B_val is incorrect?
The text was updated successfully, but these errors were encountered: