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

About Derived BC

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 17, 2012, 05:14
Default About Derived BC
  #1
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 4
mmkr825 is on a distinguished road
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.68-T,-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.68-T, -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.68-T, -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.71252e-06, No Iterations 3
DILUPBiCG: Solving for Uy, Initial residual = 0.00756933, Final residual = 4.93399e-06, No Iterations 3
swak4Foam: Allocating new repository for sampledGlobalVariables


--> FOAM FATAL ERROR:
Parser Error at "1.25-27" :"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
mmkr825 is offline   Reply With Quote

Old   September 17, 2012, 19:15
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,840
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by mmkr825 View Post

--> FOAM FATAL ERROR:
Parser Error at "1.25-27" :"field fvc not existing or of wrong type"
"1.4142*sqrt(magSqr(symm(fvc::grad(U))))+nl"
" ^^^ "

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
As mentioned in the other post on the patch you might want to use snGrad(T) which gives you the gradient in surface normal direction (which is only a scalar)
__________________
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
gschaider is online now   Reply With Quote

Old   September 22, 2012, 03:12
Default About div(TensorField)
  #3
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 4
mmkr825 is on a distinguished road
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
mmkr825 is offline   Reply With Quote

Old   September 22, 2012, 05:10
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,840
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by mmkr825 View Post
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
Please read the Programmers Guide (it is old, but most of the information there is at least helpful). After that it will be clear to you that you'll have to choose explicit or implicit discretication with fvm and fvc
__________________
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
gschaider is online now   Reply With Quote

Old   September 25, 2012, 05:31
Default
  #5
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 4
mmkr825 is on a distinguished road
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(1-T/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
mmkr825 is offline   Reply With Quote

Old   September 25, 2012, 09:12
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,840
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by mmkr825 View Post
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(1-T/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
fvc again

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
gschaider is online now   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
Calling a method from derived BC psosnows OpenFOAM Programming & Development 4 December 26, 2013 18: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 STAR-CCM+ 8 September 29, 2009 05:35
Derived velocities from loss coefficients ?? jakjak CFX 1 December 20, 2007 14:38
Help: Reading values in derived types for VFortran Wee Main CFD Forum 0 October 15, 2006 09:39


All times are GMT -4. The time now is 18:59.