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

Convection Term

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2013, 10:25
Default Convection Term
  #1
New Member
 
Join Date: Mar 2012
Posts: 18
Rep Power: 14
anton_lias is on a distinguished road
Hello Foamers,
I have modified the solver MRFInterFoam to solve the population balance equation via the Quadratic method of Moments.
Now I would like to add the convection term (see attached file)
m is a scalarField
c1 and c2 are constants (scalars)

First I tried this Equation, but I understand, that I can't calculate "scalar - tensor".
Code:
fvScalarMatrix mEqn
(
    U & fvc::grad(m)
    - fvc::grad(c1 * fvc::grad(m1)
    +c2
);
So I tried this Equation (found in a paper) and add c2 later on.
Code:
fvScalarMatrix mEqn
(
	fvm::div(phi, m)
	- fvm::laplacian(c1, m)
);
Does this Equation computes the Equation given in the attachment?

Thanks for your help.
Attached Images
File Type: png convection.png (15.0 KB, 44 views)
anton_lias is offline   Reply With Quote

Old   June 5, 2013, 18:49
Default
  #2
Member
 
Thomas Boucheres
Join Date: May 2013
Posts: 41
Rep Power: 12
thomasArk47 is on a distinguished road
Hi,

yes it is better. Don't forget to add the temporal derivative and the source term. Look at applications/solvers/basic/scalarTransportFoam.
thomasArk47 is offline   Reply With Quote

Old   June 6, 2013, 10:05
Default
  #3
New Member
 
Join Date: Mar 2012
Posts: 18
Rep Power: 14
anton_lias is on a distinguished road
Thank you Thomas.

Do you mean something like that?
Code:
solve
    (
        fvm::ddt(m)
        + fvm::div(phi, m)
        - fvm::laplacian(c1, m)
        +c2
    );
anton_lias is offline   Reply With Quote

Old   June 6, 2013, 16:52
Default
  #4
Member
 
Thomas Boucheres
Join Date: May 2013
Posts: 41
Rep Power: 12
thomasArk47 is on a distinguished road
Ok for the time derivative.

For the source term, it is not good. Ok, I assume your "c2" is a fixed variable. This way, you have 2 possibility:

1- use
solve
(
fvm::ddt(m)
+ fvm::div(phi, m)
- fvm::laplacian(c1, m)
==
fvm::Su(c2f,m)
);
...where c2f can be declared after the m variable as follows:
DimensionedField<scalar,volMesh> c2f
(
IOobject
(
"c2f",
m.time().timeName(),
m.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
m.mesh(),
dimensionedScalar("c2f",m.dimensions()/dimTime,c2)
);

2- cleaner approach by using the fvOptions framework. Needs to write:
solve
(
fvm::ddt(m)
+ fvm::div(phi, m)
- fvm::laplacian(c1, m)
==
fvOptions(m)
);
In this approach, you need to define in the right way the fvOptions file located in the system file. Look at the tutorials to find the syntax you need.

N.B : if c2 is not a fixed variable, the first approach is probably the simpler for first try (you could use the second one in combinaison of the codedFunctionObject)
thomasArk47 is offline   Reply With Quote

Old   June 18, 2013, 08:02
Default
  #5
New Member
 
Join Date: Mar 2012
Posts: 18
Rep Power: 14
anton_lias is on a distinguished road
Thank you thomas its working
anton_lias is offline   Reply With Quote

Old   August 17, 2017, 13:40
Default
  #6
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Hello Lias,

I am working on the Quadratic method of Moments. AFAIK, VOF (interFoam) solve the dispersed phase directly, you dont need the QMOM to track the dispersed phase. Or are you coupling other variables?
sharonyue is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PISO algorithm for particular NS equation (special convection term) Cyp OpenFOAM Programming & Development 8 June 12, 2012 09:36
[Q] Convection term treatment in UDS Ryan, Lee FLUENT 4 October 18, 2004 10:20
Convection Term Discretization Maciej Matyka Main CFD Forum 3 October 7, 2004 04:32
Convection term with moving grids nicolas FLUENT 0 December 10, 2003 07:34
Additional Convection Term Richard Phoenics 4 March 19, 2001 03:10


All times are GMT -4. The time now is 21:31.