0
$\begingroup$

My default mesh geometry length is in 80 mm. For OpenFoam, I scaled the mesh in meters as 0.008 m. Once I import the mesh in OpenFOAM, it is a collection of point coordinates. Now, the location of these points and spatial difference between different points will be the same either if they are in mm or m. I feel spatial unit is arbitrary here?

I want to understand when do I have to scale the geometry in Openfoam and when not?

$\endgroup$

2 Answers 2

4
$\begingroup$

In your problem description, note that $80\text{mm} \neq 0.008 \text{m}$.

That said, every quantity in a computer program is just a number. It's up to you to interpret it. So of course you can run a simulation where the domain has an edge length of 80 or 0.08 -- they refer to the same domain, after all. But depending on what you use as your base unit, you have to scale material constants as well. For example, at room temperature, the viscosity of air is $15.68\cdot 10^{-6}$ when expressed in meters (with units $m^2/s$ in this case), but $15.68$ when expressed in millimeters (with units $mm^2/s$ in that case). In other words, depending on what unit you choose as a base, your material parameters will be different.

$\endgroup$
3
  • $\begingroup$ In other words, if the base unit is in meters then material constant are converted. what about domain unit? 80 mm or 0.08 m? $\endgroup$
    – Thomas
    Commented Sep 23, 2013 at 17:23
  • $\begingroup$ What I'm saying is that you enter things into computers only as numbers, typically without explicit units. Given that, it is your job to make sure everything is consistent. $\endgroup$ Commented Sep 23, 2013 at 19:48
  • $\begingroup$ "every quantity in a computer program is just a number" That is very much not true specifically in OpenFOAM where many quantities are a dimensioned<> type, that is an object that carries a value and a dimension. During mathematical operations, the dimensions are being checked. However, the dimension says whether the quantity is a length, time, acceleration, density and so on, not whether it is in meters or kilometers and one is free to scale the problem as you show, unless one uses some specific thermophysical or similar model that is developed for SI. $\endgroup$ Commented Sep 8, 2022 at 14:28
1
$\begingroup$

I would like to answer "when to scale".

I say keep your geometry .stl , .3ds etc unscaled,in blockMesh give the bounding cuboid points in same units you have in your geometry, keep

convertToMeters 1;

when the entire meshing is done (including baffle and patch creation).

scale your geometry using

transformPoints -scale ('x' 'y' 'z')

x y z being factors by which each point in the mesh to multiplied, so if you want to scale uniformly 1/1000 , x=y=z=0.001.

this way you can keep the most accurate data of geometry while meshing and also scale to appropriate units without getting confused. there is cost though as mentioned by @Wolfgang Bangerth

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.