CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] reconstructPar error in MRFsimpleFoam (ami apprach) using GroovyBC velocity inlet (https://www.cfd-online.com/Forums/openfoam-community-contributions/219889-reconstructpar-error-mrfsimplefoam-ami-apprach-using-groovybc-velocity-inlet.html)

Krao August 13, 2019 11:07

reconstructPar error in MRFsimpleFoam (ami apprach) using GroovyBC velocity inlet
 
Hi Dear Foam users,

I am simulating propeller with MRFSimpleFoam using AMI. So far the simulation results and convergence are satisfactory and the forces are close to the analytical results.

I wanted to simulate a second propeller in the slipstream of the first propeller. Since changing MRF region size affected the results significantly, I was forced to simulate the two propellers separately. As I have to reproduce the slipstream of first propeller at the inlet of the second propeller, I have used groovyBC from swak4foam to generate the inlet swirl. Again the simulation went very well and the convergence of forces was great. But when I started to reconstruct the result to start these simulation with more powerful PC I got the following error

Quote:

Reconstructing fields for mesh region0

Time = 0.02

Reconstructing FV fields

Reconstructing volScalarFields

p
nut
k
omega

Reconstructing volVectorFields

U
AMI: Creating addressing and weights between 3544 source faces and 4276 target faces
AMI: Patch source sum(weights) min/max/average = 0.883736, 1.0012, 0.99758
AMI: Patch target sum(weights) min/max/average = 0, 1.00088, 0.870331
AMI: Creating addressing and weights between 388 source faces and 3245 target faces


--> FOAM FATAL ERROR:

Unable to set source and target faces

From function void Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::setNextFaces(Foam::label&, Foam::label&, Foam::label&, const boolList&, Foam::labelList&, const Foam::DynamicList<int>&, bool) const [with SourcePatch = Foam::PrimitivePatch<Foam::face, Foam::SubList, const Foam::Field<Foam::Vector<double> >&>; TargetPatch = Foam::PrimitivePatch<Foam::face, Foam::SubList, const Foam::Field<Foam::Vector<double> >&>; Foam::label = int; Foam::boolList = Foam::List<bool>; Foam::labelList = Foam::List<int>]
in file lnInclude/faceAreaWeightAMI.C at line 292.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::faceAreaWeightAMI<Foam::PrimitivePatch<Foam: :face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> >, Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > >::calcAddressing(Foam::List<Foam::DynamicList<int , 0u, 2u, 1u> >&, Foam::List<Foam::DynamicList<double, 0u, 2u, 1u> >&, Foam::List<Foam::DynamicList<int, 0u, 2u, 1u> >&, Foam::List<Foam::DynamicList<double, 0u, 2u, 1u> >&, int, int) at ??:?
#3 Foam::faceAreaWeightAMI<Foam::PrimitivePatch<Foam: :face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> >, Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > >::calculate(Foam::List<Foam::List<int> >&, Foam::List<Foam::List<double> >&, Foam::List<Foam::List<int> >&, Foam::List<Foam::List<double> >&, int, int) at ??:?
#4 Foam::AMIInterpolation<Foam::PrimitivePatch<Foam:: face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> >, Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > >::update(Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > const&, Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > const&, bool) at ??:?
#5 Foam::AMIInterpolation<Foam::PrimitivePatch<Foam:: face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> >, Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > >::constructFromSurface(Foam::PrimitivePatch<Foam: :face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > const&, Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > const&, Foam::autoPtr<Foam::searchableSurface> const&, bool) at ??:?
#6 Foam::cyclicAMIPolyPatch::resetAMI() const at ??:?
#7 Foam::cyclicAMIPolyPatch::AMIs() const at ??:?
#8 Foam::tmp<Foam::Field<double> > Foam::cyclicAMIPolyPatch::interpolate<double>(Foam ::Field<double> const&, Foam::UList<double> const&) const at ??:?
#9 Foam::cyclicAMIFvPatch::nbrDeltan() const at ??:?
#10 Foam::cyclicAMIFvPatch::makeWeights(Foam::Field<do uble>&) const at ??:?
#11 Foam::surfaceInterpolation::makeWeights() const at ??:?
#12 Foam::surfaceInterpolation::weights() const at ??:?
#13 Foam::surfaceInterpolation::makeDeltaCoeffs() const at ??:?
#14 Foam::surfaceInterpolation::deltaCoeffs() const at ??:?
#15 Foam::fvPatch::deltaCoeffs() const at ??:?
#16 Foam::groovyBCFvPatchField<Foam::Vector<double> >::groovyBCFvPatchField(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#17 Foam::fvPatchField<Foam::Vector<double> >::adddictionaryConstructorToTable<Foam::groovyBCF vPatchField<Foam::Vector<double> > >::New(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#18 Foam::fvPatchField<Foam::Vector<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#19 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::Boundary::readField(Foam::Dimensio nedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#20 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readFields(Foam::dictionary const&) in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#21 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readFields() in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#22 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#23 ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#24 ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#25 ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#26 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#27 ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
Aborted (core dumped)
As it can be clearly observed, as per my understanding the error is stating that the AMI weights are going to zero. But I have double checked during decomposition and solving the AMI weights are normal as shown below

Quote:

AMI: Creating addressing and weights between 151942 source faces and 9229 target faces
AMI: Patch source sum(weights) min/max/average = 0.967284, 1.33993, 0.999878
AMI: Patch target sum(weights) min/max/average = 0.989309, 1.07397, 1.00007
AMI: Creating addressing and weights between 7129 source faces and 7521 target faces
AMI: Patch source sum(weights) min/max/average = 0.999682, 1.00121, 1
AMI: Patch target sum(weights) min/max/average = 0.984372, 1.00089, 0.999992
AMI: Creating addressing and weights between 18870 source faces and 19132 target faces
AMI: Patch source sum(weights) min/max/average = 0.999615, 1, 1
AMI: Patch target sum(weights) min/max/average = 0.9995, 1, 1
Reading/calculating face flux field phi
The error is occurring only during the simulation with groovyBC. In all other cases the simulation is running fine. Should I considering other decomposition approach than scotch? It would be very great if anyone can give me some useful insight to avoid these errors. Also, I would be open for other ideas as well regarding MRF region size also and how to overcome that difficulty also. Thank you in advance.

Krao

Krao August 16, 2019 05:32

Update
 
my groovyBC as follows for the swirly inlet with linearly varying flow. It would be great if I can get any expert advise on the following logic also, thank you.

boundaryField
{
inlet
{
type groovyBC;
variables
(
"yp=pos().y;"
"xp=pos().x;"
"r=sqrt(pow(xp,2)+pow(yp,2));"
"theta=atan(yp/xp);"
"omegaa=466;"
"U_t=(r<0.226)?(omegaa*r):0;"
"U_tx=U_t*sin(theta);"
"U_ty=U_t*cos(theta);"
"R=0.225;"
"U1=-5.99;"
"U_az=(r<0.226)?((r>0.208)?(U1*(4.413-3.413*(r/R))):-7.44):0;"
);
valueExpression "vector ( U_tx, U_ty, U_az )";
value uniform (0 0 0);
}
}

Krao

gschaider August 19, 2019 04:56

Quote:

Originally Posted by Krao (Post 741986)
Hi Dear Foam users,

I am simulating propeller with MRFSimpleFoam using AMI. So far the simulation results and convergence are satisfactory and the forces are close to the analytical results.

I wanted to simulate a second propeller in the slipstream of the first propeller. Since changing MRF region size affected the results significantly, I was forced to simulate the two propellers separately. As I have to reproduce the slipstream of first propeller at the inlet of the second propeller, I have used groovyBC from swak4foam to generate the inlet swirl. Again the simulation went very well and the convergence of forces was great. But when I started to reconstruct the result to start these simulation with more powerful PC I got the following error



As it can be clearly observed, as per my understanding the error is stating that the AMI weights are going to zero. But I have double checked during decomposition and solving the AMI weights are normal as shown below



The error is occurring only during the simulation with groovyBC. In all other cases the simulation is running fine. Should I considering other decomposition approach than scotch? It would be very great if anyone can give me some useful insight to avoid these errors. Also, I would be open for other ideas as well regarding MRF region size also and how to overcome that difficulty also. Thank you in advance.

Krao

Mixing AMI and a boundary condition that tries to manipulate a value there can be challenging


The problem here seems to be that groovyBC tries to compute deltaCoeffs to apply a potential gradient value and AMI does not know how to compute the deltaCoeffs because it usually doesn't know it. You might be able to work around this by replacing groovyBC with groovyBCFixedValue but I can't guarantee that it will work


Good luck

Krao August 19, 2019 05:40

Dear Mr. Bernhard Gschaider,

Quote:

Originally Posted by gschaider (Post 742374)
Mixing AMI and a boundary condition that tries to manipulate a value there can be challenging


The problem here seems to be that groovyBC tries to compute deltaCoeffs to apply a potential gradient value and AMI does not know how to compute the deltaCoeffs because it usually doesn't know it. You might be able to work around this by replacing groovyBC with groovyBCFixedValue but I can't guarantee that it will work


Good luck

Thank you very much for your detailed answer and inputs. I will implement the new value and I will update my findings in the thread.

Kind regards,

Krao


The problem is solved with the above mentioned procedure


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