|
[Sponsors] |
Indentify internal field value at specific patch |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 11, 2013, 18:18 |
Indentify internal field value at specific patch
|
#1 |
New Member
Giancarlo
Join Date: Apr 2013
Location: Milan
Posts: 21
Rep Power: 13 |
Hi guys,
I have a patch named "fluid_to solid" in my mesh. In order to copy the values of a field in correspondence to this specific field I have written the following code: Code:
forAll( TFluid[j].boundaryField(), patchi) { label patchID = fluidRegions[j].boundaryMesh().findPatchID("fluid_to_solid"); forAll( TFluid[j].boundaryField()[patchID], facei) { Tf[facei+1] = TFluid[j].boundaryField()[patchID][facei]; } } My problem now is copy the internal values of the same field at the patch "fluid_to_solid"... Can anyone help me? Best Giancarlo |
|
April 13, 2013, 14:54 |
|
#2 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
i need to do such work.i didn't grasp.what does this code do exactly? And where in code should it be added?(i use rhoPimpleFoam)
Thanks. |
|
April 13, 2013, 21:05 |
|
#3 |
New Member
Giancarlo
Join Date: Apr 2013
Location: Milan
Posts: 21
Rep Power: 13 |
This is my solver that I have developed. I need to know the value of internalField only of the cells located at interface. (named "fluid_to_solid")
|
|
April 13, 2013, 21:28 |
|
#4 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22 |
Hi Giancarlo,
I hope this is what you were looking for. Once you have the right patchID you can use something like: Code:
const fvPatchVectorField& Uw = U.boundaryField()[patchI]; forAll(Uw,faceI) { // The value inside the cell const scalar& Up = Uw.patchInternalField()[faceI]; } Cheers, L |
|
April 14, 2013, 05:47 |
|
#5 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Good morning,
As an alternative, you can also work with the faceCells in case you have access to the whole of the volume field. This goes something along these lines, and assume that you have a fvPatch called "patch". Code:
const polyPatch & pp = patch.patch(); const labelList & faceCells( pp.faceCells() ); forAll( faceCells, facei ) { // A bit of pseudo code myBoundaryField[facei] = someOperation<myVolumeField[faceCells[facei]]>; } Kind regards Niels |
|
April 14, 2013, 07:10 |
|
#6 |
New Member
Giancarlo
Join Date: Apr 2013
Location: Milan
Posts: 21
Rep Power: 13 |
Thanks all,
I have solved in this manner: Code:
const fvPatchList& patches = fluidRegions[j].boundary(); forAll(patches, patchI) { const fvPatch& cPatch = patches[patchI]; if(cPatch.name() == "fluid_to_solid") forAll(cPatch, celli) { Tf[celli+1] = TFluid[j].internalField()[celli]; } } Giancarlo |
|
April 16, 2013, 13:29 |
|
#7 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17 |
I use this kind of code, I don't know if it works for multi region mesh:
Code:
label patchWall = mesh.boundaryMesh().findPatchID("wall"); //patchID = id of the patch wall const fvPatch& cPatch = mesh.boundary()[patchWall]; forAll(cPatch, facei) //facei = id of the face { } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
mixerVesselAMI2D's mass is not balancing | sharonyue | OpenFOAM Running, Solving & CFD | 6 | June 10, 2013 10:34 |
error message | cuteapathy | CFX | 14 | March 20, 2012 07:45 |
[blockMesh] Cyclic BC's: Possible face ordering problem? (Channel flow) | sega | OpenFOAM Meshing & Mesh Conversion | 3 | September 28, 2010 13:46 |
chtMultiRegionFoam Tutorial | m.nichols19 | OpenFOAM | 12 | September 9, 2010 12:56 |