CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions > OpenFOAM CC Toolkits for Fluid-Structure Interaction

[FSI] how develop nu() in icoFluid solver of fsiFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By Daniel_Khazaei
  • 1 Post By Daniel_Khazaei

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 20, 2019, 11:53
Default how develop nu() in icoFluid solver of fsiFoam
  #1
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7
Hgholami is on a distinguished road
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 is offline   Reply With Quote

Old   March 21, 2019, 06:01
Default
  #2
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7
Hgholami is on a distinguished road
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
Hgholami is offline   Reply With Quote

Old   March 21, 2019, 06:49
Default
  #3
Senior Member
 
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21
Daniel_Khazaei will become famous soon enough
Quote:
Originally Posted by Hgholami View Post
I replaced code with
and problem is solved
why not using pisoFluid at first place?
Daniel_Khazaei is offline   Reply With Quote

Old   March 21, 2019, 09:00
Default
  #4
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7
Hgholami is on a distinguished road
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?
Hgholami is offline   Reply With Quote

Old   March 23, 2019, 10:37
Default
  #5
Senior Member
 
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21
Daniel_Khazaei will become famous soon enough
Quote:
Originally Posted by Hgholami View Post
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.
Daniel_Khazaei is offline   Reply With Quote

Old   March 23, 2019, 11:43
Default
  #6
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7
Hgholami is on a distinguished road
It was study of Hron Turek (benchmark FSI2) that have problem with pisoFluid. But with icoFluid is good.
Hgholami is offline   Reply With Quote

Old   March 23, 2019, 14:05
Default
  #7
Senior Member
 
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21
Daniel_Khazaei will become famous soon enough
Quote:
Originally Posted by Hgholami View Post
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.
bigphil and Hgholami like this.
Daniel_Khazaei is offline   Reply With Quote

Old   March 24, 2019, 00:52
Default
  #8
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7
Hgholami is on a distinguished road
Quote:
Originally Posted by Daniel_Khazaei View Post
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.
Hgholami is offline   Reply With Quote

Old   March 24, 2019, 03:15
Default
  #9
Senior Member
 
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21
Daniel_Khazaei will become famous soon enough
Quote:
Originally Posted by Hgholami View Post
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 likes this.
Daniel_Khazaei is offline   Reply With Quote

Old   March 24, 2019, 16:33
Default
  #10
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7
Hgholami is on a distinguished road
Thanks for your note. I modify the code. So, do you have any proper fvscheme and fvsolution for tutorial of hron&Turek?
Hgholami is offline   Reply With Quote

Old   March 25, 2019, 05:18
Default
  #11
Senior Member
 
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21
Daniel_Khazaei will become famous soon enough
Quote:
Originally Posted by Hgholami View Post
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.
Daniel_Khazaei is offline   Reply With Quote

Reply

Tags
fsifoam, non-newtonian


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
[ANSYS Meshing] Help with element size sandri_92 ANSYS Meshing & Geometry 14 November 14, 2018 08:54
Creating New Solver: For particle-laden compressible jets sankarv OpenFOAM 0 April 4, 2010 19:06
why the solver reject it? Anyone with experience? bearcat CFX 6 April 28, 2008 15:08
Did someone develop a CIP solver tachioka OpenFOAM Running, Solving & CFD 0 October 10, 2007 11:17
Setting a B.C using UserFortran in 4.3 tokai CFX 10 July 17, 2001 17:25


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