
[Sponsors] 
January 25, 2011, 14:22 
Transport Equation for a scalar  Compressible Solver

#1 
Member
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 8 
Hi, I am a beginner with OF and I am new in the programming of the code.
I have to modify XiFoam, premix solver for turbulent combustion (which is rhoPisoFoam without any combustion) adding simply a new scalar transport equation for a variable ''C". The equation is on the form of: d/dt(rho*C)+rho*Ud/dxj(C)  laplacian(rho*nu * C) = ST where the ST is the source term for the scalar. The solver XiFoam is composed on the following files: bEqn.H createFields.H ftEqn.H hEqn.H huEqn.H Make (directory) pEqn.H readCombustionProperties.H UEqn.H XiFoam.C XiFoam.dep 1) I have changed the names regarding XiFoam in NewXiFoam and the path of compilation (make/files). 2)I have created the file "Ceqn.H" and typed the following code: solve where f is taken from a table.( fvm::ddt(rho, C) + fvc::div(phi, C)  fvm::laplacian(nu, C) == f ); 2) on the NewXiFoam.C I have added the following script on the code at the beginning the PISO loop: for (int corr=1; corr<=nCorr; corr++) { #include "pEqn.H" #include "Ceqn.H" } turbulence>correct(); 3)on the "createFields.H" I have added the script : Info<< "\nReading field C\n" << endl; volScalarField C ( IOobject ( "C", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Now everything should be done and after the compilation "wmake" it gives 1 error. Could you please tell if the steps for this compressible solver are the correct ones or not and what I should take car of. Thanks, alex 

January 26, 2011, 03:17 

#2 
Member
M. Mahdi Salehi
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 50
Rep Power: 9 
It can be several things, like syntas error, unit error and so on. You should post that so that we can help you. BTW, I bet you are implmenting PCMFPI.


January 26, 2011, 04:46 

#3 
Senior Member
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 446
Rep Power: 12 
hi,
did you try a wclean before wmake? what is wmake complaining about? how did you set up the table for "f"? I mean,... is it read from an external file? neewbie 

January 26, 2011, 12:58 

#4 
Member
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 8 
thanks to all of you! finally, after checking all things, I succeed!


January 27, 2011, 05:39 

#5 
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 15 
d/dt(rho*C)+rho*Ud/dxj(C)  laplacian(rho*nu * C) = ST
The above equation does not match what you've programmed below: solve ( fvm::ddt(rho, C) + fvc::div(phi, C)  fvm::laplacian(nu, C) == f );
__________________
Laurence R. McGlashan :: Website 

April 11, 2013, 09:04 

#6 
New Member
Lorenzo Bartolucci
Join Date: Oct 2012
Location: Rome  University of Tor Vergata
Posts: 5
Rep Power: 6 
I'm sorry Alex, I'm interested in change XiFoam solver too, could you post your "welldone" code below, please? Thank you
Lorenzo 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
dieselFoam problem!! trying to introduce a new heat transfer model  vivek070176  OpenFOAM Programming & Development  10  December 24, 2014 00:48 
compressible flow solver in OF1.6  mecbe2002  OpenFOAM  9  December 25, 2010 10:17 
interFoam + a scalar transport equation  CYMa  OpenFOAM  1  May 11, 2010 03:50 
Is it possible to influence the velocity of an scalar transport equation?  jannnesss  CFX  1  January 11, 2010 13:02 
scalar advectiondiffusion equation  Darcy  CFX  1  March 12, 2001 10:49 