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

How to multiply volScalarField and fvScalarMatrix ?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By CorbinMG

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 30, 2020, 12:17
Default How to multiply volScalarField and fvScalarMatrix ?
  #1
Member
 
Paul Palladium
Join Date: Jan 2016
Posts: 94
Rep Power: 10
Fauster is on a distinguished road
Dear Foamers,

I am interested in multiplying or dividing a fvScalarMatrix by a volScalarField.
In a case of a fvc operator like fvc::div or fvc::laplacian the code compiles.

For example :
Quote:
volScalarField alpha(...);
Quote:
fvc::laplacian(d,T)/alpha
-> ok for compilation

Unfortunately when it comes to implicit operator (fvm) the code doesn't compile :

Quote:
fvm::laplacian(d,T)/alpha
-> ERROR at compilation

How can we solve this issue ? Am I asking something unrealistic ? In a pure mathematical way it makes sense. But OpenFOAM doesn't seem to like it.

All help would absolutely be helpful.

F

Last edited by Fauster; December 3, 2020 at 04:08. Reason: Modification due to Onurb comment
Fauster is offline   Reply With Quote

Old   December 1, 2020, 14:10
Default
  #2
New Member
 
Bruno
Join Date: Jul 2018
Posts: 6
Rep Power: 8
Onurb is on a distinguished road
Hello Fauster,

laplacian is misspelled.
Onurb is offline   Reply With Quote

Old   December 2, 2020, 05:57
Default
  #3
Member
 
Paul Palladium
Join Date: Jan 2016
Posts: 94
Rep Power: 10
Fauster is on a distinguished road
Quote:
Originally Posted by Onurb View Post
Hello Fauster,

laplacian is misspelled.
Sorry Onurb. I made a mistake when writing the text but in the code this is
Quote:
laplacian
.

I can copy paste the message error at compilation but for me it's like this is not authorized by OpenFOAM.
For example if you try to do something like fvc::interpolate(surfaceScalarField).

Last edited by Fauster; December 3, 2020 at 04:07.
Fauster is offline   Reply With Quote

Old   December 14, 2022, 12:29
Default
  #4
New Member
 
Corbin G
Join Date: Oct 2022
Location: Midwest, USA
Posts: 11
Rep Power: 4
CorbinMG is on a distinguished road
Dear Fauster,

I had same problem as you. It seems if you switch the order of multiplication, it works OK. That is volScalarField*fvScalarMatrix IS possible. But, fvScalarMatrix*volScalarField gives compilation error:

Code:
volScalarField rhoCp1 = rho1*alpha1*mixture.thermo1().Cp() + rho2*alpha2*mixture.thermo2().Cp();
fvScalarMatrix eEqn
(
rhoCp1*fvm::ddt(T)         //  compiles OK!
//fvm::ddt(T)*rhoCp1      //  gives compilation error!
==
fvOptions(rhoCp1, T)
);
überschwupper likes this.
CorbinMG is offline   Reply With Quote

Reply


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
No matching function error: Phase change source term added to interMixingFoam wavefunction OpenFOAM Programming & Development 2 February 4, 2022 08:46
Source term in fvScalarMatrix vivek05 OpenFOAM Programming & Development 2 June 6, 2019 08:30
fvMatrix to volScalarField coversion ? lfgmarc OpenFOAM Programming & Development 3 March 21, 2019 07:32
Error message Bruno_Jorge Main CFD Forum 1 February 5, 2019 12:12
namespace Foam Argen OpenFOAM 4 February 5, 2019 09:55


All times are GMT -4. The time now is 14:50.