|
[Sponsors] |
conjugateHeatFoam with arbitrary number of region |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Senior Member
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23 ![]() |
Hello all,
is there anyone which has a conjugateHeatFoam version modified in such a way that an arbitrary number of solid and fluid regions are allowed? I need something like chtMultiRegionFoam which includes features of conjugateHeatFoam... Thank you! mad |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
babak kamkari
Join Date: Dec 2010
Posts: 26
Rep Power: 15 ![]() |
Hi mad
I am currently working with conjugateHeatFoam but with two regions, solid and fluid. You could have two solid parts simply by selecting velocity equal to zero. I have to add that if you want to calculate the gradient of a variable on the interface (coupled boundry) you will face with problem. For more information about this defect have look to the following link: http://www.cfd-online.com/Forums/ope...6-ext.htmlBest Best Regards |
|
![]() |
![]() |
![]() |
![]() |
#3 | |
Senior Member
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23 ![]() |
Quote:
![]() mad |
||
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19 ![]() |
The hardest part when adding more than 2 regions is just editing attachPatches.H. Here's an example for 3 regions:
Code:
{ const polyPatchList& patches = mesh1.boundaryMesh(); forAll (patches, patchI) { if (isType<regionCouplePolyPatch>(patches[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights mesh1.surfaceInterpolation::movePoints(); const polyPatchList& patches1 = mesh2.boundaryMesh(); forAll (patches1, patchI) { if (isType<regionCouplePolyPatch>(patches1[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches1[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights mesh2.surfaceInterpolation::movePoints(); const polyPatchList& patches2 = mesh3.boundaryMesh(); forAll (patches2, patchI) { if (isType<regionCouplePolyPatch>(patches2[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches2[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights mesh3.surfaceInterpolation::movePoints(); } After this, all you have to do is make sure you have the right directory structure. |
|
![]() |
![]() |
![]() |
![]() |
#5 | |
Senior Member
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23 ![]() |
Hello,
I am still planning how to make conjugateHeatFoam adjustable for an arbitrary number of regions. unfortunately I cannot work on the subject in a continuous way ![]() According to what Henrik said on 2009 here: Quote:
mad |
||
![]() |
![]() |
![]() |
![]() |
#6 |
New Member
Helmut Roth
Join Date: Mar 2009
Posts: 23
Rep Power: 17 ![]() |
Hi Mad,
Have your questions been answered? I borrowed some ideas from chtMultiRegionFoam and created pointerLists to my regions. In my master case constant directory I have a regionProperties file listing my fluid and solid region names. See for example $FOAM_TUTORIALS//heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/regionProperties My createSolidMeshes.H looks like this: forAll(rp.solidRegionNames(), i) { Info<< "Create solid mesh for region " << rp.solidRegionNames()[i] << " for time = " << runTime.timeName() << nl << endl; solidRegions.set ( i, new fvMesh ( IOobject ( rp.solidRegionNames()[i], runTime.timeName(), runTime, IOobject::MUST_READ ) ) ); } Similarly for the fluid meshes. In attachPatches.H I have for the solid side: // solid regions forAll(solidRegions, i) { //Info<< "attaching patches for solid region i =" << i << endl; const polyPatchList& patches = solidRegions[i].boundaryMesh(); forAll (patches, patchI) { if (isType<regionCouplePolyPatch>(patches[patchI])) { const regionCouplePolyPatch& rcp = refCast<const regionCouplePolyPatch>(patches[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights //mesh.surfaceInterpolation::movePoints(); solidRegions[i].surfaceInterpolation::movePoints(); } Similarly for the fluid side |
|
![]() |
![]() |
![]() |
![]() |
#7 | |
New Member
Hailong
Join Date: Sep 2019
Posts: 8
Rep Power: 6 ![]() |
Quote:
I modified my code like your method, but the error occurred when I compile it Code:
In file included from conjugateHeatMulSimpleFoam.C(56): createSolidFields.H(37): error: a reference of type "Foam::Istream &" (not const-qualified) cannot be initialized with a value of type "Foam::fvMesh" thermalModel::New(solidRegions[i]) ^ In file included from conjugateHeatMulSimpleFoam.C(56): createSolidFields.H(34): error: no instance of overloaded function "Foam::PtrList<T>::set [with T=Foam::thermalModel]" matches the argument list In file included from conjugateHeatMulSimpleFoam.C(56): argument types are: (Foam::label, Foam::autoPtr<Foam::dictionary>) In file included from conjugateHeatMulSimpleFoam.C(56): object type is: Foam::PtrList<Foam::thermalModel> In file included from conjugateHeatMulSimpleFoam.C(56): solidThermo.set ^ conjugateHeatMulSimpleFoam.C(87): error: class "Foam::PtrList<Foam::thermalModel>" has no member "correct" solidThermo.correct(); ^ conjugateHeatMulSimpleFoam.C(88): error: identifier "ksolid" is undefined ksolid = solidThermo.k(); ^ conjugateHeatMulSimpleFoam.C(88): error: class "Foam::PtrList<Foam::thermalModel>" has no member "k" ksolid = solidThermo.k(); ^ conjugateHeatMulSimpleFoam.C(97): error: no instance of overloaded function "Foam::fvc::interpolate" matches the argument list argument types are: (<error-type>) surfaceScalarField ksolidf = fvc::interpolate(ksolid); ^ conjugateHeatMulSimpleFoam.C(98): error: class "Foam::PtrList<Foam::thermalModel>" has no member "modifyResistance" solidThermo.modifyResistance(ksolidf); ^ In file included from solveEnergy.H(3), from conjugateHeatMulSimpleFoam.C(100): readSolidControls.H(1): error: identifier "solidMesh" is undefined const dictionary& simple = solidMesh.solutionDict().subDict("SIMPLE"); ^ In file included from conjugateHeatMulSimpleFoam.C(100): solveEnergy.H(29): error: identifier "Tsolid" is undefined - fvm::laplacian(ksolidf, Tsolid, "laplacian(k,T)") ^ In file included from conjugateHeatMulSimpleFoam.C(100): solveEnergy.H(29): error: no instance of overloaded function "Foam::fvm::laplacian" matches the argument list In file included from conjugateHeatMulSimpleFoam.C(100): argument types are: (Foam::surfaceScalarField, <error-type>, const char [15]) In file included from conjugateHeatMulSimpleFoam.C(100): - fvm::laplacian(ksolidf, Tsolid, "laplacian(k,T)") ^ In file included from conjugateHeatMulSimpleFoam.C(100): solveEnergy.H(30): error: class "Foam::PtrList<Foam::thermalModel>" has no member "S" + fvm::SuSp(-solidThermo.S()/Tsolid, Tsolid) ^ In file included from conjugateHeatMulSimpleFoam.C(100): solveEnergy.H(30): error: no instance of overloaded function "Foam::fvm::SuSp" matches the argument list In file included from conjugateHeatMulSimpleFoam.C(100): argument types are: (<error-type>, <error-type>) In file included from conjugateHeatMulSimpleFoam.C(100): + fvm::SuSp(-solidThermo.S()/Tsolid, Tsolid) ^ compilation aborted for conjugateHeatMulSimpleFoam.C (code 2) Code:
PtrList<thermalModel> solidThermo(solidRegions.size()); PtrList<volScalarField> Ts(solidRegions.size()); PtrList<volScalarField> ks(solidRegions.size()); forAll(solidRegions, i) { Info<< "*** Reading solid mesh thermophysical properties for region " << solidRegions[i].name() << nl << endl; Info<< "Reading field Tsolid\n" << endl; Ts.set ( i, new volScalarField ( IOobject ( "T", runTime.timeName(), //solidMesh, solidRegions[i], IOobject::MUST_READ, IOobject::AUTO_WRITE ), //solidMesh solidRegions[i] ) ); Info<< "Reading solid thermal properties" << endl; solidThermo.set ( i, thermalModel::New(solidRegions[i]) ); Info<< "Reading solid diffusivity k\n" << endl; ks.set ( i, new volScalarField ( IOobject ( "k", runTime.timeName(), //solidMesh, solidRegions[i], IOobject::MUST_READ, IOobject::AUTO_WRITE ), //solidMesh solidRegions[i] ) ); } |
||
![]() |
![]() |
![]() |
![]() |
#8 | |
New Member
Hailong
Join Date: Sep 2019
Posts: 8
Rep Power: 6 ![]() |
Quote:
Do you modified the solver fot n solids? I've been doing this lately, but I've had some difficulties, can you give some suggstion? |
||
![]() |
![]() |
![]() |
Tags |
conjugateheatfoam, multiple regions |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
DecomposePar unequal number of shared faces | maka | OpenFOAM Pre-Processing | 6 | August 12, 2010 09:01 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 07:36 |
Smooth Grid Error! Help | seasoul | FLUENT | 1 | March 24, 2008 10:56 |
Stanton Number and Arbitrary Surface Temperature | Boris Vaisman | Main CFD Forum | 1 | March 9, 2006 04:43 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 08:19 |