Skip to content

Update Wake integration to account for non uniform grid #41

@elenafuengar

Description

@elenafuengar

To have the Smart grid fully functional for Wakefield simulations, we need to adapt the wake potential integration in wakeSolver.py to account for non uniform integration path. Hence, dz is no longer a float but an array of values:

# ... inside WakeSolver ...
# both in calc_long_WP_3d(self, **kwargs)
# and in calc_long_WP(self, Ezt=None,**kwargs):

                        for n in range(len(s)):
                            for k in range(nz):
                                ts = (z[k]+s[n])/self.v-zmin/self.v-self.t[0]+ti
                                it = int(ts / dt)  # find index for t
                                if it < nt:
                                    WP[n] = WP[n] + (Ezt[k, it]) * dz  # compute integral

                            pbar.update(1)

                    WP = WP/(self.q*1e12)     # [V/pC]
                    WP_3d[i0+i,j0+j,:] = WP

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions