
[Sponsors] 
September 17, 2012, 05:14 
About Derived BC

#1 
Member
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 6 
Hi Foamers,
I am fresher for openFoam. I have written my own application. I am doing my project on suspension (solid particles in fluid) flow through straight channels. I prepared my solver for the coupling of continuity, momentum and particle conservation equation. Now i am facing problem with boundary condition for the particle volume fraction at the upper and lower walls. I need to apply zero flux (surface normal flux) condition for the particle volume fraction(T) at boundary.When applied this condition in particle conservation equation i got an expression for the gradient of particle volume fraction. my governing equation for the particle volume fraction is: *solve ( fvm::div(phi, T) + fvm::laplacian(0.62*1.82*pow(a,2)*g*pow(T,2)*pow(0.68T,1), T) + fvm::laplacian(0.41*pow(a,2)*g*T, T) ==  fvc::laplacian(0.41*pow(a,2)*T*T, g) );* where T=particle volume fraction (no units) where g=local strain rate scalar=*1.41421*sqrt(magSqr(symm(fvc::grad(U))))* After applying zero flux boundary condition i got an expression for gradient as: *d(T)/dy=  0.41*pow(T, 2)*(fvc::grad(g))*normal()/(T*g*(0.41+T*1.1284*pow(0.68T, 1))) For this purpose i opted swak4Foam. I written groovyBC for this boundary as follows. fixedWalls { type groovyBC; variables "nl=0.005626;m=1.4142*sqrt(magSqr(symm(fvc::grad(U ))))+nl;gm=fvc::grad(m)*normal()"; gradientExpression "0.41*pow(T, 2)*gm/(T*m*(0.41+T*1.1284*pow(0.68T, 1)))"; fractionExpression "0"; } when i run the code the following error is coming. Error: Starting time loop Time = 906nl [0 0 1 0 0 0 0] 0.005626 DILUPBiCG: Solving for Ux, Initial residual = 0.00395645, Final residual = 2.71252e06, No Iterations 3 DILUPBiCG: Solving for Uy, Initial residual = 0.00756933, Final residual = 4.93399e06, No Iterations 3 swak4Foam: Allocating new repository for sampledGlobalVariables > FOAM FATAL ERROR: Parser Error at "1.2527" :"field fvc not existing or of wrong type" "1.4142*sqrt(magSqr(symm(fvc::grad(U))))+nl" " ^^^ " From function parsingValue in file lnInclude/CommonValueExpressionDriverI.H at line 802. FOAM exiting please suggest me how to rectify this. I have one more doubt that i defined grad(T), which tends to give a vector field. Where as T is scalar. Therefore to calculate one value there are three conditions. Actually i need surface normal gradient. Please suggest me how to overcome this problem. Thanks Regards Mallikarjuna 

September 17, 2012, 19:15 

#2  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,953
Rep Power: 41 
Quote:
__________________
Note: I don't use "Friend"feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request 

September 22, 2012, 03:12 
About div(TensorField)

#3 
Member
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 6 
Hi Gschaider,
In my project i need to write div(tensorField). when i write in OF the following error is coming. Error: error: no matching function for call to ‘div(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >, Foam::volTensorField&)’ My governing equation is div(nu, E)=grad(p) where E= symmetric part of grad(U) = 1/2(grad(U)+grad(U).T) there by E will be tensor field. If grad(U) is symmetric then my governing equation can be written as laplacian(nu,U). But in my case it is not symmetric.Please guide me to rectify this problem. Thanks Regards Mallikarjuna 

September 22, 2012, 05:10 

#4  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,953
Rep Power: 41 
Quote:
__________________
Note: I don't use "Friend"feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request 

September 25, 2012, 05:31 

#5 
Member
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 6 
Hi sir,
I have a doubt about laplacian and divergence. For many problems we write div(nu, grad(T)) simply as laplacian(nu, T). For my application i need to write div(tensor), Which gives a vector field. But i am getting some error message as follows. UEqn: tmp<fvVectorMatrix> UEqn ( fvm::div(phi, U)  fvc::div(2*nu*pow(1T/0.68,1.82), symm(grad(U))) ); Error: UEqn.H:7:62: error: no matching function for call to ‘div(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >, Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >)’ make: *** [Make/linuxGccDPOpt/sbm1Foam.o] Error 1 where symm(grad(U)) is rate of strain tensor.(1/2*(grad(U)+grad(U).T)). please guide me to rectify this problem.. Thanks Regards Mallikarjuna 

September 25, 2012, 09:12 

#6  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,953
Rep Power: 41 
Quote:
But I've got no idea what the title of the thread has got to do with this problem
__________________
Note: I don't use "Friend"feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Calling a method from derived BC  psosnows  OpenFOAM Programming & Development  4  December 26, 2013 19:02 
How the force derived on a 2D model?  rikio  FLUENT  2  October 11, 2010 21:41 
Creating 100 derived parts / Splitting derived parts for mass flux calculation  xamo  STARCCM+  8  September 29, 2009 05:35 
Derived velocities from loss coefficients ??  jakjak  CFX  1  December 20, 2007 15:38 
Help: Reading values in derived types for VFortran  Wee  Main CFD Forum  0  October 15, 2006 09:39 