About the Unit conversion problem when Import/Export file

Hello,
I found that when importing a large model file, the unit will be converted to meters.I now want to convert the units to centimeters. What should I do? It also keeps the output in centimeters when outputting.
Thanks.

Hi @zgq !

Especially when working with CAD files like ACIS/STEP it’s common for these files to be exported from the CAD application in a different unit system than you were working in… this may be why you’re experiencing this issue.

The preferred method for converting between systems is simply to scale the mesh during the export step:

transform mesh output scale <scale_factor>

Note that this command is multiplicative so a script like this:

reset
brick x 1 
mesh vol 1
## Scaling output mesh by 0.1
transform mesh output scale 0.1
export exodus "mesh_scaled_0p1.e" overwrite
## Now the output mesh will be scaled by 0.1 * 0.1 = 0.01
transform mesh output scale 0.1
export exodus "mesh_scaled_0p01.e" overwrite

will result in a final mesh that’s scaled by 0.1 x 0.1 = 0.01.

To reset the scaling you’ll need to run:

transform mesh output reset

Thank you for your reply!
I am not very familiar with Cubit. At present, I need to import a STEP model into Cubit, use Cubit to repair the model, and then export it as a DAGMC model using plugins.
" Ensure that units/sizes for DAGMC models are “cm” ." This is required by the plugin. However, I found that the default unit of my model will be meters when imported, and it will still be meters after exporting, which has caused confusion for my subsequent simulations, so I would like to ask if there is a way to change the default unit of the model to centimeters.

Thanks!

Ah, DAGMC… I presume you’re exporting STL files then? We handle STL files a bit differently than other meshes (i.e. we consider STL to be a geometry format, not a mesh format).

If so, this requires a slightly different approach…

  1. Figure out what Cubit has you scaled at by getting a feel for the dimensions with the axis plotting:
    image

  2. Then scale your geometry to get you to the correct size using:
    vol <list of volume ids> scale <scale_factor>
    or
    vol all scale <scale_factor>

Then you should be able to export just fine :slight_smile: