Units for mass, length and time

Hi Developers,

A current feature of PyFR is that it can operate in any consistent system of units. Would it be possible to add the ability to use a specific system of units; SI, for example?

At present, any scale factors used to non-dimensionalize a given PyFR case must be recorded separately. The .ini file has no means of recording and communicating the factors used. To give an example of the kind of question that can arise, one might be interested to know the viscosity of the gas used in a previous case. To ascertain the answer, it is necessary to have both the figure specified in the .ini file and a list of the scale factors.

The cylinder flow case in the paper ‘Heterogeneous computing on mixed unstructured grids with PyFR’ provides a good example of a snag with separate records; the .ini file is included in the supplementary material but the list of scale factors is not.

Best regards,

Paul Garlick

Hi Paul,

Thanks for your interest in PyFR.

A current feature of PyFR is that it can operate in any consistent system of units.

Yes.

Would it be possible to add the ability to use a specific system of units; SI, for example?

I believe that this capability is a subset of the above? If you enter everything consistently in SI you should be fine.

At present, any scale factors used to non-dimensionalize a given PyFR case must be recorded separately. The .ini file has no means of recording and communicating the factors used. To give an example of the kind of question that can arise, one might be interested to know the viscosity of the gas used in a previous case. To ascertain the answer, it is necessary to have both the figure specified in the .ini file and a list of the scale factors.

Not sure I fully follow here? If you non-dimensionalise a given setup, then indeed you would need to remember what you did if you wanted to back out dimensional values again. But these values are not required to specify the simulation - you just need to get Mach/Reynolds number correct?

The cylinder flow case in the paper ‘Heterogeneous computing on mixed unstructured grids with PyFR’ provides a good example of a snag with separate records; the .ini file is included in the supplementary material but the list of scale factors is not.

I believe that the .ini file fully specifies the simulation (Mach and Reynolds number). There are no other scale factors required?

Apologies if I have misunderstood something.

Cheers

Peter

Hi Paul,

Although the scale factors are indeed required to reverse the
non-dimensionalisation they are not needed if one wishes to make a
comparison with experimental data. All that matters is that the
numerical simulation have dynamic similitude with the experimental data.

Regards, Freddie.

Hi Peter, Hi Freddie,

Yes, this is correct; any consistent system of units is valid. However, the scale factors are significant if one has questions such as: ‘how big is the cylinder?’

To give a concrete example, the value for viscosity in the .ini file for the cylinder case is 6.07e-05. However, the units are not Pas, since the length scale has been non-dimensionalized by the diameter of the cylinder (d=1 in the .msh file). I guess mass and time have also been scaled since pressure and density are both equal to one.

Best regards,

Paul.

Hi,

On the subject of the structure of the .ini file, a related question is; is it possible to include variables in the [constants] section that are not used in the simulation?

I think in the cylinder case, the variable M (Mach number) is in this category–the velocity is used directly. Perhaps this mechanism could be used for storing the scale factors, should the user wish. They would not be used in the simulation itself but would serve as a record for any conversion to or from non-dimensional units that might be needed subsequently.

Best regards,

Paul.

Hi Paul,

On the subject of the structure of the .ini file, a related question is;
is it possible to include variables in the [constants] section that are
not used in the simulation?

I think in the cylinder case, the variable M (Mach number) is in this
category--the velocity is used directly. Perhaps this mechanism could
be used for storing the scale factors, should the user wish. They would
not be used in the simulation itself but would serve as a record for any
conversion to or from non-dimensional units that might be needed
subsequently.

You can indeed use the constants section to define additional variables.
Or, if you prefer, you can create your own section

[my-section]
foo = "some text"
bar = "some other text"

to record anything you wish.

Regards, Freddie.

Hi Freddie,

That’s a very useful feature. It covers the units question, for sure. A new section could contain something along the lines of:

[input-scaling]
scaleFactor_length = “…”
scalefactor_mass = “…”
scalefactor_time = “…”

Then a reader could make calculations such as:

length(in original unit) = PYFR_length*scaleFactor_length.

Regards,

Paul.