|
[Sponsors] |
October 14, 2019, 22:58 |
Map a field across patch between two meshes
|
#1 |
Member
Join Date: Mar 2019
Posts: 86
Rep Power: 7 |
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. |
|
October 16, 2019, 13:17 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
Check out chtMultiRegionFoam -- this does multiple air/solid regions (that are coupled). The type of boundary condition necessary will depend on the field.
Caelan |
|
October 18, 2019, 12:45 |
|
#3 |
Member
Join Date: Mar 2019
Posts: 86
Rep Power: 7 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't get chtMultiRegionSimpleFoam to working. | shiromaniac | OpenFOAM Running, Solving & CFD | 11 | October 18, 2021 09:40 |
[Commercial meshers] Mesh conversion problem (fluent3DMeshToFoam) | Aadhavan | OpenFOAM Meshing & Mesh Conversion | 2 | March 8, 2018 02:47 |
''unknown radialModelType type Gidaspow'' PROBLEM WITH THE BED TUTORIAL | AndoniBM | OpenFOAM Running, Solving & CFD | 2 | March 25, 2015 19:44 |
[GAMBIT] periodic faces not matching | Aadhavan | ANSYS Meshing & Geometry | 6 | August 31, 2013 12:25 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |