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

Divergence of icoFoam with custom boundary condtion in openFOAM3.1

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2019, 04:16
Default Divergence of icoFoam with custom boundary condtion in openFOAM3.1
  #1
New Member
 
Join Date: Apr 2019
Location: China,beijing
Posts: 4
Rep Power: 7
HuJG is on a distinguished road
Hi foamers:
I’m writing a new boundary condition in openFOAM3.1. I want to use it to calculate the slip velocity on the wall. The new BC is a little different from partialSlip, for I define different slip length on each direction: streamSlip, spanSlip. I chose the parabolic BC which is base on the fixedValue to rewite my own BC, because I can’t understand the partialSlip! I have compiled my BC and applied it to a simple case but failed. The case ran only 7 time step and soon diverged.
Below is my code in updateCoeffs(), the streamWise and spanWise are the slip-direction:

void slipLengthFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
const fvMesh& mesh = patch().boundaryMesh().mesh();
label patchID = mesh.boundaryMesh().findPatchID("SLIP");
const volVectorField& U = this->db().objectRegistry::lookupObject<volVectorFiel d> ("U");
const fvPatchVectorField& Uf = U.boundaryField()[patchID];
vectorField gradU = Uf.snGrad();
vectorField UStream = (gradU & streamWise_)*(streamWise_)*streamSlip_/(mag(streamWise_)*mag(streamWise_));
vectorField USpan = (gradU & spanWise_)*(spanWise_)*spanSlip_/(mag(spanWise_)*mag(spanWise_));
operator==(UStream + USpan);
fixedValueFvPatchField<vector>::updateCoeffs();
}
The size of the computational domain is 0.05*0.02*0.001m in x, y and z direction respectively. There are 201, 21 and 101 uniform grids in each direction. The icoFoam was used to solve the case.

Any suggestion will be helpful! Thanks for your attention!
Regards
Attached Images
File Type: jpg fluid field.jpg (146.4 KB, 3 views)
HuJG is offline   Reply With Quote

Old   June 16, 2019, 23:06
Default when i reduce slip length
  #2
New Member
 
Join Date: Apr 2019
Location: China,beijing
Posts: 4
Rep Power: 7
HuJG is on a distinguished road
When I deleted the mag(*) in the code and reduced the slip length to 1e-05m, the case ran without problem. But when i give it a larger slip length like 1e-04m, it diverged as before.
HuJG is offline   Reply With Quote

Reply

Tags
boundary conditions


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
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 91 December 21, 2022 04:50
My radial inflow turbine Abo Anas CFX 27 May 11, 2018 01:44
Out File does not show Imbalance in % Mmaragann CFX 5 January 20, 2017 10:20
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 01:27
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 08:44


All times are GMT -4. The time now is 21:25.