CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

chtMultiRegion: adding a source

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2012, 09:54
Default chtMultiRegion: adding a source
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
Dear all,

I am trying to add a source to the chtMultiRegionFoam solver.

I modified the createSolidFields.H like this:
Code:
    // Initialise solid field pointer lists
    PtrList<basicSolidThermo> thermos(solidRegions.size());
	PtrList<volScalarField> QSolid(solidRegions.size());

    // Populate solid field pointer lists
    forAll(solidRegions, i)
    {

	QSolid.set
        (
            i,
            new volScalarField
            (
                IOobject
                (
                    "Q",
                    runTime.timeName(),
                    solidRegions[i],
                    IOobject::MUST_READ,
                    IOobject::AUTO_WRITE
                ),
                solidRegions[i]
            )
        );


        Info<< "*** Reading solid mesh thermophysical properties for region "
            << solidRegions[i].name() << nl << endl;

        Info<< "    Adding to thermos\n" << endl;
        thermos.set(i, basicSolidThermo::New(solidRegions[i]));
    }
and the solveSolid.H like this:
Code:
if (finalIter)
{
    mesh.data::add("finalIteration", true);
}

{
    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
    {
        tmp<fvScalarMatrix> TEqn
        (
            fvm::ddt(rho*cp, T)
          - fvm::laplacian(kappa, T)
	  - Q
        );
        TEqn().relax();
        TEqn().solve(mesh.solver(T.select(finalIter)));
    }

    Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl;
}

thermo.correct();

if (finalIter)
{
    mesh.data::remove("finalIteration");
}if (finalIter)
{
    mesh.data::add("finalIteration", true);
}

{
    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
    {
        tmp<fvScalarMatrix> TEqn
        (
            fvm::ddt(rho*cp, T)
          - fvm::laplacian(kappa, T)
	  - Q
        );
        TEqn().relax();
        TEqn().solve(mesh.solver(T.select(finalIter)));
    }

    Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl;
}

thermo.correct();

if (finalIter)
{
    mesh.data::remove("finalIteration");
}
.

The point is that when I try to compile the solver, I get this error:
Code:
lab@lab-laptop:~/OpenFOAM/lab-2.1.0/applications/solvers/chtMultiRegionFoam_Epta$ wmake
Making dependency list for source file fluid/compressibleCourantNo.C
Making dependency list for source file solid/solidRegionDiffNo.C
Making dependency list for source file chtMultiRegionFoam_Epta.C
SOURCE=fluid/compressibleCourantNo.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -Ifluid -Isolid -Iinclude -I/opt/openfoam210/src/meshTools/lnInclude -I/opt/openfoam210/src/finiteVolume/lnInclude -I/opt/openfoam210/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam210/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam210/src/thermophysicalModels/basicSolidThermo/lnInclude -I/opt/openfoam210/src/turbulenceModels/compressible/turbulenceModel/lnInclude -I/opt/openfoam210/src/thermophysicalModels/radiationModels/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/compressibleCourantNo.o
SOURCE=solid/solidRegionDiffNo.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -Ifluid -Isolid -Iinclude -I/opt/openfoam210/src/meshTools/lnInclude -I/opt/openfoam210/src/finiteVolume/lnInclude -I/opt/openfoam210/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam210/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam210/src/thermophysicalModels/basicSolidThermo/lnInclude -I/opt/openfoam210/src/turbulenceModels/compressible/turbulenceModel/lnInclude -I/opt/openfoam210/src/thermophysicalModels/radiationModels/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/solidRegionDiffNo.o
SOURCE=chtMultiRegionFoam_Epta.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -Ifluid -Isolid -Iinclude -I/opt/openfoam210/src/meshTools/lnInclude -I/opt/openfoam210/src/finiteVolume/lnInclude -I/opt/openfoam210/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam210/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam210/src/thermophysicalModels/basicSolidThermo/lnInclude -I/opt/openfoam210/src/turbulenceModels/compressible/turbulenceModel/lnInclude -I/opt/openfoam210/src/thermophysicalModels/radiationModels/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/chtMultiRegionFoam_Epta.o
In file included from chtMultiRegionFoam_Epta.C:65:
solid/setRegionSolidFields.H: In function ‘int main(int, char**)’:
solid/setRegionSolidFields.H:1: warning: unused variable ‘mesh’
solid/setRegionSolidFields.H:15: warning: unused variable ‘T’
In file included from chtMultiRegionFoam_Epta.C:77:
solid/setRegionSolidFields.H:1: warning: unused variable ‘mesh’
solid/setRegionSolidFields.H:15: warning: unused variable ‘T’
fluid/setRegionFluidFields.H:1: warning: unused variable ‘mesh’
fluid/setRegionFluidFields.H:5: warning: unused variable ‘kappa’
fluid/setRegionFluidFields.H:6: warning: unused variable ‘U’
fluid/setRegionFluidFields.H:7: warning: unused variable ‘phi’
fluid/setRegionFluidFields.H:9: warning: unused variable ‘turb’
fluid/setRegionFluidFields.H:10: warning: unused variable ‘K’
fluid/setRegionFluidFields.H:11: warning: unused variable ‘dpdt’
fluid/setRegionFluidFields.H:13: warning: unused variable ‘p’
fluid/setRegionFluidFields.H:14: warning: unused variable ‘psi’
fluid/setRegionFluidFields.H:15: warning: unused variable ‘h’
fluid/setRegionFluidFields.H:18: warning: unused variable ‘gh’
fluid/setRegionFluidFields.H:19: warning: unused variable ‘ghf’
fluid/setRegionFluidFields.H:21: warning: unused variable ‘rad’
In file included from chtMultiRegionFoam_Epta.C:114:
solid/solveSolid.H:13: error: ‘Q’ was not declared in this scope
make: *** [Make/linux64GccDPOpt/chtMultiRegionFoam_Epta.o] Error 1
Could anyone help?

Thanks a lot,
Samuele

PS: I'd like to do the same in the fluid regions. Is there a similar way to do this?
samiam1000 is offline   Reply With Quote

Old   June 22, 2012, 06:44
Default
  #2
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 15
Linse is on a distinguished road
Hi Samuele!

I don't know for sure if it is the same case for you. But I think when I first tried to include an additional field within chtMultiRegionFoam, I had to adapt also the setRegionSolidFields.H in the solid region...

Maybe it is the same for you?

Hope that helps a bit...

Cheers,
Bernhard
Linse is offline   Reply With Quote

Old   June 22, 2012, 06:56
Default
  #3
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
Thanks Bernhard,

yeah, maybe it is the same.

I'll worlk on it.

BTW, first of all I'd like to ask you if you have an idea about how to add a source to the buoyantPimpleFoam solver. I succeded in editing the buoyantSimpleFoam, but when I work on the buoyantPimpleFoam I get an error.

Could you have a look here?

Thanks,
Samuele
samiam1000 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
[swak4Foam] swak4Foam-groovyBC build problem zxj160 OpenFOAM Community Contributions 18 July 30, 2013 14:14
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 11:57
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51


All times are GMT -4. The time now is 00:55.