|
[Sponsors] |
How to set and read time-dependent source terms |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 16, 2012, 13:19 |
How to set and read time-dependent source terms
|
#1 |
New Member
Dean Meyer
Join Date: Jul 2012
Posts: 4
Rep Power: 13 |
Dear Foamers,
I would like to read a time-dependent source term, which can be defined by a function in a file in the case directory and read from the solver itself. So far I managed to set the source term using funkySetFields, but only as initial condition. My approach is the following: In createFields.H the field of the mass source is defined as follows: Code:
volScalarField massSource ( IOobject ( "massSource", runTime.timeName(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ), mesh ); Code:
fvScalarMatrix rhoEqn ( fvm::ddt(rho) + some terms == massSource ); rhoEqn.solve(); Code:
massSource { field massS; expression "sin(pi*time())*(pos().x+pos().y"; //arbitrary function //condition "..."; } Thank you for any ideas. D. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to read field files from the two different time directories | fumiya | OpenFOAM | 1 | August 1, 2021 06:58 |
TimeVaryingMappedFixedValue | irishdave | OpenFOAM Running, Solving & CFD | 32 | June 16, 2021 06:55 |
How to show the transient case? | H.P.LIU | Phoenics | 7 | July 13, 2010 04:31 |
contribution of convective source in total source? | Antony | Phoenics | 4 | July 30, 2008 05:15 |
How to set environment variables | kanishka | OpenFOAM Installation | 1 | September 4, 2005 10:15 |