CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Divergence with solution variable as first entry

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2019, 09:10
Question Divergence with solution variable as first entry
New Member
Elisabeth Diehl
Join Date: Jun 2019
Posts: 8
Rep Power: 6
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:

surfaceScalarField dPhi



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:
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



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 09:57
how to get the divergence of a vector variable on a patch GP_FDU OpenFOAM Running, Solving & CFD 1 March 18, 2013 14:12
Divergence problem Smaras FLUENT 13 February 21, 2013 05:03
Env variable not set gruber2 OpenFOAM Installation 5 December 30, 2005 04:27
Divergence detected in solution Kevan Moodley Main CFD Forum 7 June 28, 1999 08:12

All times are GMT -4. The time now is 04:10.