Transport Equation for a scalar - Compressible Solver
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 |
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.
|
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 |
thanks to all of you! finally, after checking all things, I succeed!
|
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 ); |
I'm sorry Alex, I'm interested in change XiFoam solver too, could you post your "well-done" code below, please? Thank you :)
Lorenzo |
All times are GMT -4. The time now is 04:28. |