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

Map a field across patch between two meshes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 14, 2019, 21:58
Default Map a field across patch between two meshes
  #1
Member
 
Join Date: Mar 2019
Posts: 86
Rep Power: 7
celestial is on a distinguished road
Hi everybody

Either this will be obvious to most of you or else it will be baffling to all.
I have no idea and so I have to give it a shot.

Here is a short excerpt from my createFields.H :

.........


Info<< "Reading field Fa, Fs \n" << endl;

volScalarField Fa
(
IOobject
(
"Fa",
runTime.timeName(),
airMesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
airMesh
);

volScalarField Fs
(
IOobject
(
"Fs",
runTime.timeName(),
solidMesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
solidMesh
);

..........

and what follows is a relevant excerpt from my C code:



...............

// patch airsolid is defined in the case dictionaries polyMesh for both meshes //airMesh and solidMesh
// the two meshes were created independently of each other. They only share the common interface airsolid in the geometry


const label id1= airMesh.boundaryMesh().findPatchID"airsolid");
const fvPatch& patch1 = airMesh.boundary()[id1];


const label id2= solidMesh.boundaryMesh().findPatchID"airsolid");
const fvPatch& patch2 = solidMesh.boundary()[id2];




scalarField dummy(patch1.size(), scalar(0) );


forAll(patch1, i)
{

dummy[i] = Fa[patch1.faceCells()[i] ] - ????;


// the above line is my problem.
// by ???? I mean some kind of interpolation of the values on the solid side:

// Fs[patch2.faceCells()[j] ] where the values of j will depend on the // current value of i
// (of course, j lies in the range 0 to patch2.size)


}

............

The question is whether any such mapping actually exist in OF.


At any rate, best regards to the community regardless of what come out of this inquiry.
celestial is offline   Reply With Quote

Old   October 16, 2019, 12:17
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
Check out chtMultiRegionFoam -- this does multiple air/solid regions (that are coupled). The type of boundary condition necessary will depend on the field.

Caelan
clapointe is offline   Reply With Quote

Old   October 18, 2019, 11:45
Default
  #3
Member
 
Join Date: Mar 2019
Posts: 86
Rep Power: 7
celestial is on a distinguished road
Thanks but chtMultiRegionFoam coupling is about interpolating the boundary condition (so on the patch face) In fact, all interpolation schemes e.g. AMI, GGI, groovyBC, have dictionaries that deal with those patches.

I am solving a Poisson equation in say the air region given a potential value on the patch as well as the potential on the solid side on the adjacent cell. Swak4foam's groovyBC has a mapped function in the dictionary that I assume the solver implicitly invokes.

But to test for the solver's convergence, I need access to this adjacent cell potential even after the call to that solver.

So I am now thinking of applying routines found in GIInterpolationWeights.C ( foam-extend 4.0) ( which in essence gets the weights from the Sutherland-Hodgman algorithm on polygon intersections ) to this adjacent potential instead of to the patch face. I am currently trying to find code examples of calls to these routines. If anybody is familiar with them, that would be great.

Best regards to all
celestial 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get chtMultiRegionSimpleFoam to working. shiromaniac OpenFOAM Running, Solving & CFD 11 October 18, 2021 08:40
[Commercial meshers] Mesh conversion problem (fluent3DMeshToFoam) Aadhavan OpenFOAM Meshing & Mesh Conversion 2 March 8, 2018 01:47
''unknown radialModelType type Gidaspow'' PROBLEM WITH THE BED TUTORIAL AndoniBM OpenFOAM Running, Solving & CFD 2 March 25, 2015 18:44
[GAMBIT] periodic faces not matching Aadhavan ANSYS Meshing & Geometry 6 August 31, 2013 11:25
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 08:19


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