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

Viscous Force Calculation

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 4, 2010, 04:23
Default Viscous Force Calculation
  #1
Member
 
John Wang
Join Date: Mar 2009
Location: Singapore
Posts: 73
Rep Power: 17
cwang5 is on a distinguished road
Hi guys,

I'm trying to implement a force-balance type subroutine into the pimpleDyMFoam solver based on the code from forces.C. I am having trouble with the calculation of the viscous force, though, as the forces.C uses the following code for the viscous force:

Code:
00438         const volVectorField& U = obr_.lookupObject<volVectorField>(UName_);
00439         const volScalarField& p = obr_.lookupObject<volScalarField>(pName_);
00440 
00441         const fvMesh& mesh = U.mesh();
00442 
00443         const surfaceVectorField::GeometricBoundaryField& Sfb =
00444             mesh.Sf().boundaryField();
00445 
00446         tmp<volSymmTensorField> tdevRhoReff = devRhoReff();
00447         const volSymmTensorField::GeometricBoundaryField& devRhoReffb
00448             = tdevRhoReff().boundaryField();
00449 
00450         forAllConstIter(labelHashSet, patchSet_, iter)
00451         {
00452             label patchi = iter.key();
00453 
00454             vectorField Md = mesh.C().boundaryField()[patchi] - CofR_;
00455 
00456             vectorField pf = Sfb[patchi]*p.boundaryField()[patchi];
00457 
00458             fm.first().first() += rho(p)*sum(pf);
00459             fm.second().first() += rho(p)*sum(Md ^ pf);
00460 
00461             vectorField vf = Sfb[patchi] & devRhoReffb[patchi];
00462 
00463             fm.first().second() += sum(vf);
00464             fm.second().second() += sum(Md ^ vf);
00465         }
since I will only use the solver under incompressible condition, the devRhoReff() should just be rho()*ras.devReff() with ras.devReff() obtained from RASModel.H based on the RAS model in RASProperties.
Code:
00059     else if (obr_.foundObject<incompressible::RASModel>("RASProperties"))
00060     {
00061         const incompressible::RASModel& ras
00062             = obr_.lookupObject<incompressible::RASModel>("RASProperties");
00063 
00064         return rho()*ras.devReff();
00065     }
As I am not that familiar with the object oriented programming part of C++ (I have just switched over from using C), I am not sure how to define the obr_ objectRegistry pointer. Can someone point me to a source code/thread that contains such information? Thanks

John
cwang5 is offline   Reply With Quote

Old   May 4, 2010, 04:59
Default
  #2
Member
 
John Wang
Join Date: Mar 2009
Location: Singapore
Posts: 73
Rep Power: 17
cwang5 is on a distinguished road
Solved... I must have been more sleep deprived than I thought I am...

Anyway, defining the devRhoReff() using rhoInf*turbulence->devReff() did the trick.

John
cwang5 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
how does Fluent calculate the pressure and viscous force vector? Ralf Schmidt FLUENT 2 May 17, 2010 15:49
Viscous force enry Fluent UDF and Scheme Programming 1 November 15, 2009 10:53
Forces viscous calculation in VWT with OpenFOAM 15x terrybarnaby OpenFOAM Running, Solving & CFD 0 November 28, 2008 08:39
pressure force and viscous force CFD FLUENT 0 March 7, 2006 01:03
Warning 097- AB Siemens 6 November 15, 2004 04:41


All times are GMT -4. The time now is 01:55.