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

solidParticle class. Wrong code

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 20, 2009, 02:53
Default solidParticle class. Wrong code
  #1
Member
 
Mihails čepanskis
Join Date: Jul 2009
Posts: 36
Rep Power: 8
shchepan is on a distinguished road
Hello!
In file src/lagrangian/solidParticle/solidParticle.C is described function

bool Foam::solidParticle::move(solidParticle::trackData & td)
{
td.switchProcessor = false;
td.keepParticle = true;

const polyMesh& mesh = cloud().pMesh();
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();

scalar deltaT = mesh.time().deltaT().value();
scalar tEnd = (1.0 - stepFraction())*deltaT;
scalar dtMax = tEnd;

while (td.keepParticle && !td.switchProcessor && tEnd > SMALL)
{
if (debug)
{
Info<< "Time = " << mesh.time().timeName()
<< " deltaT = " << deltaT
<< " tEnd = " << tEnd
<< " steptFraction() = " << stepFraction() << endl;
}

// set the lagrangian time-step
scalar dt = min(dtMax, tEnd);

// remember which cell the parcel is in
// since this will change if a face is hit
label celli = cell();

dt *= trackToFace(position() + dt*U_, td);

tEnd -= dt;
stepFraction() = 1.0 - tEnd/deltaT;

cellPointWeight cpw(mesh, position(), celli, face());
scalar rhoc = td.rhoInterp().interpolate(cpw);
vector Uc = td.UInterp().interpolate(cpw);
scalar nuc = td.nuInterp().interpolate(cpw);

scalar rhop = td.spc().rhop();
scalar magUr = mag(Uc - U_);

scalar ReFunc = 1.0;
scalar Re = magUr*d_/nuc;

if (Re > 0.01)
{
ReFunc += 0.15*pow(Re, 0.687);
}

scalar Dc = (24.0*nuc/d_)*ReFunc*(3.0/4.0)*(rhoc/(d_*rhop));

U_ = (U_ + dt*(Dc*Uc + (1.0 - rhoc/rhop)*td.g()))/(1.0 + dt*Dc);

if (onBoundary() && td.keepParticle)
{
if (face() > -1)
{
if (isType<processorPolyPatch>(pbMesh[patch(face())]))
{
td.switchProcessor = true;
}
}
}
}

return td.keepParticle;
}

This function move solid particles that are influenced by drag and Archmed's forces.
I think that formula
U_ = (U_ + dt*(Dc*Uc + (1.0 - rhoc/rhop)*td.g()))/(1.0 + dt*Dc);
is wrong. This formula is equal equation
(U_-Uc)*Dc+(1.0-rhoc/rhop)*td.g()=0
Last equation means that (drag force)+(Archimed's force)=0, so particle do not move.

I think, we should replace this code to

//U_ = (U_ + dt*(Dc*Uc + (1.0 - rhoc/rhop)*td.g()))/(1.0 + dt*Dc);
//Drag force
vector Fdrag = Dc*(U_-Uc);
//Archimed's frce
vector FArch = td.g()*(1.0-rhoc/rhop);
vector F = Fdrag + FArch;
U_ += dt*F;


I need your criticism. Am I right or not?
shchepan is offline   Reply With Quote

Old   September 29, 2009, 08:06
Default
  #2
Member
 
Mihails čepanskis
Join Date: Jul 2009
Posts: 36
Rep Power: 8
shchepan is on a distinguished road
It was my mistake. solidParticle.C code is correct!
shchepan is offline   Reply With Quote

Old   May 27, 2011, 02:23
Default solidparticle compiling
  #3
New Member
 
mehdy
Join Date: May 2011
Posts: 4
Rep Power: 7
gooya_mehdy is on a distinguished road
hello shchepan
sorry I'm trying to use solidParticle solver for my project but I can't.
i use OF 1.6 and can't compile it.
I've got This massage:

.
.
.
injectorSolidParticleFoam.C.text._ZN4Foam26surfa ceInterpolationSchemeINS_6VectorIdEEE11interpolate ERKNS_14GeometricFieldIS2_NS_12fvPatchFieldENS_7vo lMeshEEERKNS_3tmpINS4_IdNS_13fvsPatchFieldENS_11su rfaceMeshEEEEE[Foam::surfaceInterpolationScheme<Foam::Vector<doub le> >::interpolate(Foam::GeometricField<Foam::Vector<d ouble>, Foam::fvPatchField, Foam::volMesh> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > const&)]+0x1b4): undefined reference to `Foam::calculatedFvsPatchField<Foam::Vector<double > >::typeName'
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1

The sentence "undefined reference to `Foam:...." is the same in all errors.
could anybody help me?
Thank you so much
gooya_mehdy is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debugging Unsteady 2-D Panel Method Code: Wake Modeling RajeshAero Main CFD Forum 5 November 10, 2011 06:48
udf error srihari FLUENT 0 February 9, 2009 10:00
Tmp class maka OpenFOAM Bugs 2 August 20, 2008 14:53
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 08:10


All times are GMT -4. The time now is 20:58.