Skip to content

Bug of thermo:mu on windows .exe version, compiled by mingw

Summary

The following code, runs ok in linux termial(wsl2-OpenSUSE15.6 ).

    mu_
    (
        dict.found("mu")
      ? mesh.lookupObject<volScalarField>(dict.get<word>("mu"))
      : mesh.lookupObject<volScalarField>
        (
            IOobject::groupName("thermo:mu", continuousPhase_)
        )
    )

but when runs by MYSYS2, it causes error:

17:37:24  --> FOAM FATAL ERROR: (openfoam-2406)
17:37:24  
17:37:24      failed lookup of mu (objectRegistry region0)
17:37:24      available objects of type volScalarField:

I believe the ":" in thermo:mu does not support windows.

Steps to reproduce

Just using the .exe solver which reads the thermo:nu, for example: /OpenFOAM/OpenFOAM-v2406/platforms/linux64MingwDPInt32Opt/bin/reactingParcelFoam.exe

Example case

/OpenFOAM-v2406/tutorials/lagrangian/reactingParcelFoam/rectangularChannel/constant/reactingCloud1Properties

What is the current bug behaviour?

The behavior of the code differs between Linux and Windows.

What is the expected correct behavior?

The behavior of the code between Linux and Windows are the same.

Relevant logs and/or images

08:58:45  --> FOAM FATAL ERROR: (openfoam-2406)
08:58:45  
08:58:45      failed lookup of mu (objectRegistry region0)
08:58:45      available objects of type volScalarField:
// skip avail field

08:58:45      From const Type& Foam::objectRegistry::lookupObject(const Foam::word&, bool) const [with Type = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
08:58:45      in file /home/tttt/OpenFOAM/OpenFOAM-v2406/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 628.
08:58:45  
08:58:45  FOAM exiting

Environment information

  • OpenFOAM version : v2406
  • Operating system : windows11
  • Hardware info : x86-64
  • Compiler : mingw, wsl2-OpenSUSE-15.6

Possible fixes

Substitute the using of thermo:mu to thermo_mu