Latest Discussions - COMSOL Forums https://www.comsol.com/forum/ Most recent forum discussions Mon, 29 Sep 2025 10:50:33 +0000 COMSOL Forum: Latest Discussions https://www.comsol.com/shared/images/logos/comsol_logo.gif https://www.comsol.com/forum/ Error for LiveLink with MATLAB https://www.comsol.com/forum/thread/368971/error-for-livelink-with-matlab?last=2025-09-29T13:18:09Z <p>Dear all,</p> <p>I convert the COMSOL simulation model file to run with LiveLink in MATLAB. When I run the .m file, the import commands work, but the command ModelUtil.crate does not.</p> <p>The command window gives:</p> <p>Unable to resolve the name 'ModelUtil.create'</p> <p>Error in (line 10) model = ModelUtil.create('Model')</p> <p>I am using COMSOL 5.6, Matlab 2022b on Ubuntu 18.04.6 LTS</p> <p>How can I fix this?</p> <p>Thank you in advance.</p> Mon, 29 Sep 2025 10:50:33 +0000 4.2025-09-29 10:50:33.368971 Coupling of 1D and 3D Pipe Flow (nonisothermal flow) https://www.comsol.com/forum/thread/368952/coupling-of-1d-and-3d-pipe-flow-nonisothermal-flow?last=2025-09-26T16:58:47Z <p>Greetings: I am attempting to transfer flow conditions from a 1D nipfl (nonisothermal pipe flow) outlet to a 3D nonisothermal flow (nitf) domain inlet, however, I have been having trouble making this work.</p> <p>The idea is simple: use the 1D mass flow rate (or pressure/velocity conditions) and outlet temperature and then use this data to produce an averaged value across the 2D fluid face for a 3D domain and continue analysis from there.</p> <p>I understand normally you can use features like "pipe connection" for coupling 1D to 3D features, but I'm reasonably sure that nipfl is not supported for this, as I cannot apply this multiphysics feature with the current physics present.</p> <p>Supposedly this can be done with general extrusion (1D point to 2D face projection), however, I have not successfully figured out how to make this work from the documentation I have read.</p> <p>Current simple test model is attached. It is meant to be a continuous uniform ID pipe with a thermal condition on the 1D length for testing purposes of this concept. Thanks.</p> Fri, 26 Sep 2025 16:58:13 +0000 4.2025-09-26 16:58:13.368952 Calculating Leakage and Magnetizing Inductance in a Simple Transformer Model https://www.comsol.com/forum/thread/368942/calculating-leakage-and-magnetizing-inductance-in-a-simple-transformer-model?last=2025-09-24T18:11:15Z <p>Hello.</p> <p>I am making a COMSOL model of a simple transformer with a primary 4 turn coil and a secondary single turn coil around a ferrite core. I was wondering if it was possible to calculate leakage and magnetic inductances in COMSOL with the model I have setup. Currently the only inductance values I can find are those of the individual coils.</p> <p>My MPH file is attached below. Is the model I made too simple to undergo such analysis?</p> <p>Thank you</p> Wed, 24 Sep 2025 18:11:15 +0000 4.2025-09-24 18:11:15.368942 Regarding contact - transient - impact https://www.comsol.com/forum/thread/368933/regarding-contact-transient-impact?last=2025-09-24T05:33:32Z <p>Now I have a problem with simulating the "stopper" structure (that is, one movable and one fixed constraint). The main small exploration is whether the structure will fail after the movable structure hits the stopper, such as damage or stress exceeding the limit. Assuming the gap between the movable and fixed is 2um, then I apply a load to the movable part, and the displacement of the movable part exceeds the gap, for example, the simulation result shows that the displacement of the movable part is 20um. However, through stress extraction, it is found that the stress has not exceeded the limit, and there is also a contact force in the contact setting. So I'm wondering if increasing the penalty factor is feasible, that is, will it prevent the displacement from being so large? Or are there any other suggested methods?!!</p> Wed, 24 Sep 2025 05:33:32 +0000 4.2025-09-24 05:33:32.368933 Prestress Analysis for Thermal Stress Analysis https://www.comsol.com/forum/thread/368922/prestress-analysis-for-thermal-stress-analysis?last=2025-09-23T16:34:54Z <p>Hi All,</p> <p>I am doing Prestress analysis of Power Module where after the soldering is done, we cool it down from 230 degC to 25 degC. Now because of this cooling, the power module will shrink and because of that there will be some stress in it. Now, when I use this power module and heat it from 65 degC to 130 degC, the stresses generated due to the shrinkage should be revealed from the power module. I am trying to replicate this scenario.</p> <p>For that, I have performed the prestress simulation in COMSOL and I have added one more physics of Thermal Stress and one more study to perform the 2nd simulation. For the 2nd Simulation, I clicked on get initial value and ran the simulation. But this procedure does not seems to give me correct results. Does anyone know whether this method is correct or not? I have attached the photo here for your reference.</p> Tue, 23 Sep 2025 16:34:54 +0000 4.2025-09-23 16:34:54.368922 Using previous solution in Variable not solved for time dependent https://www.comsol.com/forum/thread/368902/using-previous-solution-in-variable-not-solved-for-time-dependent?last=2025-09-24T17:52:10Z <p>Hello,</p> <p>I was wondering if it is possible to replicate the situation: using previous solution in Variable not solved for in time dependent for all time steps solution ( study settings), but, in the physics node with ''withsol'' or with something else. This approach of all time steps is needed and ''withsol'' allows a specific time step or value, but I need for all time steps. I know that I can do it in the study settings, but, as I have two different fields, the previously study need to solve this 2 fields for the using them after, although one of this field is prescribed, so, it is occupying memory. If i can do it in the physics, my model will be more efficient.</p> Fri, 19 Sep 2025 18:52:39 +0000 4.2025-09-19 18:52:39.368902 Mass Loss in Level-Set Tank Simulation After Air Injection https://www.comsol.com/forum/thread/368901/mass-loss-in-level-set-tank-simulation-after-air-injection?last=2025-09-19T17:28:04Z <p>Hello everybody,</p> <p>I am simulating, using the Level-Set method, a cylindrical tank partially filled with water (liquid phase, shown in red) and air. The geometry has been reduced to half of the cylinder by applying a symmetry boundary condition. From the bottom of the cylinder, air is injected through a nozzle at a constant flow rate for a time t*. The simulation was run up to a total time t,tot > t* (i.e., also after the injection stops).</p> <p><strong>Problem:</strong> By observing the gif/animation of the phase evolution, the mass (or volume) of the liquid phase gradually decreases over time: the water level keeps dropping and does not return to its initial level once the air injection stops.</p> <p>My expectation is that, once the air injection ends, the system should return — within small numerical errors — to its initial liquid level. Where is the water “going”? What am I doing wrong in my setup?</p> <p><a href="https://drive.google.com/file/d/1Jg4I6xOycrEzeAES7pzMm4SZ8hvf7PSh/view?usp=sharing">Link to movie</a></p> Fri, 19 Sep 2025 17:27:13 +0000 4.2025-09-19 17:27:13.368901 Issue with Empty Bottom Region in Hot Fluid Injection Model https://www.comsol.com/forum/thread/368882/issue-with-empty-bottom-region-in-hot-fluid-injection-model?last=2025-09-19T14:27:40Z <p>Hello all,</p> <p>I modeled a column of hot fluid being injected into an argon domain, similar to the setup shown in the attached figure. Since the bottom boundary of the fluid column is not an external boundary, I defined the inlet at the top boundary of the column.</p> <p>In my setup, I am using Level-Set to track the interface of the deposited material, along with Heat Transfer and Laminar Flow physics.</p> <p>My question is: Why does the bottom part of the column remain empty during the injection process? I do not observe a continuous flow of material while the deposition is occurring.</p> <p>Any suggestions or insights would be greatly appreciated!</p> Fri, 19 Sep 2025 14:27:40 +0000 4.2025-09-19 14:27:40.368882 Attempt to evaluate negative power of zero. Error when refining mesh in 3D diode model https://www.comsol.com/forum/thread/368871/attempt-to-evaluate-negative-power-of-zero-error-when-refining-mesh-in-3d-diode-model?last=2025-09-17T12:22:56Z <p>Hi,</p> <p>I am trying to build a 3D diode model, but when I refine the mesh I get the following error:</p> <p><em>Adaptive solver stopped. Failed to find a solution. Attempt to evaluate negative power of zero. Function: ^ Failed to evaluate expression. Expression: (2d(comp1.semi.mf,X))(0.5((((d(comp1.semi.mf,X)^2)+(d(comp1.semi.mf,Y)^2))+(d(comp1.semi.mf,Z)^2))^(-0.5))) Failed to evaluate Jacobian of expression. Expression: sqrt(((d(comp1.semi.mf,X)^2)+(d(comp1.semi.mf,Y)^2))+(d(comp1.semi.mf,Z)^2)) Failed to evaluate Jacobian of expression. Expression: comp1.semi.intadapt(sqrt(d(comp1.semi.mf,X)^2+d(comp1.semi.mf,Y)^2+d(comp1.semi.mf,Z)^2)) Returned solution is not converged. Not all parameter steps returned.</em></p> <p>I was trying to use the Adaptation and Error Estimates functionality. In the Functional field, I entered:</p> <p><em>root.comp1.semi.intadapt(sqrt(d(root.comp1.semi.mf,root.X)^2 + d(root.comp1.semi.mf,root.Y)^2 + d(root.comp1.semi.mf,root.Z)^2))</em></p> <p>Then I changed it to:</p> <p><em>root.comp1.semi.intadapt(sqrt(d(root.comp1.semi.mf,root.X)^2 + d(root.comp1.semi.mf,root.Y)^2 + d(root.comp1.semi.mf,root.Z)^2 + epssmall))</em></p> <p>to avoid division by zero. However, whenever I run the computation, the parameter** eps_small** is automatically removed from the expression, even if I try to save it. Could you please help me understand why this happens and how to keep the parameter in the expression?</p> <p>Thanks a lot for your help.</p> <p>Best regards,</p> Wed, 17 Sep 2025 12:22:56 +0000 4.2025-09-17 12:22:56.368871 Solve the coupled equations using PDE https://www.comsol.com/forum/thread/368863/solve-the-coupled-equations-using-pde?last=2025-09-17T13:36:52Z <p>Hallo,Dear experts,</p> <p>How to use the coefficient form of PDE equations to solve this coupled system of four equations, where the variables phiI, phiR and A need to be solved, and the V in the equation is a scalar field about phi. These equations are shown in the following picture. Additionally, this document also provides boundary conditions. My goal is to reproduce the three figures in the document. After inputting these equations and boundary conditions, I am unable to calculate the results. Is this related to the boundary conditions given in the literature? How should I solve it?</p> <p>Thank you for your help!</p> Wed, 17 Sep 2025 11:57:32 +0000 4.2025-09-17 11:57:32.368863 Far field calculation in metasurface https://www.comsol.com/forum/thread/368853/far-field-calculation-in-metasurface?last=2025-09-18T04:04:32Z <p>Hi guys. Now I am facing a problem of getting far field from an array. When calculating the near field, periodic condition is applied and only a single unit is calculated. But when I tried to apply far field node in the model, I think COMSOL only do stratton-chu equation on the single unit but not the whole array. Since I want to calculate the far field from the whole array, I think I need the integral on the whole surface of the whole array. Is there a solution for this problem now? Thanks!</p> Tue, 16 Sep 2025 22:35:08 +0000 4.2025-09-16 22:35:08.368853 Partition an Imported Face into Circular/Rectangular Regions https://www.comsol.com/forum/thread/368842/partition-an-imported-face-into-circularrectangular-regions?last=2025-09-25T21:06:07Z <p>Hello everyone,</p> <p>I’m working with imported geometries in COMSOL (typically STL/MPHTXT files), and I would like to partition specific faces into smaller circular or rectangular regions of defined size. The ultimate goal is to assign different boundary conditions on these partitions later in my simulation workflow.</p> <p>Here’s what I’m aiming for:</p> <p>Workflow: Import the geometry. Partition a selected face (for example, Face 2/3 in my attached geometry) into circular or rectangular regions (e.g., a circle of 1mm radius centered on a certain point on Face 2). Use these partitions to define boundary conditions in the physics modules and mesh them separately. Ideally, automate or repeat this sequence via MATLAB.</p> <p>Challenge: I’m able to find the “Partition Faces” operation in the Geometry module, but it only seems to offer splitting via work planes, extended edges, or curves between existing vertices. I don’t see an option to directly create arbitrary-shaped partitions (like circles or rectangles) purely on an existing face, especially on imported surfaces.</p> <p>Is there a way to do this?</p> <p>Thank you very much for your time and assistance!</p> Tue, 16 Sep 2025 13:44:19 +0000 4.2025-09-16 13:44:19.368842 Force and torque change with displacement https://www.comsol.com/forum/thread/368833/force-and-torque-change-with-displacement?last=2025-09-16T12:39:44Z <p>What I want to achieve in a simulation (multibody dynamics) is to apply a certain external force and torque to an object, where the magnitude of the applied external force and torque varies continuously with displacement. Specifically, when the change in displacement is less than 1 [mm], I want the displacement value to 'revert' or 'hold' at the last achieved value that meets the conditions (for example, the last whole millimeter point). In other words, I want the forces and torques I apply to exactly result in a 1 [mm] change in displacement. I have tried many different settings, but nothing has worked, so I would like to know how to configure it properly.</p> Tue, 16 Sep 2025 08:19:54 +0000 4.2025-09-16 08:19:54.368833 Help with Free flow and Porous Media Flow (Brinkman) https://www.comsol.com/forum/thread/368832/help-with-free-flow-and-porous-media-flow-brinkman?last=2025-09-16T01:58:12Z <p>Hi all,</p> <p>NOTE: I tried uploading to the forum earlier today, but once I finished writing and click "submit" it disappeared and I couldn't figure out if it was under review? or some sort of process before posting, or if it was discarded entirely. If you see a similar post by me that looks like this one, my apologies.</p> <hr /> <p>I am having trouble modeling using the Free flow and porous media flow (Brinkman). I am trying to model hyporheic flow by simply creating a 2D box, made of 2 layers (sediment and water). I apply velocity or pressure from the left boundary and create a lateral flow that partially seeps into the sediment bed (mimicing hyporheic flow). However, the issue I'm having is that the model will not find a solution and/or the solver won't converge unless I use very low velocities or pressure values (0.001 Pa or 0.001 m/s). I am trying to run the model using larger values of velocity, not extremely large but something around the values of 0.5-5 m/s velocity values.</p> <p>I tried using another physics component, which was the free and porous media flow (Darcy), but to no avail. I tried making the cross section larger (it is 1m by 0.5 m), and again the model wont give out results unless the boundary condition is very small.</p> <p>Can someone please help me figure out why the model wont let me use larger values, and how do I fix this issue? Thank you.</p> Tue, 16 Sep 2025 01:58:12 +0000 4.2025-09-16 01:58:12.368832 Exporting 3D shape without Its mesh https://www.comsol.com/forum/thread/368811/exporting-3d-shape-without-its-mesh?last=2025-09-15T06:57:55Z <p>Hello, everyone! I am relatively new in COMSOL. What I've understood is when I export an expression under "volume" result, I will get cube coordinate as well as the expression value in .txt format (for example). Then when I visualize It, there will appear a volumed shape together with Its mesh.</p> <p>However, I just want to export any volumed shape without any mesh. Anyone please help me. Can I get this from COMSOL? Many thanks in advice</p> Mon, 15 Sep 2025 04:07:36 +0000 4.2025-09-15 04:07:36.368811 How to Export Mode Shapes (Vertical Displacement) in COMSOL 5.2 https://www.comsol.com/forum/thread/368802/how-to-export-mode-shapes-vertical-displacement-in-comsol-52?last=2025-09-13T02:44:48Z <p>Hi everyone,</p> <p>I’m currently modeling a plate because I want to obtain its mode shapes and corresponding natural frequencies. I’ve been able to get those results, but now I’d like to export the mode shapes (specifically the vertical displacement ? as a function of ? and ?) and I’m not sure how to do it.</p> <p>In the Results tab, I see Surface 1, and under that, I have Deformation, but I can’t find a way to export the data. I’m using version 5.2.</p> <p>Any guidance would be greatly appreciated.</p> <p>Thanks in advance</p> Sat, 13 Sep 2025 02:44:48 +0000 4.2025-09-13 02:44:48.368802 Why does 2D static deformation plot show displacement magnitude smaller than the Y-axis displacement? https://www.comsol.com/forum/thread/368792/why-does-2d-static-deformation-plot-show-displacement-magnitude-smaller-than-the-y-axis-displacement?last=2025-09-12T18:59:27Z <p>In this model, the color-scale (displacement magnitude, ~0.1mm) deformation does not match the XY spatial deformation of the plot (~20mm). Can someone help me understand how the displacement magnitude is different from what is plotted in XY space?</p> Fri, 12 Sep 2025 17:09:34 +0000 4.2025-09-12 17:09:34.368792 Force and torque change with conditions https://www.comsol.com/forum/thread/368783/force-and-torque-change-with-conditions?last=2025-09-15T09:04:00Z <p>One type of simulation (multibody dynamics) I want to achieve is to apply a certain external force and torque on an object, with the requirement that the magnitude of the applied external force and torque changes continuously with displacement. It should be such that the magnitude of the force and torque is just enough to cause displacement. How should I set this up?</p> Fri, 12 Sep 2025 13:51:44 +0000 4.2025-09-12 13:51:44.368783 Material Properties Reference https://www.comsol.com/forum/thread/368781/material-properties-reference?last=2025-09-13T11:52:31Z <p>Hello,</p> <p>I am working COMSOL Multiphysics 6.3 for quiet a while now and would say I have quiet a bit of experience.</p> <p>However I have one big issue. I can not get the references for material properties from the COMSOL library. I tried multiple approaches to get that information:</p> <p>1) As described in the Material Library User guide: In Materials -> Browse Materials -> Select Material and Property. The property reference window just displays no text at all for any material or property I select.</p> <p>2) Checking in File -> help -> documentation -> Comsol Multiphysics -> Reference Manual -> Materials -> Module-Specific Material Libraries: The source listed here for the piezoelectric materials is the efunda website, which in itself has some books listed but not property specific and non of the books seems to have matching properties to the one COMSOL uses. Some values may be the same but never the set of values I list below. That applies for the CRC Handbook, the MEMS handbook and the Macmillan properties.</p> <p>3) Checking the online reference manual -> materials -> module specific material databases. There are no sources named for piezoelectric materials and the ones for MEMS are the same as on the efunda webpage but as I said they do not match the values in COMSOL. For example youngs modulus for gold is 70e9 in COMSOL but in the books listed 78e9.</p> <p>I want references for Youngs Modulus, Poisson ratio and density for: Au, Pd, SiO2 I want references for Coupling matrix, elasticity matric, relative permittivity and density for: Lithium Niobate and Gallium Arsenide</p> <p>How do I obtain proper sources? Is there a bug in the first option I list? That seems to be the way one is supposed to get that information.</p> <p>Thanks for any help.</p> Fri, 12 Sep 2025 13:24:37 +0000 4.2025-09-12 13:24:37.368781 Lumped port problem (Element 1 should be placed between two conductive boundaries) https://www.comsol.com/forum/thread/368761/lumped-port-problem-element-1-should-be-placed-between-two-conductive-boundaries?last=2025-09-12T18:20:13Z <p>When I placed the lumped port in the CPW design the error showed - "Subfeature Uniform Element 1 should be placed between two conductive boundaries. - Feature: Uniform Element 1 (ue1) " - I placed the lamped port in between the perfect electric conductor boundary, still this error message came and stopped the process. Can anyone check the file attached and give me the advise to correct this? I already go through the examples COMSOL provide, but can not understand the problem. Also the ground and ports are not connected to each other (separated by a air gap).</p> Thu, 11 Sep 2025 13:53:51 +0000 4.2025-09-11 13:53:51.368761