CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Divergence with solution variable as first entry

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2019, 10:10
Question Divergence with solution variable as first entry
  #1
New Member
 
Elisabeth Diehl
Join Date: Jun 2019
Posts: 8
Rep Power: 7
elsebaer is on a distinguished road
Hi everybody,


I have to include the term div(rho * dU & U) in a fvVectorMatrix, where & denotes the inner product of dU and U. The equation shall be solved for dU. I implemented the following code:


Code:
surfaceScalarField dPhi
(
    IOobject
    (
        "dPhi",
        runTime.timeName(),

        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    fvc::flux(dU)

);


surfaceScalarField rhoDPhi(fvc::interpolate(rho)*dPhi);



fvVectorMatrix dUEqn.H
(
    ...
  + fvm::div(rhoDPhi & U)
    ...

);
I didn't get an error while compilation, but when I want to solve a test case, I get the following error:
Quote:
incompatible fields for operation [dU] + [U]
In my opinion, this results from the fact, that the term fvm::div(rhoDPhi & U) causes OpenFOAM to think that U is the solution variable of the system instead of dU.


Do you have an idea how to "switch" dU and U in a mathematically correct way, without writing a new divergence operator?


Thanks a lot for thinking about this!
elsebaer is offline   Reply With Quote

Reply

Tags
divergence


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compressible steady state solution divergence Nero_CMU OpenFOAM Running, Solving & CFD 5 January 12, 2016 10:57
how to get the divergence of a vector variable on a patch GP_FDU OpenFOAM Running, Solving & CFD 1 March 18, 2013 15:12
Divergence problem Smaras FLUENT 13 February 21, 2013 06:03
Env variable not set gruber2 OpenFOAM Installation 5 December 30, 2005 05:27
Divergence detected in solution Kevan Moodley Main CFD Forum 7 June 28, 1999 09:12


All times are GMT -4. The time now is 02:47.