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

Summing two volScalarFields

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 14, 2023, 13:16
Default Summing two volScalarFields
  #1
New Member
 
Join Date: Dec 2022
Posts: 14
Rep Power: 3
kilimanjaro2 is on a distinguished road
Hi,


I would like to know what OpenFOAM does to the boundaryField when summing two volScalarFields.


Say :


Code:
volScalarField f1 = p1 + p2;
The internalField gets summed up element-wise. That is clear.

Now, let us say that p1 only has fixedValue boundary conditions and p2 only has fixedGradient.


What ends up in f1?

Does openfoam take the fixedGradient values from p2, estimates the value on the face and sums it up it with the fixedValue of p1?


If so, where is this made in the code?
kilimanjaro2 is offline   Reply With Quote

Old   January 14, 2023, 14:48
Default
  #2
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 730
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Boundary conditions are typically applied *after* summing up contributions in the eon. Details are in eg the book by Moukalled, see https://link.springer.com/book/10.10...-3-319-16874-6.

Edit: eon => eqn or equation

Last edited by dlahaye; January 15, 2023 at 11:26.
dlahaye is offline   Reply With Quote

Old   January 15, 2023, 07:10
Default
  #3
New Member
 
Join Date: Dec 2022
Posts: 14
Rep Power: 3
kilimanjaro2 is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
Boundary conditions are typically applied *after* summing up contributions in the eon. Details are in eg the book by Moukalled, see https://link.springer.com/book/10.10...-3-319-16874-6.
Hello,
Thanks for the comment.

What does "eon" mean?
Would you be so kind as to tell me where this information is located in the book? So far, I was not able to find this information.
kilimanjaro2 is offline   Reply With Quote

Old   January 15, 2023, 11:28
Default
  #4
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 730
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Section 15.6 "Boundary Conditions".
dlahaye is offline   Reply With Quote

Old   January 17, 2023, 13:58
Default
  #5
New Member
 
Join Date: Dec 2022
Posts: 14
Rep Power: 3
kilimanjaro2 is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
Section 15.6 "Boundary Conditions".
This section is on boundary conditions for incompressible NS.
I would believe that the relevant part is :
"The unknown boundary pressure pb is extrapolated from the interior solution
using either a truncated Taylor series expansion around point C such that pressure is found from:"
p_b = p_C + \nabla p_C \cdot \vec{d}_{Cb}

So, when I sum two `volScalarField`s, the values that exist in the boundary with the `calculated` type are a reflection of this.
kilimanjaro2 is offline   Reply With Quote

Old   January 18, 2023, 04:29
Default
  #6
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 730
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
First perform summation of two volScallarFields.

Once summmation is performed, apply boundary conditions on the resulting sum.

Same procedure for incompressible and compressible.
dlahaye 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
Postprocess: sampleDict works but creates no output folder shock77 OpenFOAM Post-Processing 14 November 15, 2021 08:27
volVectorField from 3 volScalarFields without for loop Houthuys OpenFOAM Programming & Development 2 June 6, 2017 05:43
Multiple volScalarFields using List<volScalarField> vbchris OpenFOAM Programming & Development 6 September 14, 2014 06:38
foamToEnsight does not convert all volScalarFields stevenbeale OpenFOAM Post-Processing 2 February 14, 2014 04:20
a reconstructPar issue immortality OpenFOAM Post-Processing 8 June 16, 2013 11:25


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