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

given field does not correspond to patch !!

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools 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: 4
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, 10:01
Default
  #2
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 5
styleworker is on a distinguished road
Have you solved the problem?
styleworker is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CGNS converters available mbeaudoin OpenFOAM Meshing & Mesh Conversion 125 July 1, 2015 21:09
[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
Fluent3DMeshToFoam simvun OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 48 May 14, 2012 05:20
chtMultiRegionFoam Tutorial m.nichols19 OpenFOAM 12 September 9, 2010 11:56


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