top of page

Spare Disk Space: How to Save COMSOL Results Only Where You Need Them

If you have ever simulated a large 3D model in COMSOL Multiphysics and watched your hard drive fill up within minutes, you already know the problem. By default, COMSOL stores the full solution across the entire mesh — every node, every element, every physics variable — for every time step or parameter value in your study. For a fine-mesh with millions of degrees of freedom, that data can easily balloon into tens or even hundreds of gigabytes. The good news is that COMSOL gives you precise control over *where* solution data is stored, and using it intelligently can shrink your output files by an order of magnitude without sacrificing the important part of the results.


This article walks you through how to store results only where they actually matter.


Why COMSOL Files Get So Large


Before diving into the how, it helps to understand the why. Every time COMSOL solves a study step, it writes the raw solution vector — all the degrees of freedom — into the .mph file. For a time-dependent or parametric study, this happens once per stored solution. A transient thermal simulation with 2 million nodes, 5 temperature-like variables, stored at 200 time steps, already amounts to several gigabytes of raw data before COMSOL adds mesh information, plot data, and study metadata.


The solution is not to avoid fine meshes or coarse time stepping. The solution is to tell COMSOL precisely what portion of the solution it actually needs to keep on disk.


How to Create a Selection


The study settings dialog for restricting output displays a list of named selections already defined in your model. You cannot build a selection inline from within that dialog — you must define it under Definitions first. There are four geometric entity levels to choose from, depending on what you want to capture.


Point Selection


Use a point selection when you need field values at one or more specific coordinates — for example, a known sensor location or a critical stress concentration point.


  1. Right-click Definitions in the model tree and choose Selections → Explicit.

  2. Set the Geometric entity level to Point.

  3. In the Graphics window, click the vertices you want to include. Selected points highlight and their index numbers appear in the list.

  4. Give the selection a clear name in the Label field (for example, Sensor A or Crack Tip).


If the exact point you need does not coincide with an existing vertex in the geometry, you have two options: add it as a point in the geometry sequence, or use a Point Probe under Definitions instead — though probes write to a separate table rather than the main solution output.


Edge Selection


Use an edge selection to store results along one or more lines or curves — for example, a weld seam, a pipe centerline, a contact edge, or any other 1D feature where you want to track how a quantity varies along its length.


  1. Right-click Definitions in the model tree and choose Selections → Explicit.

  2. Set the Geometric entity level to Edge.

  3. In the Graphics window, click the edges you want to include. Fine edges can be easier to select by rotating the model or zooming in closely; selected edges highlight and their index numbers appear in the list.

  4. Name the selection clearly (for example, Weld Line or Pipe Axis).


Edge selections are particularly useful in structural models where you suspect peak stresses occur along a specific geometric feature, or in heat transfer models where you want to monitor temperature distribution along a thin fin edge. Storing only the edge rather than the surrounding surface or volume can dramatically reduce output size while still providing a meaningful spatial profile.


Boundary Selection


Use a boundary selection to store results on one or more surfaces — a symmetry plane, an interface between materials, an outlet face, or any other 2D cross-section through the model.


  1. Right-click Definitions and choose Selections → Explicit.

  2. Set the Geometric entity level to Boundary.

  3. In the Graphics window, click the faces you want to include. You can rotate the model and select from any angle; selected faces highlight and their index numbers appear in the list.

  4. Name the selection descriptively (for example, Mid-plane XZ or Outlet Surface).


If your desired cross-section does not coincide with any existing face in the geometry — for example, you want a mid-plane through a solid block that has no internal partition — you need to add that face first. The cleanest approach is to insert a Work Plane at the desired position in the geometry sequence, then use a Partition Domains operation to split the solid along it. This creates a shared interior boundary that you can then select.


Domain Selection


Use domain selection to store the full 3D field only within specific subdomains — for example, a critical structural component, a region near a heat source, or a thin fluid layer — while discarding the rest.


  1. Right-click Definitions and choose Selections → Explicit.

  2. Set the Geometric entity level to Domain.

  3. In the Graphics window, click each domain you want to include. Selected domains highlight and their index numbers appear in the list. If you know the domain numbers already, you can type them in directly.

  4. Name the selection clearly (for example, Rotor Core or Heat Sink Body).


You can add as many named selections as you need, and you can add multiple selections of different types. All of them will appear in the study settings dialog, and you can combine them freely.


Restricting Output in the Study Settings


Once your selections are defined, you instruct COMSOL to use them from within the study node. This step is the same regardless of whether you are working with points, edges, boundaries, or domains.


  1. In the model tree, click on your Study step node (for example, Step 1) to open its settings window.

  2. If you do not see it, make sure you are looking at the Study Step Settings tab, not the solver sequence nodes below it.

  3. Find the Store in output dropdown, which defaults to All. Change it to Selections.

  4. A table appears below the dropdown. Click the + (Add) button on the right side of the table.

  5. A dialog opens showing a simple list of all named selections defined in the model. Click the selection you want and press OK.

  6. Repeat steps 4–5 to add additional selections if needed.


COMSOL Study Step settings with the Store in Output section help to store only part of the data.
COMSOL Study Step settings important for reducing the file size.

Once you run the study, COMSOL computes the full solution internally but only writes values at the geometric entities belonging to your selections. Everything outside those selections is discarded before being written to disk.


Controlling Which Time Steps Are Stored


For transient studies, restricting where results are stored is only half the picture. You can also control when — that is, which time steps get written to the output at all.


By default, a Time Dependent study stores the solution at every time step the solver takes internally, which can be a very large number for stiff problems or long simulations. To limit this:


  1. In the model tree, expand your study and click on the Time Dependent study step node.

  2. In the Times field, you already specify the output time range. Make sure this reflects only the time points you genuinely need for post-processing — for example, range(0, 10, 3600) for one snapshot every 10 seconds over an hour, rather than a very dense range.


Combining selective time steps with a restricted spatial selection multiplies the savings. A study that stores results only on a mid-plane boundary at 20 time snapshots instead of 500 can reduce output size by several thousand times compared to full-volume storage at every step.


Recovering Full Fields When Needed


If you find later that you need field data that was not stored, all is not lost — as long as you have not changed the model. COMSOL can re-run the solver and store a richer output the second time. For expensive simulations, consider running a first restricted pass to validate that the physics and boundary conditions are behaving correctly, then running a more complete output pass only after you have confirmed the setup is right. This two-pass approach costs some extra solver time but can save a great deal of disk space and post-processing time during the development phase of a project.


Summary


The workflow always follows two steps: first, define named selections under Definitions → Explicit at the appropriate geometric entity level, then reference them in the study under Values of Dependent Variables → Store fields in output → For selections.


Selection type

Geometric level

Typical use case

Typical space saving

Point

Point

Field value at a known coordinate

>1000×

Edge

Edge

Weld seam

200–1000x

Boundary

Boundary

Cross-section, surface flux, interface

50–200×

Domain

Domain

Subregion of interest in a large assembly

5–50×

Selective time steps

Transient study with many solver steps

10–500×


bottom of page