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

Questions for the bdivb function in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2006, 14:50
Default Hi, all I have a question f
  #1
New Member
 
Guiyeom Kang
Join Date: Mar 2009
Posts: 2
Rep Power: 0
gkang is on a distinguished road
Hi, all

I have a question for 'div' function in OpenFOAM. I am solving advection-diffusion equation and the advection term has a velocity that is a vector. I can't use 'div' in OpenFOAM for solving 'div(U,C) here U is the velocity(vector) and C is concentration(scalar) in 2D. There is also another velocity applying to advection term, 'div(V,C), here V is a constant velocity and C is same as above. I can't use 'div' for this either. I tried 'V * div(C)' but it didn't work. Hence, what I did was:


volVectorField gradC = fvc::grad(C);
volScalarField gradCx = gradC.component(0);
volScalarField gradCy = gradC.component(1);

volVectorField gradUx = fvc::grad(U.component(0));
volScalarField gradUxx = gradUx.component(0);

volVectorField gradUy = fvc::grad(U.component(1));
volScalarField gradUyy = gradUy.component(1);

solve
(
gradUxx*C+U.component(0)*gradCx + gradUyy*C+U.component(1)*gradCy + V*(gradCx+gradCy)
)

By the way, U is given volVectorField from other case and I used the one of identities in page 21 of Programmer's Guide to solve 'div'.


It worked fine but for the mathematic sense it is a bit strange. Are there any other ways to do this?
Thanks.
gkang is offline   Reply With Quote

Old   May 11, 2006, 16:31
Default I guess you could try, fvVect
  #2
Member
 
Pierre Le Fur
Join Date: Mar 2009
Location: UK
Posts: 60
Rep Power: 17
pierre is on a distinguished road
I guess you could try,
fvVectorMatrix CEqn
(
fvm::ddt(C)
+ fvm::div(phi, C)
- fvm::laplacian(Coef, C)
);
for the concentration scalar,
where "phi" is the flux through the cell faces, calculated from velocity field obtained either solving for U or from a fixed velocity field (look at icofoam for example for the former) and "Coef" a diffusion coeffecient of your choice.
i.e. I guess fvm::div(flux, vector) or fvm::div(flux, scalar) is the right notation.

Pierre
pierre is offline   Reply With Quote

Old   May 11, 2006, 16:33
Default Oops mistake sorry it is fvSc
  #3
Member
 
Pierre Le Fur
Join Date: Mar 2009
Location: UK
Posts: 60
Rep Power: 17
pierre is on a distinguished road
Oops mistake sorry it is
fvScalarMatrix CEqn
(
fvm::ddt(C)
+ fvm::div(phi, C)
- fvm::laplacian(Coef, C)
);
sorry

Pierre
pierre is offline   Reply With Quote

Old   May 13, 2006, 12:11
Default Dear Pierre Thanks for your
  #4
New Member
 
Guiyeom Kang
Join Date: Mar 2009
Posts: 2
Rep Power: 0
gkang is on a distinguished road
Dear Pierre

Thanks for your advices. I tried flux instead of velocity and it worked fine. The result was much smoother and nicer. In the previous one there were some truncation errors (I guess) but there are not now.
I am doing further development at the moment and I will put some questions here if anything arise.
Thanks.

Guiyeom.
gkang 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
Questions about OpenFOAM misch OpenFOAM 2 August 29, 2008 06:18
[Commercial meshers] Bug in Harpoon OpenFoam export function philippose OpenFOAM Meshing & Mesh Conversion 1 June 28, 2007 08:36
Stream Function - Potential Function coordinates harish Main CFD Forum 8 June 25, 2005 14:18
Questions about wall function sarah_ron FLUENT 9 October 26, 2004 05:44
questions about keps model and wall function sarah_ron FLUENT 3 October 15, 2004 08:50


All times are GMT -4. The time now is 15:48.