phi component comsol
Hi iaia,
I just figured out that you're the same person from this other topic. So, you're doing cloaks?
Ok, this is how I did the calculation of the power flux for the first time:
1. draw a contour around the scatterer (in my case, this was a square)
2. do the simulation
3. go to Export and choose Postprocessing data
4. there you can choose which quantity you want to export (Ez, Hx, Hy) and, I think, whether you want the coordinate data or the mesh data
5. export all the quantities you need (I needed all three field components and I exported separately the real and imaginary part)
6. write the program which calculates the Poynting vector (ie the component perpendicular to the correspongin surface ie line in this 2D case)
So, this was the way I did it and, as you can see, it was quite an effort. I am telling you this because this is exactly what I did and I got results which were in very good agreement with the theory (the difference was ~1% or less) - for the scattering cross section. The way below should be just the same, however I haven't tried it because now I am not working on cloaks and scattering any more.
Now, I would do it otherwise: you can tell Comsol to perform contour integration (postprocessing -> boundary integration) and in doing so you can choose which quantities to integrate. So, if you have a simple contour (like a square) you can easily calculate the perpendicular components of the Poynting vector. For example: for the horizontal lines of the square contour, the perpendicular component of P is Py=(1/2)* Re(Ez* (Real(Hx)-i*Imag(Hx))) (its Hx conjugated but I am not sure how can you do conjugation in Comsol - the above expression is one possibility. This way, you can get the segments of the integral for each of the four sides of the square. You can further improve this to do everything in one step if you play a bit with angles: phi=atan2(y,x), and integrate (1/2) Py*sin(phi)+(1/2)Px*cos(phi), etc.
I hope this is clear enough.
Regards