|
[Sponsors] |
fvOptions and Vector/Vectorfield in simpleFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 24, 2017, 10:02 |
fvOptions and Vector/Vectorfield in simpleFoam
|
#1 |
New Member
Andreas Müller
Join Date: Feb 2017
Posts: 5
Rep Power: 9 |
Hi,
i ran into an issue using fvOptions and since I haven't found any solution yet: I want to use fvOptions in order to add a precalculated sourceterm to my UEqn. Despite the examples i found yet, fvOptions should contain a vector/vectorfield, which are calculated in advance for the whole interior region. Examplecode: Code:
tmp<fvVectorMatrix> UEqn ( fvm::div(phi, U) + turbulence->divDevReff(U) == fvOptions(U) ); Just adding the vector/vectorfield into the equation results into a Foam Fatal Error. Im glad for every response. Thanks in advance. Im sorry for grammatical errors. |
|
February 24, 2017, 11:35 |
|
#2 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21 |
Code:
fvVectorMatrix UEqnLHS ( fvm::div(phi, U) + turbulence->divDevReff(U) ); IOobject io ( "USource", U.instance(), U.mesh(), NO_READ, NO_WRITE, false ); DimensionedVectorField USource ( io, U.mesh(), UEqnLHS.dimensions()/dimVolume; ); forAll(USource, i) { USource[i] = vector(i, 2*i, 3*i); } fvVectorMatrix UEqn ( UEqnLHS == USource ); |
|
|
|