Adding a Source Term to an User Defined transport equation
Hello everyone,
I have added a new transport equation to an existing solver, and I have all the bits working but the source term. That source term takes the following form: div(K*scalarField*vectorField) with K being a constant. Therefore, I have created in createFields.H an volVectorField countaining that product, so I can easily take the divergence afterwards in the solvers's '.C' file. volVectorField sourceTerm ( IOobject ( "sourceTerm", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), K*scalarField*vectorField ); Then, in the '.C' file of the solver I do: sourceTerm=K*scalarField*vectorField; fvScalarMatrix uds1Eqn ( fvm::ddt(uds1) - fvm::laplacian(D_uds1, uds1) == - fvc::div(sourceTerm) ); uds1Eqn.solve(); Everything compiles fine, but when I am running the solver, I get the following error: --> FOAM FATAL IO ERROR: attempt to read beyond EOF file: /home/rma/OpenFOAM/Pruebas/case/system/fvSchemes.divSchemes.div(sourceTerm) at line 33. From function ITstream::read(token&) in file db/IOstreams/Tstreams/ITstream.C at line 83. FOAM exiting However, the fvSchemes file does have that scheme specified: divSchemes { default Gauss upwind; div(phi,U) Gauss limitedLinearV 1; div(sourceTerm) Gauss upwind; } I don't really know how to proceed from here, maybe that is not the way I am suppossed to create a source term, so I would really appreciate if someone could help me with this problem. Thank you very much. |
http://cfd.direct/openfoam/user-guid...19-1400004.4.3
Code:
divSchemes Code:
div(phi, sourceTerm) Gauss upwind; Code:
div(sourceTerm) Gauss linear; |
All times are GMT -4. The time now is 23:48. |