- Introduction
- COMSOL Multiphysics
- AC/DC Module
- Acoustics Module
- Batteries and Fuel Cells Module
- CAD Import Module and LiveLink™ Products for CAD
- CFD Module
- Chemical Reaction Engineering Module
- Corrosion Module
- Electrodeposition Module
- Geomechanics Module
- Heat Transfer Module
- Material Library
- MEMS Module
- Microfluidics Module
- Nonlinear Structural Materials Module
- Optimization Module
- Particle Tracing Module
- Pipe Flow Module
- Plasma Module
- RF Module
- Structural Mechanics Module
- Subsurface Flow Module
- LiveLink™ for MATLAB®
- The COMSOL API
COMSOL 4.3 Java API Changes
- In the Acoustics Module the far-field variables
pfarandLp_farget new names with full scope. They are now referred to asacpr.ffc1.pfarandacpr.ffc1.Lp_far, respectively. Any user Model Java-files that use the old variable names in expressions (such as expressions to plot or evaluate expressions including these variables) will require a manual update.
- In the
Electrostaticsinterface, the parameterDisplacementFieldModelin the featureChargeConservationhas been renamed toConstitutiveRelationDfor consistency with the other physics interfaces.
- The newly added Rotating Machinery, Magnetics interfaces in the AC/DC Module will be defined in the Material frame. Vector variables, such as the electric current density
J, are now defined with components in the Material frame (JX,JY, andJZ). The Electric Field Transformation default feature computes the spatial electric and magnetic fields as postprocessing variables using a Lorentz transformation of the electric field, so the variablesEx,Ey,Ez,Bx,By, andBz(with components in the Spatial frame) are still defined.
- In the Electric Currents (
ConductiveMedia) interface, the featuresCurrentConservationInMixturesandArchiesLawhave been replaced by the general mixture model for the AC/DC Module. The same functionality can be obtained by creating aCurrentConservationfeature, set the required parameter (epsilonr_mat,mur_matorsigma_mat) toPorousMedia(orArchiesLawfor the electrical conductivity) and add aPorousMedia(orArchiesLaw) subfeature. When running class files compiled in COMSOL 4.2a or earlier, this conversion is done automatically.
- From version 4.3 the methods
model.physics(
<tag>).feature(<ftag>).params();model.physics(
<tag>).prop(propname).params();are depreciated and replaced by the methods
model.physics(
<tag>).feature(<ftag>).param();model.physics(
<tag>).prop(propname).param();COMSOL 4.2a Java API Changes
- Class files compiled with COMSOL 4.1 or lower version need to be recompiled
- The far field feature in the Electromagnetic Waves interface has changed from being a boundary feature with a boundary selection only, to being a domain feature with a domain selection and, as a sub feature, a boundary selection.
- The dependent variable associated with gauge fixing in the Magnetic Fields, Magnetic and Electric Fields, Electromagnetic Waves and Transient Electromagnetic Waves interfaces, is now unique per interface and is no longer available in the model scope, for example,
mod1.psi, etc. Instead the gauge fixing field is only available in the interface scope as, for example,mod1.mf.psi, etc.
- In the scattered field formulation in the Electromagnetic Waves interface, the scattered field is no longer available in the model scope, for example,
mod1.relEx. Instead the scattered field is only available in the interface scope as, for example,mod1.emw.relEx.
- In the Solid Mechanics interfaces (
SolidMechanics,PiezoelectricDevices,AcousticStructure,Poroelasticity,ThermallyInducedStresses,JouleHeatingThermalExpansion,TransientAcousticStructure,FluidStructureInteraction), tensors in local coordinate systems (el,eel,Sl,si, andei) have new names. The coordinates of the local system (for examplex1,x2,x3) are no longer used. Instead 1, 2, and 3 are used together with double indexing for all components. As an example,elX2is replaced byel22andelx2x3is replaced byel23. The tensorssiandeihave changed names toSilandeil.
- In the Darcy’s Law interface and Richards’ Equation interface in the Subsurface Flow Module, the compressibility of fluid is now a material parameter and they do no longer have a default value. If the default value was used you now have to set the value. The following example sets the permeability to the old default value:
model.physics("dl").feature("smm1").set(chif_mat,userdef);
model.physics("dl").feature("smm1").set(kappa,4e-10);
- In the Poroelasticity interface in the Subsurface Flow Module, the compressibility of fluid and the Biot-Willis coefficient are now material parameter and they do no longer have a default value. If the default value was used you now have to set the value. The following example sets the permeability to the old default value:
model.physics("dl").feature("smm1").set(chif_mat,userdef);
model.physics("dl").feature("smm1").set(kappa,4e-10);
- The Level Set and Phase Field interfaces now include the Initial Interface feature as default. If you have a model created in an earlier version of COMSOL, it will fail to create a feature with the same tag name.
COMSOL 4.1 Java API Changes
The following changes were made to the COMSOL Java API between version 4.0a and 4.1:
- In version 4.0a the property
nonlinin the stationary solver could have the valuesauto,on,off, andlinearized. The default was in most casesauto, but in some cases, specifically in a frequency-domain study, the default waslinearized. In version 4.1 the possible values areauto,on,off, andlinper, withautoas default, except in the Frequency Domain, Linearized study step where the default islinper. The valuelinearizedcan still be set, but this is treated asauto. If the problem is linear and the linearization point is zero,autoshould give the same solution aslinearized. For nonlinear problems where the linearization point is zero, the solution given byautomight be slightly different, and probably more accurate, while changing tooffshould give exactly the same solution aslinearized. When there is a nonzero linearization point it is relevant to use optionlinper. This option works likelinearizedexcept that source terms which are to contribute in the linearized problem must be enclosed by thelinperoperator.
- In this CFD Module, Subsurface Flow mode, in the Darcy’s Law interface, Brinkman interface, Richards’ Equation interface, and the Poroelasticity interface, the permeability and porosity are now material parameters and they do no longer have a default value. If the default value was used in a Java-file you now have to set the value. The following example sets the permeability to the old default value:
model.physics("dl").feature("dlm1").set(kappa_mat,userdef);
model.physics("dl").feature("dlm1").set(kappa,3e-11);
- The pressure variable in solid mechanics, typically
solid.pw, now only gets allocated degrees of freedom for incompressible materials. If you have referred to it, for example, during segregation in the solver, the code will have to be changed to remove the field.
- The solution to eigenvalue and eigenfrequency problems may now appear in a different order.
- The Batteries & Fuel Cells Module’s boundary feature
BoundaryReactionCoefficient, is tagged byrcinstead ofbrcby default. This means that files that explicitly refer to the old default tag name must be modified to refer to the new tag name.
COMSOL 4.0a Java API Changes
The following changes were made to the COMSOL API between version 4.0 and 4.0a:
- The load face parameter (
Fph) of the Phase feature inAcousticStructure,TransientAcousticStructure,ThermallyInducedStresses,SolidMechanics,JouleHeatingThermalExpansion,Poroelasticity, andFluidStructureInteractionhas changed interpretation from degrees to radians.
physics.field()ofBeamandTrussare not backward compatible with 4.0. Scalar fields are now vector fields.
- The variables for strain and stress in the
Shellinterface have been renamed. Variable names that began with lowercase s now begin with uppercase S. For variables names that ended in lowercase l (L), the letter was moved to the third position. For example,emXXlis nowemlXX.
- Force loads on solids and trusses have been moved from material to spatial frame. This implies that index notation of some variables have changed from uppercase
XYZto lowercasexyz.
- The acoustics interfaces (
PressureAcoustics,TransientPressureAcoustics,AcousticStructure, andTransientAcousticStructure) have been moved from material to spatial frame. This implies that index notation of vector variables have change from uppercaseXYZto lowercasexyz.

