Ansys Learning Forum › Forums › Discuss Simulation › Photonics › Scripting in Dispersive Refractive Indices into Lumerical Material Database › Reply To: Scripting in Dispersive Refractive Indices into Lumerical Material Database
Dear Subscriber,
The Sellmeier model implementation does not support dispersion at the moment; this is expected behavior. The page you're citing, Standard optical permittivity material models in FDTD and MODE, includes a note stating that "This type of material model should only be used for single-frequency simulations."
The following script example demonstrates how to add an artificial sampled 3D material with a complex refractive index that varies across three axes:
lambda = linspace(400e-09,700e-09,7);
f = c/lambda;
ri_comlplex_x = 1.4+1i*0.1;
ri_comlplex_y = 1.5+1i*0.2;
ri_comlplex_z = 1.6+1i*0.3;
eps_x = ones(7,1)*ri_comlplex_x^2;
eps_y = ones(7,1)*ri_comlplex_y^2;
eps_z = ones(7,1)*ri_comlplex_z^2;
sampledData3D = [f, eps_x, eps_y, eps_z];
mat_name = "MyNewSampled3DMaterial";
temp_material = addmaterial("Sampled 3D data");
setmaterial(temp_material, "name", mat_name);
setmaterial(mat_name, "max coefficients", 6);
setmaterial(mat_name,"tolerance", 0.01);
setmaterial(mat_name, "sampled data", sampledData3D);
This is how the MyNewSampled3DMaterial looks in Material Database.
Feel free to adapt the script by loading your sampled data from a file.
I hope this helps.
Best regards,
Kirill