CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   chtMultiRegionFoam, adding a member to an existing class (regionProperties) (https://www.cfd-online.com/Forums/openfoam-solving/107666-chtmultiregionfoam-adding-member-existing-class-regionproperties.html)

romain.h October 3, 2012 12:13

chtMultiRegionFoam, adding a member to an existing class (regionProperties)
 
Hello,
I would like to add a member to an existing class, regionproperties, which already have two members, solid and liquid, but I do not find how to do so.
I would like to have solid, liquid and gas.
Gas will not be resolve with the same equations as liquid.

I try to modify the existing regionProperties.C. in src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/regionProperties.C (and .H)
But I can not run the .Allwmake in the opt directory, and if I copy the src directory in my user directory, and I have the following error :
Code:

+ wmake libso turbulenceModel
/usr/bin/ld: cannot open output file /opt/openfoam211/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: Permission denied
collect2: ld returned 1 exit status
make: *** [/opt/openfoam211/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so] Error 1
+ wmake libso RAS
/usr/bin/ld: cannot open output file /opt/openfoam211/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: Permission denied
collect2: ld returned 1 exit status
make: *** [/opt/openfoam211/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so] Error 1
+ wmake libso LES
/usr/bin/ld: cannot open output file /opt/openfoam211/platforms/linux64GccDPOpt/lib/libcompressibleLESModels.so: Permission denied
collect2: ld returned 1 exit status
make: *** [/opt/openfoam211/platforms/linux64GccDPOpt/lib/libcompressibleLESModels.so] Error 1

If someone could try to explain how I could modify an existing class which is located in the src directory or point me in the right direction it will be greatly appreciated.

An other solution will be to specify that all liquid region do not have to be solve by the same equation, by I am also stuck here.
I will have to put something else than forAll(fluidRegions) in the following code :

Code:

    forAll(fluidRegions, i)
        {
            Info<< "\nSolving for fluid region "
                << fluidRegions[i].name() << endl;
            #include "setRegionFluidFields.H"
            #include "readFluidMultiRegionSIMPLEControls.H"
            #include "solveFluid.H"
        }

Thanks,
Romain

romain.h October 10, 2012 15:05

The easiest solution I have found, even if it is not as elegant as I would like is to use a "if test" in myChtSimpleFoam.C and to check the name of the liquid region.
If it is gas, I use solveGas.H, if it is some other name, I use solveFluid.H

It is working if I use the right name for my zone. I could have problem with multiples zones, but I guess I could found a way with something like regionname1_gas (ect)


All times are GMT -4. The time now is 23:58.