Comments (13)
from smilei.
Thanks a lot Michael for the response. This will be of great help.
When we apply the external field, then initially the field is present. As the window moves towards positive x, the new region entering the simulation domain do not have the field.
from smilei.
Hi
This is actually normal. In Smilei, the external field you define is an additional field in your initial simulation box. It can also be coupled with the corresponding boundary conditions, if necessary, so that the field is maintained in the simulation box. It was originally designed for magnetic reconnection simulations. It can also be used to initalize a laser pulse inside the simulation box at t=0 for instance.
But in the case of a moving window, you would have to define a field for all possible time and space where your window could potentially be during the whole course of the simulation. This is the source of many difficulties, confusion and physical misinterpretation so we decided not to implement it for the moment.
Our apologies. I have to admit the documentation is not very clear on this particular point.
from smilei.
Hi!
Just a quick comment following @beck-llr.
One actually consider that the 'new' plasma injected on the right side of the moving window is in a stationary state. Hence, one could also consider that the fields in there are as should have been defined at t=0.
As an exemple, imagine you want to simulation LWFA in the presence of a constant magnetic field (let say Bx). One should be able to add very easily this external field Bx = cst.
I've discussed this with @jderouillat and we agreed this could be done (with obviously the possible pitfalls you mentioned earlier). @beck-llr, don't you it's worth allowing this feature?
from smilei.
It would definitely be worth it yes. And it looks very easy to do in the way you put it @MickaelGrech . But it actually requires quite a lot of thinking and engineering because it modifies patch creation which is a fundamental function. It also raises some questions about boundary conditions.
from smilei.
I think this feature will be very helpful to study several phenomenas. In particular, in LWFA as well as beam driven Wakefield. I am not aware of the patch creation function but would like to know if it would be possible by just adding the external field in the equation of motion at every time step.
from smilei.
Hi Ujjwal,
Can you try to add in the moving window (src/MovWindow/SimWindow.cpp, line 269) the 3 lines indicated below to test this feature ?
$ git diff
diff --git a/src/MovWindow/SimWindow.cpp b/src/MovWindow/SimWindow.cpp
index 359a99b..1d2e031 100644
--- a/src/MovWindow/SimWindow.cpp
+++ b/src/MovWindow/SimWindow.cpp
@@ -266,6 +266,11 @@ void SimWindow::operate(VectorPatch& vecPatches, SmileiMPI* smpi, Params& params
for( unsigned int idiag=0; idiag<vecPatches.localDiags.size(); idiag++ )
if( DiagnosticTrack* track = dynamic_cast<DiagnosticTrack*>(vecPatches.localDiags[idiag]) )
track->setIDs( mypatch );
+
+ mypatch->EMfields->applyExternalFields( mypatch );
+ if (params.save_magnectic_fields_for_SM)
+ mypatch->EMfields->saveExternalFields( mypatch );
+
}
}
}
from smilei.
To be more explicit on what happen here :
- The pragma omp clauses and the ithread loop are used to serialize over threads the usage of python profile which could be used to create particles (not compatible with OpenMP, Python is not thread safe).
- The j loop browses patches newly created.
- The test on patch_to_be_created[ithread][j] identifies patches created at Xmax and not those which are created between 2 MPI process.
- mypatch is the current instance of a newly created patch
#pragma omp master
{
for (int ithread=0; ithread < max_threads ; ithread++){
for (unsigned int j=0; j< (patch_to_be_created[ithread]).size(); j++){
//If new particles are required
if (patch_to_be_created[ithread][j] != nPatches){
mypatch = ....
}
}
}
}
#pragma omp barrier
from smilei.
Thanks @jderouillat . I will try this and comeback to you.
from smilei.
Hi @jderouillat ,
I tried what you suggested above. However, I got the following error message while compiling
src/MovWindow/SimWindow.cpp: In member function ‘void SimWindow::operate(VectorPatch&, SmileiMPI*, Params&, unsigned int, double)’:
src/MovWindow/SimWindow.cpp:270:18: error: ‘class Params’ has no member named ‘save_magnectic_fields_for_SM’
if (params.save_magnectic_fields_for_SM)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/MovWindow/SimWindow.cpp:271:27: error: ‘class ElectroMagn’ has no member named ‘saveExternalFields’; did you mean ‘applyExternalFields’?
mypatch->EMfields->saveExternalFields( mypatch );
^~~~~~~~~~~~~~~~~~
applyExternalFields
make: *** [build/src/MovWindow/SimWindow.o] Error 1
I tried looking into Params.h and Params.cpp, but was not sure what should be the datatype of the new variables introduced.
from smilei.
@usinhampik You likely have an old version of the code (before last april). I suggest you clone the repository on this GitHub to obtain a newer version.
from smilei.
Hello all,
I did some preliminary small scale tests and this seems to work. I am running a few large simulations now. I will update with the outcomes in a couple of days.
Thank you all a lot for the help.
from smilei.
Hello all,
I ran sufficient number of simulations after adding the lines suggested by @jderouillat and it works fine.
Once again, I thank you all for the prompt response and help.
from smilei.
Related Issues (20)
- Segmentation fault HOT 16
- Unit conversion in PostProcess HOT 1
- Adjusting gridGlobalOffset and temporal offset HOT 7
- Keeping track of number of MPI processes and OpenMP threads HOT 3
- Beam current distribution in LWFA through AM HOT 1
- Error with "Collisions" block HOT 2
- Enabling Prescribed Field for AM Geometry HOT 1
- Magnetic field in TrackParticle and ParticleBinning diagnostics HOT 21
- Force final step to be restartable option HOT 2
- 'cannot convert float NaN to integer' error when opening Track Particles Diagnostic HOT 13
- Thermal boundary condition HOT 2
- Deprecated pyplot register_cmap HOT 3
- problems with species creation while using parallelization HOT 4
- TrackParticles has different fusion neutron weights at low energies HOT 10
- ansys fluent
- timestep_over_CFL leads to an index error HOT 4
- AMcylindrical geometry: showing the Field diagnostic on both half planes
- Screen Diagnostic Not Working HOT 5
- PML for magnetized plasmas HOT 3
- Only electron, no ion in Species block
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smilei.