Skip to content
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

Field cooling in TDGL? #71

Closed
TJPhysics opened this issue Feb 3, 2024 · 1 comment
Closed

Field cooling in TDGL? #71

TJPhysics opened this issue Feb 3, 2024 · 1 comment

Comments

@TJPhysics
Copy link

Is it possible in this particular realization of the TDGL to vary the temperature from above Tc to below Tc in the presence of a magnetic field so as to field-cool the superconductor? I would like to trap magnetic flux inside a hole in my superconducting device.

@loganbvh
Copy link
Owner

loganbvh commented Feb 3, 2024

Hi, good question!

You can define a function that sets the critical temperature T_c of the device as a function of both position and time (this is the disorder_epsilon parameter in tdgl.solve()). To trap some flux in a hole in a device, you can set T_c = 0 for a region of the device connecting the hole to the exterior, thereby creating a normal metal channel that will allow vortex entry. Below is a script that implements this protocol to trap a single flux quantum in a superconducting ring. Hopefully this is enough to get you started.

import numpy as np
import tdgl
from tdgl.geometry import circle

# Define the device
film_radius = 1
hole_radius = film_radius / 3
layer = tdgl.Layer(london_lambda=0.1, coherence_length=0.05, thickness=0.01)
film = tdgl.Polygon("film", points=circle(film_radius)).resample(201)
hole = tdgl.Polygon("hole", points=circle(hole_radius)).resample(201)
device = tdgl.Device(
    "ring",
    layer=layer,
    film=film,
    holes=[hole],
    length_units="um",
)

# Make the mesh
device.make_mesh(max_edge_length=0.025)

# Setup the field cooling protocol:
# 1. Use disorder_epsilon to create a temporary normal metal channel connecting the
#    film exterior and the hole.
# 2. Apply a uniform magnetic field sufficient to trap a single flux quantum in the hole.
# 3. Remove the normal metal channel, then turn off the magnetic field.

options = tdgl.SolverOptions(
    output_file="ring.h5",
    solve_time=250,
    field_units="mT",
    current_units="uA",
    dt_max=0.01,
)

def epsilon(r, *, t):
    """Sets T_c = 0 for a portion of the film until time t = 100."""
    x, y = r  # r = (x, y) is the position within the film
    # t is time in units of \tau_0
    if t < 100 and y > 0 and np.abs(x) < 0.1:
        return -1
    return 1


def scale_func(x, y, z, *, t):
    """A scale factor that turns off the applied field after time t = 200."""
    if t < 200:
        return 1
    return 0

# Apply a uniform magnetic field equal to 1.5 * Phi_0 / film_area
# to trap one Phi_0 in the hole
film_area = np.pi * (film_radius * tdgl.ureg("um"))**2
applied_field = 1.5 * (tdgl.ureg("Phi_0") / film_area).to("mT")
print(f"Applied field = {applied_field}")

# Combine the scale factor and uniform magnetic field
# to define the applied magnetic vector potential.
applied_vector_potential = (
    # Time-dependent scale factor
    tdgl.sources.Scale(scale_func)
    # Uniform applied magnetic field
    * tdgl.sources.ConstantField(
        applied_field.to(options.field_units).magnitude,
        length_units=device.length_units,
        field_units=options.field_units,
    )
)

# Solve the model
solution = tdgl.solve(
    device,
    options,
    applied_vector_potential=applied_vector_potential,
    disorder_epsilon=epsilon,
)

Here is a video created by running the following from the command line:

python -m tdgl.visualize --input="ring.h5" --output="ring.mp4" animate --fps=15 --quantities order_parameter phase supercurrent epsilon
ring.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants