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

given field does not correspond to patch !!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 16, 2013, 14:55
Default given field does not correspond to patch !!
  #1
Member
 
Samer
Join Date: Jan 2013
Posts: 31
Rep Power: 13
SamerAli is on a distinguished road
Dear All

I am trying to set heat flux at the interface of each coupled fluid-solid region:

{
Info << "Setting Heat Flux on solid patch" << endl;



forAll (fluidpatchesNames,s)
{
word fluidPatchName=fluidpatchesNames[s];
word solidPatchName=solidpatchesNames[s];
word fluidZoneName=fluidzonesNames[s];
word solidZoneName=solidzonesNames[s];
Info<<"fluidZoneName "<<fluidZoneName<<endl;
Info<<"solidZoneName "<<solidZoneName<<endl;


label solidPatchID
(
stressMesh.boundaryMesh().findPatchID(solidPatchNa me)
);

Info<<solidPatchID<<endl;

HeatFluxFvPatchScalarField& Heat=
refCast<HeatFluxFvPatchScalarField>
(
Ts.boundaryField()[solidPatchID]
);

if (solidPatchID < 0)
{
FatalErrorIn(args.executable())
<< "Problem with finding solid patch"
<< abort(FatalError);
}

label solidZoneID =
stressMesh.faceZones().findZoneID(solidZoneName);

Info<<solidZoneID<<endl;

if (solidZoneID < 0)
{
FatalErrorIn(args.executable())
<< "Problem with finding solid zone"
<< abort(FatalError);
}

label fluidPatchID =
mesh.boundaryMesh().findPatchID(fluidPatchName);

Info<<fluidPatchID<<endl;

if (fluidPatchID < 0)
{
FatalErrorIn(args.executable())
<< "Problem with finding fluid patch"
<< abort(FatalError);
}

label fluidZoneID =
mesh.faceZones().findZoneID(fluidZoneName);

Info<<fluidZoneID<<endl;

if (fluidZoneID < 0)
{
FatalErrorIn(args.executable())
<< "Problem with finding fluid zone"
<< abort(FatalError);
}


scalarField fluidPatchHeatFlux=
kF.value()*Tf.boundaryField()[fluidPatchID].snGrad();


scalarField fluidZoneHeatFlux
(
mesh.faceZones()[fluidZoneID].size(),
0.0
);

label fluidPatchStart =
mesh.boundaryMesh()[fluidPatchID].start();

Info<<fluidPatchStart<<endl;

forAll(fluidPatchHeatFlux, i)
{
fluidZoneHeatFlux
[
mesh.faceZones()[fluidZoneID].whichFace(fluidPatchStart + i)
] =
fluidPatchHeatFlux[i];
}

Info<<"TEST"<<endl;

// Parallel data exchange: collect heat flux field on all processors
reduce(fluidZoneHeatFlux, sumOp<scalarField>());

Info<<"TEST2"<<endl;
scalarField solidZoneHeatFlux =
interpolatorFluidSolid.faceInterpolate
(
fluidZoneHeatFlux
);

Info<<"Flag"<<endl;

label solidPatchStart =
stressMesh.boundaryMesh()[solidPatchID].start();

Info<<solidPatchStart<<endl;

forAll(solidPatchHeatFlux, i)
{
solidPatchHeatFlux[i] =
solidZoneHeatFlux
[
stressMesh.faceZones()[solidZoneID]
.whichFace(solidPatchStart + i)
];
}


Heat.HeatFlux()=solidPatchHeatFlux;

scalar totalHeatFlux =
gSum
(
solidPatchHeatFlux
*stressMesh.magSf().boundaryField()[solidPatchID]
);

Info << "Total HeatFlux on "<<solidPatchName<<" "
<< totalHeatFlux << endl;


}

}

but when i run my simulation all i get is the following error:
--> FOAM FATAL ERROR:
given field does not correspond to patch. Patch size: 225 field size: 150

From function PatchToPatchInterpolation::faceInterpolate(const Field<Type> ff)

can anyone help?

Thank you in advance
SamerAli is offline   Reply With Quote

Old   November 27, 2013, 09:01
Default
  #2
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 14
styleworker is on a distinguished road
Have you solved the problem?
styleworker 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
[Commercial meshers] Fluent3DMeshToFoam simvun OpenFOAM Meshing & Mesh Conversion 50 January 19, 2020 15:33
[CGNS] CGNS converters available mbeaudoin OpenFOAM Meshing & Mesh Conversion 137 December 14, 2018 04:20
[GAMBIT] periodic faces not matching Aadhavan ANSYS Meshing & Geometry 6 August 31, 2013 11:25
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 09:34
chtMultiRegionFoam Tutorial m.nichols19 OpenFOAM 12 September 9, 2010 11:56


All times are GMT -4. The time now is 13:34.