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

regionCouple in multiRegionFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 17, 2011, 11:33
Default regionCouple in multiRegionFoam
  #1
Senior Member
 
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20
mvoss is on a distinguished road
hi,

this is regarding a combination of the regionCouple BC and the chtMultiRegionFoam solver.
I am working on a new solver for mhd-application starting from the chtMultiregionFoam with its fields setup like
Code:
UFluid.set
            (
                    i,
                    new volVectorField
                    (
                        IOobject
                        (
                                "U",
                                runTime.timeName(),
                                fluidRegions[i],
                                IOobject::MUST_READ,
                                IOobject::AUTO_WRITE
                        ),
                        fluidRegions[i]
                     )
            );
so for the relevant variables (e.g. U) there are sets (the regions) and i end up with as many sets for the variables as i have regions... which is totally fine so far.
Typically you have scalar values like T passing from one region to the other while there is a need of BC to treat the "passing" (e.g. solidWallMixedTemperatureCoupled) which are also working in my case for the electricPotential (see the other posts here in the forum).
But how is it about vectorial values (like the electric Field j)?
At the "internal" BC for this values i need to specify smth. but actually one just wants the neighbor values being recognized. A zeroGradient isnīt working for absolutely logical reasons because even if the simulation is running nicely and converging... the regions arenīt interacting over the internalBC... letīs say they donīt see each other they are just zeroGradient. So this is half the way wrong...the Gradient needs to know about the value on "the other side".

So.
If i look at regionCouple: this is exactly what we need, the values are connected.
And hereīs the kicker: how can i initialize my fields like i do in chtMultiRegionFoam (one after another because of
Code:
forAll(fluidRegions, i)
    {..
}..
forAll(solidRegions, i)
    {...
}
) while the regionCouple wants to have the corresponding value for the shadowPatch at the same time??
Code:
Adding field J 



--> FOAM FATAL ERROR: 

    request for volScalarField Elpot from objectRegistry SOLID failed
    available objects of type volScalarField are

0
(
)
Combining multiple Regions like this is like a 1:1 GGI...
Hope you can get my point.
Looking forward for some thoughts on that.


Tanks in advance,

neewbie
mvoss is offline   Reply With Quote

Old   March 7, 2011, 14:02
Default
  #2
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 94
Rep Power: 17
cliffoi is on a distinguished road
The boundaries from chtMultiRegionFoam and the regionCouple boundaries both use harmonic interpolation at the boundary to preserve the flux at the boundary face. This doesn't necessarily make sense for vectors but provided you know how you want to treat the boundary you can create a custom vector boundary condition using these classes as examples.
To initialize all the fields without errors, remove the creation of your mapping and neighbour fields from the boundary constructors. This is done in regionCouple by storing names of neighbour patches, regions and fields rather than references to the patches, and then using an on-the-fly lookup for the neighbouring patch. The other option is to use pointers, e.g. for patchToPatchInterpolation, and only set the pointer when needed. The final thing... make sure you don't call correctBoundaryConditions() before all fields and meshes have been created.

Hope this helps
Ivor
cliffoi is offline   Reply With Quote

Old   August 9, 2024, 07:39
Default
  #3
New Member
 
Kaushal Jha
Join Date: Jul 2024
Location: IITMandi
Posts: 1
Rep Power: 0
WaRxChaMpioN892 is on a distinguished road
I am also facing a similar kind of problem, using chtMultiRegionFoam I am getting an error


--> FOAM FATAL ERROR: (openfoam-2406)

failed lookup of U (objectRegistry zoneone)
available objects of type volVectorField:
0()


I am using mappedMixed bboundary condition in all the interface patches but the problem arises only for U,

the error doesnt show up when i use backward mapping as an standard bc like fixedValue and mappedMixed for forward mapping at the interface. The simulation looks like transfering the data between the regions but I doubt its correctness.
I used a debugger and the problem stuck at in createFluidFields.H:

UEqFluid.set
(
i,
new fvVectorMatrix(UFluid[i], dimForce)
);


I also tried for the mappedFlowrate but then the error comes as



--> FOAM FATAL ERROR: (openfoam-2406)

failed lookup of phi (objectRegistry zoneone)
available objects of type surfaceScalarField:
0()






Also I wanna mention that how we have defined the regions in regionProperties file, will also cause the direction of the error. So my conclusion from my trials and error is that, somewhere the code for UEq is not able to lookup for multi-Region case, so the code for that need to be updated to also lookup for multi-region.



In the end I am new to openFoam programming so I am clueless what to do since debugger only takes me to the UEq.
Any help....
WaRxChaMpioN892 is offline   Reply With Quote

Reply


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



All times are GMT -4. The time now is 06:31.