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

how to use the fixedShearStress BC?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 26, 2013, 09:46
Default how to use the fixedShearStress BC?
  #1
New Member
 
zdong
Join Date: Aug 2011
Posts: 15
Rep Power: 15
abbott.hn is on a distinguished road
when try to use the fixedShearStress bc at the top boundary of my domain for U to simulate the atmosphere boundary layer, OpenFOAM gave me an error.

then I changed the type of 0/U at the top boundary to dummy to see the available bc types, there was no fixedshearStress keywords in the output log at all, however, i'm sure my OpenFOAM 2.2.0 was installed correctly and it got the source and head files for fixedShearStress BC class in the right path.

then i searched this forum , there were some related posts from here:

http://www.cfd-online.com/Forums/ope...y-layer-2.html

it's like this :

surface
{
type fixedShearStress;
tau (0.0001 0 0);
}

but nothing was helpful to my 2.2.0 OpenFOAM.

could any one help me out of this? Thanks in advance.
abbott.hn is offline   Reply With Quote

Old   November 27, 2013, 20:41
Default
  #2
New Member
 
zdong
Join Date: Aug 2011
Posts: 15
Rep Power: 15
abbott.hn is on a distinguished road
what's going on ? waiting for all of your reply
abbott.hn is offline   Reply With Quote

Old   April 9, 2014, 20:49
Default
  #3
Member
 
Join Date: Jul 2010
Posts: 52
Rep Power: 16
MaryBau is on a distinguished road
Hi zdong;

It might be a bit to late to answer your questions but….

To use the fixedShearStress boundary condition you need to add this on your controlDict:

libs("libturbulenceDerivedFvPatchFields.so")

Just be aware that the code is not the same as in OFv1.7.x. I just had a quick look at the differences between OFv2.2.2 and and OFv1.7.x. But in the new version it requires "rho" as an input. So I assume there are other differences.

Also, now the path is: src/turbulenceModels/derivedFvPatchFields while before it was: src/turbulenceModels/incompressible/RAS/derivedFvPatchFields


Hope it helps,

Mary
MaryBau is offline   Reply With Quote

Old   February 16, 2017, 17:11
Default error with fixedShearStress
  #4
New Member
 
Jie (Jay) Zhang
Join Date: Sep 2010
Location: Phoenix, AZ, U.S.
Posts: 28
Rep Power: 16
jiez is on a distinguished road
I am trying to use the fixedShearStress B.C with pisoFoam. I searched all the information I can find and did it in the way below (Note that the OpenFOAM version I used is 2.2):

1) In the file 0/U:
surface
{
type fixedShearStress;
tau (0.037 0 0);
value uniform (0 0 0);
}

(Note: rho and phi are actually not necessary)

2) I included libs("libturbulenceDerivedFvPatchFields.so") in the controlDict

However I got the following error:

Code:
Starting time loop

Time = 1

Courant Number mean: 0.0125543 max: 0.0558635
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2  
 at sigaction.c:?
#3  Foam::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#4  Foam::operator*(Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#5  Foam::fixedShearStressFvPatchVectorField::updateCoeffs() at ??:?
#6  Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::updateCoeffs() at ??:?
#7  Foam::fvMatrix<Foam::Vector<double> >::fvMatrix(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) at ??:?
#8  Foam::fv::gaussLaplacianScheme<Foam::Vector<double>, double>::fvmLaplacianUncorrected(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#9  Foam::fv::gaussLaplacianScheme<Foam::Vector<double>, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#10  Foam::fv::laplacianScheme<Foam::Vector<double>, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#11  Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > > Foam::fvm::laplacian<Foam::Vector<double>, double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#12  Foam::incompressible::RASModels::kEpsilon::divDevReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const at ??:?
#13  
 at ??:?
#14  __libc_start_main at ??:?
#15  
 at ??:?
Segmentation fault
It seems to be an error caused by programming as explained at https://openfoamwiki.net/index.php/HowTo_debugging

I tried different turbulence models, like kEpsilon and kOmegaSST. It gives the same error.

Comments and insights are greatly appreciated.

Thanks!

Jay
jiez is offline   Reply With Quote

Old   September 26, 2017, 06:14
Default
  #5
Member
 
Robert Ong
Join Date: Aug 2010
Posts: 86
Rep Power: 16
rob3rt 0ng is on a distinguished road
Quote:
Originally Posted by jiez View Post
I am trying to use the fixedShearStress B.C with pisoFoam. I searched all the information I can find and did it in the way below (Note that the OpenFOAM version I used is 2.2):

1) In the file 0/U:
surface
{
type fixedShearStress;
tau (0.037 0 0);
value uniform (0 0 0);
}

(Note: rho and phi are actually not necessary)

2) I included libs("libturbulenceDerivedFvPatchFields.so") in the controlDict

However I got the following error:

Code:
Starting time loop

Time = 1

Courant Number mean: 0.0125543 max: 0.0558635
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2  
 at sigaction.c:?
#3  Foam::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#4  Foam::operator*(Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#5  Foam::fixedShearStressFvPatchVectorField::updateCoeffs() at ??:?
#6  Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::updateCoeffs() at ??:?
#7  Foam::fvMatrix<Foam::Vector<double> >::fvMatrix(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) at ??:?
#8  Foam::fv::gaussLaplacianScheme<Foam::Vector<double>, double>::fvmLaplacianUncorrected(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#9  Foam::fv::gaussLaplacianScheme<Foam::Vector<double>, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#10  Foam::fv::laplacianScheme<Foam::Vector<double>, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#11  Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > > Foam::fvm::laplacian<Foam::Vector<double>, double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#12  Foam::incompressible::RASModels::kEpsilon::divDevReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const at ??:?
#13  
 at ??:?
#14  __libc_start_main at ??:?
#15  
 at ??:?
Segmentation fault
It seems to be an error caused by programming as explained at https://openfoamwiki.net/index.php/HowTo_debugging

I tried different turbulence models, like kEpsilon and kOmegaSST. It gives the same error.

Comments and insights are greatly appreciated.

Thanks!

Jay
Hi Jay,
I'm having a similar problem.
Did you manage to solve it?
Thanks and regards
Robert
rob3rt 0ng is offline   Reply With Quote

Old   September 26, 2017, 13:00
Default
  #6
New Member
 
Jie (Jay) Zhang
Join Date: Sep 2010
Location: Phoenix, AZ, U.S.
Posts: 28
Rep Power: 16
jiez is on a distinguished road
Hi Robert,

No, I gave up. Instead, I fixed nut and used the following fixed gradient for U.

surface
{
type directionMixed;
refValue uniform (0 0 0);
refGradient uniform (0.017 0 0);
valueFraction uniform (0 0 0 0 0 1);
value uniform (0.017 0 0);
}
jiez is offline   Reply With Quote

Old   September 26, 2017, 21:09
Default
  #7
Member
 
Robert Ong
Join Date: Aug 2010
Posts: 86
Rep Power: 16
rob3rt 0ng is on a distinguished road
Hi Jay,

Thanks for sharing the alternative workaround.

I managed to run this fixedShearStress in OF.3.0.x but not in 3.0.1, so I'm guessing there is a bug (as reported here https://bugs.openfoam.org/view.php?id=2020). I think this bug is resolved in the newer version (>3.0.x).

Anyway, may I ask what is the type of your top BC (i.e. patch/wall/empty/symmetryPlane) if we impose the shear stress mentioned by Richards&Hoxey?

Also, I'm guessing the choice of value is quite important here (unlike the initialisation value). I calculated mine as \tau = \rho*\nu_T*\frac{\del u}{\del z}, where \nu_T=u_{star}*\kappa*z and \frac{\del u}{\del z}=u_{star}/(\kappa*z). Hence \tau=\rho*u_{star}^2. Is this correct?

Thanks and regards,
Robert
rob3rt 0ng is offline   Reply With Quote

Old   September 27, 2017, 11:52
Default
  #8
New Member
 
Jie (Jay) Zhang
Join Date: Sep 2010
Location: Phoenix, AZ, U.S.
Posts: 28
Rep Power: 16
jiez is on a distinguished road
Quote:
Originally Posted by rob3rt 0ng View Post
Hi Jay,

Thanks for sharing the alternative workaround.

I managed to run this fixedShearStress in OF.3.0.x but not in 3.0.1, so I'm guessing there is a bug (as reported here https://bugs.openfoam.org/view.php?id=2020). I think this bug is resolved in the newer version (>3.0.x).

Anyway, may I ask what is the type of your top BC (i.e. patch/wall/empty/symmetryPlane) if we impose the shear stress mentioned by Richards&Hoxey?

Also, I'm guessing the choice of value is quite important here (unlike the initialisation value). I calculated mine as \tau = \rho*\nu_T*\frac{\del u}{\del z}, where \nu_T=u_{star}*\kappa*z and \frac{\del u}{\del z}=u_{star}/(\kappa*z). Hence \tau=\rho*u_{star}^2. Is this correct?

Thanks and regards,
Robert
Hi Robert

I used patch for the top BC. I think it is the only choice if you want to use fixedStress for U. Correct me if I am wrong.

The formula you mentioned is correct, see https://en.wikipedia.org/wiki/Shear_velocity

But I am not clear about what the choice of value means here. Do you mean the choice of value for tau? In my previous case, the tau was determined by wind above the top BC.

Jay
jiez is offline   Reply With Quote

Old   September 27, 2017, 21:56
Default
  #9
Member
 
Robert Ong
Join Date: Aug 2010
Posts: 86
Rep Power: 16
rob3rt 0ng is on a distinguished road
Hi Jay,

My aim (which also maybe your aim) is to impose a constant shear stress at the top (i.e. shear driven flow), as mentioned by Richards&Hoxey and Sullivan et al, (2010?).

I think both fixedShearStress and your method (combined imposed fixed dU/dn and nut) is essentially the same, as they imposed a constant shear stress at the top. Would be interesting to see the results comparison of these methods.

Thanks
Robert
rob3rt 0ng 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
Atmospheric boundary layer Daniele111 OpenFOAM Running, Solving & CFD 50 November 3, 2023 04:22


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