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

problem with gradient as source term in coupled equations

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 16, 2010, 14:12
Default problem with gradient as source term in coupled equations
  #1
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Hi!

I am trying to implement the following equations in OpenFOAM. There are nspecies resolution of these coupled equations according to the number of species in the system.

http://img148.imageshack.us/img148/6...reenshot1v.png


I have a problem with the implementation of the A-species evaporation rate. There is an error when compiling the code because of the gradient terms in the calculation of Sevap[i].


Code:
// Species transport calculation

for (int i=0; i<= nspecies; i++)
{

    volScalarField& Y_beta_i  = Y_beta[i];
    volScalarField& Y_gamma_i = Y_gamma[i];    
    
    Sevap[i]   = U_gamma_beta[i] & fvc::grad(Y_gamma_i) -U_beta_gamma[i] & fvc::grad(Y_beta_i) - alpha[i]*(H[i]*Y_gamma_i-Y_beta_i);

    mass_evap += Sevap[i];

    solve
    (
        fvm::ddt(eps_beta*rho_beta, Y_beta_i)
      + fvm::div(phi_beta, Y_beta_i)
     ==
        fvm::laplacian(eps_beta*rho_beta*D_beta_beta[i] , Y_beta_i)
      + fvm::laplacian(eps_beta*rho_beta*D_beta_gamma[i], Y_gamma_i)
      + Sevap[i]
    );

    solve
    (
        fvm::ddt(eps_gamma*rho_gamma, Y_gamma_i)
      + fvm::div(phi_gamma, Y_gamma_i)
     ==
        fvm::laplacian(eps_gamma*rho_gamma*D_gamma_gamma[i], Y_gamma_i)
      + fvm::laplacian(eps_gamma*rho_gamma*D_gamma_beta[i] , Y_beta_i)
      - Sevap[i]
    );
}
Here the velocity-like coefficients U_beta_gamma and U_gamma_beta are declared as

Code:
    PtrList<dimensionedVector> U_gamma_beta(nspecies);
    PtrList<dimensionedVector> U_beta_gamma(nspecies);
Do you have any suggestion ??


Moreover, I saw that there is a FvCoupledScalarMatrix class existing. Do you think it is useful in my case or the sequential method can be sufficient enough ?


Regards,
Cyp

Last edited by wyldckat; September 3, 2015 at 18:53. Reason: disabled embedded images
Cyp 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
problematic source term in UDS ak6g08 Fluent UDF and Scheme Programming 6 February 10, 2015 01:19
UDF source term Rajani Kanth.B Fluent UDF and Scheme Programming 4 May 1, 2013 10:31
source terms-convergence problem alanlove FLUENT 0 March 28, 2010 07:47
pressure gradient term in low speed flow Atit Koonsrisuk Main CFD Forum 2 January 10, 2002 11:52
UDF Scalar Code: HT 1 Greg Perkins FLUENT 8 October 20, 2000 13:40


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