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

solidParticle class. Wrong code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 20, 2009, 03:53
Default solidParticle class. Wrong code
  #1
Member
 
Mihails Ščepanskis
Join Date: Jul 2009
Posts: 36
Rep Power: 17
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, 09:06
Default
  #2
Member
 
Mihails Ščepanskis
Join Date: Jul 2009
Posts: 36
Rep Power: 17
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, 03:23
Default solidparticle compiling
  #3
New Member
 
mehdy
Join Date: May 2011
Posts: 5
Rep Power: 15
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


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
udf error srihari FLUENT 1 October 31, 2016 15:18
Debugging Unsteady 2-D Panel Method Code: Wake Modeling RajeshAero Main CFD Forum 5 November 10, 2011 06:48
Tmp class maka OpenFOAM Bugs 2 August 20, 2008 15:53
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 16:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 09:10


All times are GMT -4. The time now is 22:09.