CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM CC Toolkits for Fluid-Structure Interaction (https://www.cfd-online.com/Forums/openfoam-cc-toolkits-fluid-structure-interaction/)
-   -   [FSI] how develop nu() in icoFluid solver of fsiFoam (https://www.cfd-online.com/Forums/openfoam-cc-toolkits-fluid-structure-interaction/215893-how-develop-nu-icofluid-solver-fsifoam.html)

Hgholami March 20, 2019 10:53

how develop nu() in icoFluid solver of fsiFoam
 
Dear foamers
I want to add nu() as non-Newtonian fluid in icoFluid.
the problem is in here "part of icoFluid"
Quote:

tmp<scalarField> icoNonFluid::faceZoneMuEff
(
const label zoneID,
const label patchID
) const
{

tmp<scalarField> tMuEff
(
new scalarField
(
mesh().faceZones()[zoneID].size(),
rho_.value()*nu_.value() //Here
)
);

return tMuEff;

void icoNonFluid::evolve()
I want to change "nu_.value" with
Quote:

fluid_.nu().boundaryField()[patchID]
I add non-Newtonian fluid as fluid_(U_, phi_), then to call that I used fluid_nu.
the compiler give this error.
Quote:

fluidSolvers/icoNonFluid/icoNonFluid.C: In member function ‘virtual Foam::tmp<Foam::Field<double> > Foam::fluidSolvers::icoNonFluid::faceZoneMuEff(Foa m::label, Foam::label) const’:
fluidSolvers/icoNonFluid/icoNonFluid.C:285:9: error: no matching function for call to ‘Foam::Field<double>::Field(Foam::label, Foam::tmp<Foam::Field<double> >)’
)
^
Do you know what is the problem?
Thanks

Hgholami March 21, 2019 05:01

I replaced code with
Quote:

tmp<scalarField> icoNonFluid::faceZoneMuEff
(
const label zoneID,
const label patchID
) const
{
tmp<scalarField> tMuEff
(
new scalarField(mesh().boundary()[patchID].size(), 0)
);

tMuEff() = rho_.value()*fluid_.nu();

return tMuEff;

}
and problem is solved

Daniel_Khazaei March 21, 2019 05:49

Quote:

Originally Posted by Hgholami (Post 728437)
I replaced code with
and problem is solved

why not using pisoFluid at first place?

Hgholami March 21, 2019 08:00

Dear Khazaei
I used pisoFluid at first time, but have problem with converging. I change several time fvscheme and fvsolution, but nothing help to converge. May you know which configuration is good for pisoFluid?

Daniel_Khazaei March 23, 2019 09:37

Quote:

Originally Posted by Hgholami (Post 728464)
Dear Khazaei
I used pisoFluid at first time, but have problem with converging. I change several time fvscheme and fvsolution, but nothing help to converge. May you know which configuration is good for pisoFluid?

well it is not possible to guess why the simulation diverges without knowing what kind of simulation you are trying to run.

Hgholami March 23, 2019 10:43

It was study of Hron Turek (benchmark FSI2) that have problem with pisoFluid. But with icoFluid is good.

Daniel_Khazaei March 23, 2019 13:05

Quote:

Originally Posted by Hgholami (Post 728636)
It was study of Hron Turek (benchmark FSI2) that have problem with pisoFluid. But with icoFluid is good.


well I have already tested HronTurekFSI3 test case which should be much harder to converge without any problem using pisoFluid. Are you trying to model HronTurekFSI2 with non-Newtonian fluid?

if you are still using old fsi toolkit you need to know that the direction of the calculated viscous force is wrong and you need to correct it in pachViscousForce() function. Just multiply the calculated force by (-1).
This bug has already been patched in solids4Foam toolbox.

Hgholami March 23, 2019 23:52

Quote:

Originally Posted by Daniel_Khazaei (Post 728643)
well I have already tested HronTurekFSI3 test case which should be much harder to converge without any problem using pisoFluid. Are you trying to model HronTurekFSI2 with non-Newtonian fluid?

if you are still using old fsi toolkit you need to know that the direction of the calculated viscous force is wrong and you need to correct it in pachViscousForce() function. Just multiply the calculated force by (-1).
This bug has already been patched in solids4Foam toolbox.

The test was with newtonian fluid. In icofluid I see this code for pachViscousForce()
Quote:

//- Patch viscous force (N/m2)
tmp<vectorField> icoFluid::patchViscousForce(const label patchID) const
{
tmp<vectorField> tvF
(
new vectorField(mesh().boundary()[patchID].size(), vector::zero)
);

tvF() = rho_.value()*nu_.value()*U().boundaryField()[patchID].snGrad();

vectorField n = mesh().boundary()[patchID].nf();
tvF() -= n*(n&tvF());

return tvF;
}
that neglected in pisoFluid
Quote:

//- Patch viscous force (N/m2)
tmp<vectorField> pisoFluid::patchViscousForce(const label patchID) const
{
tmp<vectorField> tvF
(
new vectorField(mesh().boundary()[patchID].size(), vector::zero)
);

tvF() =
rho_.value()
*(
mesh().boundary()[patchID].nf()
& turbulence_->devReff()().boundaryField()[patchID]
);

// vectorField n = mesh().boundary()[patchID].nf();
// tvF() -= n*(n&tvF());

return tvF;
}
As your recommendation, I think you mention this
Quote:

// vectorField n = mesh().boundary()[patchID].nf();
// tvF() -= n*(n&tvF());
must add to pisoFluid code and the icoFluid is correct. Is it true?
Your recommend is very helpful. Thanks.

Daniel_Khazaei March 24, 2019 02:15

Quote:

Originally Posted by Hgholami (Post 728656)
The test was with newtonian fluid. In icofluid I see this code for pachViscousForce()

that neglected in pisoFluid

As your recommendation, I think you mention this must add to pisoFluid code and the icoFluid is correct. Is it true?
Your recommend is very helpful. Thanks.

no, just use the following code:

Code:

tmp<vectorField> pisoFluid::patchViscousForce(constlabelpatchID)const
{
    tmp<vectorField> tvF
      (
        new vectorField(mesh().boundary()[patchID].size(), vector::zero)
      );

    tvF() =
          rho_.value()
          *(
                  mesh().boundary()[patchID].nf()
              & (-turbulence_->devReff()().boundaryField()[patchID])
            );

    return tvF;
}

these lines in pisoFluid
Code:

//vectorField n = mesh().boundary()[patchID].nf();
//tvF() -= n*(n&tvF());

are commented out because we have already used face normal or nf() function during the calculation of tvF() which was not the case with icoFluid.

Hgholami March 24, 2019 15:33

Thanks for your note. I modify the code. So, do you have any proper fvscheme and fvsolution for tutorial of hron&Turek?

Daniel_Khazaei March 25, 2019 04:18

Quote:

Originally Posted by Hgholami (Post 728700)
Thanks for your note. I modify the code. So, do you have any proper fvscheme and fvsolution for tutorial of hron&Turek?


I haven't used any special changes in fvScheme or fvSolution. The same case should easily work with pisoFluid...I have just modified it to work with pisoFluid.


All times are GMT -4. The time now is 19:46.