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

is it possible to calculate div (vector,vector) ?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2020, 12:30
Default is it possible to calculate div (vector,vector) ?
  #1
Member
 
MNM
Join Date: Aug 2017
Posts: 69
Rep Power: 8
SHUBHAM9595 is on a distinguished road
Dear Foamers,

I'm trying to compute a source term for the velocity field which is shown in the attached image.

So I tried the following way (Here M and H are both vector Fields) but I'm getting an error which is not surprising as If I'm not wrong then OF only calculates the divergence of a vector field with a scalar prefix.

But is it possible to calculate something like fvc::div (vector, vector) ?

// KELVIN FORCE DENSITY INITIALIZATION
Code:
volVectorField KFD = munot*(fvc::div(M, H)); // M dot del H
Is there any workaround to do so? It'll be really helpful if you guide me to proceed in the right direction.
Attached Images
File Type: png Screenshot_2020-01-28_18-10-28.png (4.3 KB, 5 views)
SHUBHAM9595 is offline   Reply With Quote

Old   June 20, 2022, 11:54
Default
  #2
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 355
Rep Power: 8
geth03 is on a distinguished road
Openfoam can calculate divergence from a volVectorField or surfaceScalarFields.
If M*H results a volScalarField, it will probably return an error.

Last edited by geth03; June 21, 2022 at 04:14.
geth03 is offline   Reply With Quote

Old   June 21, 2022, 03:58
Default
  #3
Member
 
Join Date: Jan 2022
Location: Germany
Posts: 72
Rep Power: 4
überschwupper is on a distinguished road
I would forward you to this page:
https://cpp.openfoam.org/v9/classFoa...ts_1_1div.html


But I'm not sure if the math is correct here in your approach. The expression inside the brackets results in



(\vec{M} \cdot \nabla)  = M_x \frac{\partial}{\partial x} + M_y \frac{\partial}{\partial y} + M_z \frac{\partial}{\partial z}


which defines a new "Scalar operator" which has to be applied to each component of your vector H. Thats why you dont need the divergence here. Those are the components here of the resulting vector




M_x \frac{\partial H_x}{\partial x} + M_y \frac{\partial H_x}{\partial y} + M_z \frac{\partial H_x}{\partial z}
M_x \frac{\partial H_y}{\partial x} + M_y \frac{\partial H_y}{\partial y} + M_z \frac{\partial H_y}{\partial z}
M_x \frac{\partial H_z}{\partial x} + M_y \frac{\partial H_z}{\partial y} + M_z \frac{\partial H_z}{\partial z}




This is not that trivial as someone would assume. I cannot provide a solution right now. But you need to define a function that is calculating the differentials of H and multiply them with M.x(), M.y(), M.z()
überschwupper 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
How to calculate centerbody thrust of an aerospike nozzle in Fluent Roh FLUENT 5 February 21, 2022 11:30
How to calculate Turbulent Intensity and Hydraulic Diameter for my problem? Roh FLUENT 1 June 17, 2018 03:12
calculate friction factor & nusselt number soheil1991 FLUENT 3 March 11, 2017 09:30
calculate values for eps and k from Re or u????? sbar OpenFOAM Pre-Processing 5 August 16, 2010 04:10
How to calculate Torque for francis turbine manish CFX 4 March 15, 2007 02:57


All times are GMT -4. The time now is 09:00.