COMSOL 4.3a Java API Changes
General API Changes
- Class files compiled with COMSOL 4.3 or lower version need to be recompiled if they contain code that change the model of selections.
solutionintitleproperty governs whether to show solution information in plot titles. But since solution information has never been shown for 1D plots, regardless of the content of the property, the property has been removed from 1D plot groups.
Fluid Flow Interfaces API
The fluid flow features listed in the CFD Module and in the Microfluidics Module previously created a scalar Lagrange multiplier field with default name model.un_lm. They now instead create a vectorial Lagrange multiplier field with default name model.u_lm. The default component names in 3D are model.u_lm, model.v_lm and model.w_lm respectively. Java files must be updated accordingly.
Weak constraints for the Interior Wall feature are no longer available. Any references to the features weak constraint parameter (
weakConstraints) or its Lagrange multipliers must be removed.
The Automatic setting for the Pseudo time stepping property now sets the variable
.locCFL equal to the built-in variable
CFLCMP which in turn triggers a PID regulator via the automatic solver suggestions. Here,
<phtag> is the physics interface tag. Java files where pseudo time stepping is active and have local CFL number set to Automatic must be modified by adding the command
).prop("PseudoTimeProperty").set("CFLNumbExpr", 1, "Manual");
before calling a solver.
COMSOL 4.3 Java API Changes
- In the Acoustics Module the far-field variables
Lp_farget new names with full scope. They are now referred to as
acpr.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.
- From version 4.3 the methods
model.physics(are depreciated and replaced by the methods
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,
- 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,
- In the Solid Mechanics interfaces (
SolidMechanics, PiezoelectricDevices, AcousticStructure, Poroelasticity, ThermallyInducedStresses, JouleHeatingThermalExpansion, TransientAcousticStructure, FluidStructureInteraction), tensors in local coordinate systems
el, eel, Sl, si, and ei) have new names. The coordinates of the local system (for example
x1, 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 by
elx2x3is replaced by
el23. The tensors
eihave changed names to
- 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:
- 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 nonlin in the stationary solver could have the values
linearized. The default was in most cases auto, but in some cases, specifically in a frequency-domain study, the default was
linearized. In version 4.1 the possible values are
linper, with auto as default, except in the Frequency Domain, Linearized study step where the default is linper. The value
linearizedcan still be set, but this is treated as auto. If the problem is linear and the linearization point is
autoshould give the same solution as
linearized. For nonlinear problems where the linearization point is zero, the solution given by auto might be slightly different, and probably more accurate, while changing to off should give exactly the same solution as
linearized. When there is a nonzero linearization point it is relevant to use option
linper. This option works like
linearizedexcept that source terms which are to contribute in the linearized problem must be enclosed by the
- 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:
- 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 by rc instead of brc by 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 ChangesThe following changes were made to the COMSOL API between version 4.0 and 4.0a:
- The load face parameter (
Fph) of the Phase feature in
AcousticStructure, TransientAcousticStructure, ThermallyInducedStresses, SolidMechanics, JouleHeatingThermalExpansion, Poroelasticity, and FluidStructureInteractionhas changed interpretation from degrees to radians.
physics.field()of Beam and Truss are not backward compatible with 4.0. Scalar fields are now vector fields.
- The variables for strain and stress in the Shell interface 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,
- 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 XYZ to lowercase xyz.
- The acoustics interfaces (
PressureAcoustics, TransientPressureAcoustics, AcousticStructure, and TransientAcousticStructure) have been moved from material to spatial frame. This implies that index notation of vector variables have change from uppercase