Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Plane Wave in a Cube
Posted 26 janv. 2012, 14:19 UTC−5 RF & Microwave Engineering Version 5.0 5 Replies
Please login with a confirmed email address before reporting spam
I want to create a perfect plane wave in COMSOL.
I draw a cube and assign "plane wave radiation" to one side of it and "PML" to aother sides of cube. But instead of having "plane wave" I am getting "standing wave". It means I have a lot of radiation.
Can you help me how I can create a plane wave?
Please login with a confirmed email address before reporting spam
I don't have the acoustics module, but I've done this successfully with waves in the RF module. In that case, the trick is to apply the "scattered field formulation", which allows one to define a background plane wave. Is that, or something similar, an option for you? To quote from the help system (for the RF module), "...a plane wave excitation is easier to set up, because for scattered-field problems it is specified as a global plane wave."
Please login with a confirmed email address before reporting spam
I am also confused on the background definition of plane wave. I want to simulate a narrow plane wave pulse propagation in the free space. Assume that I have to decompose (Fourier Transform) the pulse into many CW signals. And for each CW, it should be perfect plane wave. And after propagating some distance, the output pulse is the summation (Inverse Fourier Transform) of all the CW output signal.
Since I have to do decomposition and summation, it is incorrect to define each CW plane wave in the background. Hence, I am still struggling on how to define a plane perfect wave which does not suffer much distortion.
Do you think so? Any advice of the plane wave excitation?
Best,
Shengli
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
Thank you so much for your reply. However, I can not open the file attached because I have only COMSOL 5.0. Could you the file of version 5.0? Thanks again.
Best,
Shengli
Please login with a confirmed email address before reporting spam
Note to other readers: Any suggestions?
Meanwhile, below is the text from an exported .java file which may help you understand what I did. ( I understand that it may be possible to turn such listings into readable models, but I don't know the details. I saw some info about doing that at: www.comsol.com/community/forums/general/thread/46901 .) Good luck.
/*
* Pulsed_planewave_in_block_without_solution.java
*/
import com.comsol.model.*;
import com.comsol.model.util.*;
/** Model exported on Jun 1 2016, 14:36 by COMSOL 5.2.0.220. */
public class Pulsed_planewave_in_block_without_solution {
public static Model run() {
Model model = ModelUtil.create("Model");
model.modelPath("D:\\SARA_Projects");
model.label("Pulsed_planewave_in_block_without_solution.mph");
model.comments("Untitled\n\n");
model.modelNode().create("comp1");
model.geom().create("geom1", 3);
model.func().create("an1", "Analytic");
model.func("an1").set("args", new String[]{"t"});
model.func("an1").set("expr", "exp(-2*t/1.0e-9)*sin(2.0*pi*1e9*t)");
model.func("an1").set("plotargs", new String[][]{{"t", "0", "3e-9"}});
model.func("an1").set("funcname", "mypulse");
model.mesh().create("mesh1", "geom1");
model.geom("geom1").create("blk1", "Block");
model.geom("geom1").feature("blk1").set("size", new String[]{"1", ".25", ".25"});
model.geom("geom1").run();
model.material().create("mat1", "Common", "comp1");
model.material("mat1").propertyGroup("def").func().create("eta", "Piecewise");
model.material("mat1").propertyGroup("def").func().create("Cp", "Piecewise");
model.material("mat1").propertyGroup("def").func().create("rho", "Analytic");
model.material("mat1").propertyGroup("def").func().create("k", "Piecewise");
model.material("mat1").propertyGroup("def").func().create("cs", "Analytic");
model.material("mat1").propertyGroup().create("RefractiveIndex", "Refractive index");
model.physics().create("temw", "TransientElectromagneticWaves", "geom1");
model.physics("temw").create("pmc1", "PerfectMagneticConductor", 2);
model.physics("temw").feature("pmc1").selection().set(new int[]{2, 5});
model.physics("temw").create("sctr1", "Scattering", 2);
model.physics("temw").feature("sctr1").selection().set(new int[]{1});
model.physics("temw").create("sctr2", "Scattering", 2);
model.physics("temw").feature("sctr2").selection().set(new int[]{6});
model.mesh("mesh1").create("ftet2", "FreeTet");
model.mesh("mesh1").feature("ftet2").create("size1", "Size");
model.view("view1").set("renderwireframe", true);
model.material("mat1").label("Air");
model.material("mat1").set("family", "air");
model.material("mat1").propertyGroup("def").func("eta")
.set("pieces", new String[][]{{"200.0", "1600.0", "-8.38278E-7+8.35717342E-8*T^1-7.69429583E-11*T^2+4.6437266E-14*T^3-1.06585607E-17*T^4"}});
model.material("mat1").propertyGroup("def").func("eta").set("arg", "T");
model.material("mat1").propertyGroup("def").func("Cp")
.set("pieces", new String[][]{{"200.0", "1600.0", "1047.63657-0.372589265*T^1+9.45304214E-4*T^2-6.02409443E-7*T^3+1.2858961E-10*T^4"}});
model.material("mat1").propertyGroup("def").func("Cp").set("arg", "T");
model.material("mat1").propertyGroup("def").func("rho").set("args", new String[]{"pA", "T"});
model.material("mat1").propertyGroup("def").func("rho").set("expr", "pA*0.02897/8.314/T");
model.material("mat1").propertyGroup("def").func("rho").set("dermethod", "manual");
model.material("mat1").propertyGroup("def").func("rho")
.set("plotargs", new String[][]{{"pA", "0", "1"}, {"T", "0", "1"}});
model.material("mat1").propertyGroup("def").func("rho")
.set("argders", new String[][]{{"pA", "d(pA*0.02897/8.314/T,pA)"}, {"T", "d(pA*0.02897/8.314/T,T)"}});
model.material("mat1").propertyGroup("def").func("k")
.set("pieces", new String[][]{{"200.0", "1600.0", "-0.00227583562+1.15480022E-4*T^1-7.90252856E-8*T^2+4.11702505E-11*T^3-7.43864331E-15*T^4"}});
model.material("mat1").propertyGroup("def").func("k").set("arg", "T");
model.material("mat1").propertyGroup("def").func("cs").set("args", new String[]{"T"});
model.material("mat1").propertyGroup("def").func("cs").set("expr", "sqrt(1.4*287*T)");
model.material("mat1").propertyGroup("def").func("cs").set("dermethod", "manual");
model.material("mat1").propertyGroup("def").func("cs").set("plotargs", new String[][]{{"T", "0", "1"}});
model.material("mat1").propertyGroup("def").func("cs")
.set("argders", new String[][]{{"T", "d(sqrt(1.4*287*T),T)"}});
model.material("mat1").propertyGroup("def")
.set("relpermeability", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
model.material("mat1").propertyGroup("def")
.set("relpermittivity", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
model.material("mat1").propertyGroup("def").set("dynamicviscosity", "eta(T[1/K])[Pa*s]");
model.material("mat1").propertyGroup("def").set("ratioofspecificheat", "1.4");
model.material("mat1").propertyGroup("def")
.set("electricconductivity", new String[]{"0[S/m]", "0", "0", "0", "0[S/m]", "0", "0", "0", "0[S/m]"});
model.material("mat1").propertyGroup("def").set("heatcapacity", "Cp(T[1/K])[J/(kg*K)]");
model.material("mat1").propertyGroup("def").set("density", "rho(pA[1/Pa],T[1/K])[kg/m^3]");
model.material("mat1").propertyGroup("def")
.set("thermalconductivity", new String[]{"k(T[1/K])[W/(m*K)]", "0", "0", "0", "k(T[1/K])[W/(m*K)]", "0", "0", "0", "k(T[1/K])[W/(m*K)]"});
model.material("mat1").propertyGroup("def").set("soundspeed", "cs(T[1/K])[m/s]");
model.material("mat1").propertyGroup("def").addInput("temperature");
model.material("mat1").propertyGroup("def").addInput("pressure");
model.material("mat1").propertyGroup("RefractiveIndex").set("n", "");
model.material("mat1").propertyGroup("RefractiveIndex").set("ki", "");
model.material("mat1").propertyGroup("RefractiveIndex")
.set("n", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
model.material("mat1").propertyGroup("RefractiveIndex")
.set("ki", new String[]{"0", "0", "0", "0", "0", "0", "0", "0", "0"});
model.physics("temw").prop("ShapeProperty").set("order_magneticvectorpotential", "1");
model.physics("temw").feature("pec1").label("Perfect Electric Conductor (top/bot)");
model.physics("temw").feature("pmc1").label("Perfect Magnetic Conductor (sides)");
model.physics("temw").feature("sctr1").set("IncidentField", "EField");
model.physics("temw").feature("sctr1").set("E0i", new String[][]{{"0"}, {"0"}, {"mypulse(t)"}});
model.physics("temw").feature("sctr1").label("Scattering BC Wave Launching face");
model.physics("temw").feature("sctr2").label("Scattering BC (wave termination)");
model.mesh("mesh1").feature("ftet2").feature("size1").set("custom", "on");
model.mesh("mesh1").feature("ftet2").feature("size1").set("hmaxactive", true);
model.mesh("mesh1").feature("ftet2").feature("size1").set("hmax", ".03");
model.mesh("mesh1").run();
model.frame("material1").sorder(1);
model.study().create("std1");
model.study("std1").create("time", "Transient");
model.sol().create("sol1");
model.sol("sol1").study("std1");
model.sol("sol1").attach("std1");
model.sol("sol1").create("st1", "StudyStep");
model.sol("sol1").create("v1", "Variables");
model.sol("sol1").create("t1", "Time");
model.sol("sol1").feature("t1").create("fc1", "FullyCoupled");
model.sol("sol1").feature("t1").feature().remove("fcDef");
model.result().dataset().create("cpt1", "CutPoint3D");
model.result().create("pg1", "PlotGroup3D");
model.result().create("pg2", "PlotGroup1D");
model.result("pg1").create("mslc1", "Multislice");
model.result("pg2").create("ptgr1", "PointGraph");
model.result().export().create("anim1", "Animation");
model.study("std1").feature("time").set("tlist", "range(0,1.0e-10,4.5e-9)");
model.sol("sol1").attach("std1");
model.sol("sol1").feature("t1").set("tstepsgenalpha", "strict");
model.sol("sol1").feature("t1").set("timemethod", "genalpha");
model.sol("sol1").feature("t1").set("tlist", "range(0,1.0e-10,4.5e-9)");
model.result().dataset("cpt1").set("pointx", ".5");
model.result().dataset("cpt1").set("pointy", ".125");
model.result().dataset("cpt1").set("pointz", ".125");
model.result("pg1").label("Electric Field");
model.result("pg1").feature("mslc1").label("Multislice 1.1");
model.result("pg1").feature("mslc1").set("expr", "temw.Ez");
model.result("pg1").feature("mslc1").set("descr", "Electric field, z component");
model.result("pg1").feature("mslc1").set("xnumber", "0");
model.result("pg2").set("data", "cpt1");
model.result("pg2").set("xlabel", "Time (s)");
model.result("pg2").set("ylabel", "Electric field, z component (V/m)");
model.result("pg2").set("ylabelactive", false);
model.result("pg2").set("xlabelactive", false);
model.result("pg2").feature("ptgr1").set("linemarker", "point");
model.result("pg2").feature("ptgr1").set("linewidth", "3");
model.result("pg2").feature("ptgr1").set("markerpos", "datapoints");
model.result("pg2").feature("ptgr1").set("descr", "Electric field, z component");
model.result("pg2").feature("ptgr1").set("expr", "temw.Ez");
model.result().export("anim1").set("repeat", true);
model.result().export("anim1").set("alwaysask", true);
model.result().export("anim1").set("gifopen", true);
model.result().export("anim1").set("framesel", "all");
model.result().export("anim1").set("giffilename", "D:\\SARA_Projects\\Propagating_wavepiece.gif");
model.result().export("anim1").set("title", "on");
model.result().export("anim1").set("legend", "on");
model.result().export("anim1").set("logo", "off");
model.result().export("anim1").set("options", "on");
model.result().export("anim1").set("fontsize", "12");
model.result().export("anim1").set("customcolor", new double[]{1, 1, 1});
model.result().export("anim1").set("background", "color");
model.result().export("anim1").set("axisorientation", "on");
model.result().export("anim1").set("grid", "on");
model.result().export("anim1").set("axes", "on");
return model;
}
public static void main(String[] args) {
run();
}
}
Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.