# Transport Equation for a scalar - Compressible Solver

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

 January 25, 2011, 14:22 Transport Equation for a scalar - Compressible Solver #1 Member     Alex Join Date: Apr 2010 Posts: 48 Rep Power: 9 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 ( fvm::ddt(rho, C) + fvc::div(phi, C) - fvm::laplacian(nu, C) == f ); where f is taken from a table. 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: 10 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 PCM-FPI.

 January 26, 2011, 04:46 #3 Senior Member   Matthias Voß Join Date: Mar 2009 Location: Berlin, Germany Posts: 449 Rep Power: 13 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: 9 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: 16 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 ); solefire likes this. __________________ 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 "well-done" code below, please? Thank you Lorenzo

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post vivek070176 OpenFOAM Programming & Development 10 December 24, 2014 00:48 mecbe2002 OpenFOAM 9 December 25, 2010 10:17 CYMa OpenFOAM 1 May 11, 2010 03:50 jannnesss CFX 1 January 11, 2010 13:02 Darcy CFX 1 March 12, 2001 10:49

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