|
[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. |
|
September 18, 2012, 05:33 |
|
#2 |
New Member
shakil ahmmed
Join Date: Sep 2009
Posts: 5
Rep Power: 16 |
you can use the source term as a boundary condition, in that case you can easily use groovyBC.Or if you can access to the 'internalField' when creating source object, you might be able to do this.
|
|
September 20, 2012, 11:14 |
|
#3 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
You could also use the equationReader extension. I'm working on a paper that will demonstrate this exact idea using it.
__________________
~~~ Follow me on twitter @DavidGaden |
|
September 24, 2012, 17:37 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
|
|
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 |