|
[Sponsors] |
Adding a Source Term to an User Defined transport equation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 1, 2017, 19:00 |
Adding a Source Term to an User Defined transport equation
|
#1 |
New Member
Anonymous
Join Date: Jan 2017
Location: England, United Kingdom
Posts: 2
Rep Power: 0 |
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. |
|
January 2, 2017, 06:55 |
|
#2 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22 |
http://cfd.direct/openfoam/user-guid...19-1400004.4.3
Code:
divSchemes { div(sourceTerm) Gauss upwind; } Code:
div(phi, sourceTerm) Gauss upwind; Code:
div(sourceTerm) Gauss linear; |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
polynomial BC | srv537 | OpenFOAM Pre-Processing | 4 | December 3, 2016 10:07 |
[swak4Foam] swak4foam building problem | GGerber | OpenFOAM Community Contributions | 54 | April 24, 2015 17:02 |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
Reaction Source Term in Steady Species transport equation | cfdvenkatesh | Main CFD Forum | 0 | August 19, 2010 10:28 |