CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] Grouping patches in swak4foam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2021, 07:27
Default Grouping patches in swak4foam
  #1
pad
New Member
 
PA
Join Date: Mar 2009
Posts: 25
Rep Power: 17
pad is on a distinguished road
Hi all,

I have tried searching for a solution to my "problem" but so far I only came across Possible to sum across different patches? which seems clutter my code with similar expressions

I have a number of patches which might change in number so to avoid too much editing of code from simulation to simulation with the risk of missing something I would like to go from

Code:
"pressure{patch1}=p*rho*normal()*area();"
...
"pressure{patchN}=p*rho*normal()*area();"
to something like
Code:
										
grouped_patches
(
    patch1
    ...
    patchN
)
"pressure{grouped_patches}=p*rho*normal()*area();"
Does anyone know if this is possible in swak4foam to do it directly in the external expressions? I looked through the reference but couldn't find a solution.

Any help is appreciated
__________________
Regards,
Per
pad is offline   Reply With Quote

Old   November 12, 2021, 04:14
Default Workaround/solution found but new issue with fields
  #2
pad
New Member
 
PA
Join Date: Mar 2009
Posts: 25
Rep Power: 17
pad is on a distinguished road
So it seems creating a faceSet with topoSet for all the patches I want would do the job in this particular case.

Code:
"pressure{faceSet'grouped_patches}=p*rho*normal()*area();"
However, when it comes to extracting viscous forces I have come to another hold since
Code:
"viscous{faceSet'grouped_patches}=sum(-nu*snGrad(U)*area());"
doesn't work due to the field snGrad(U) is not existing or of wrong type. So snGrad(U) cannot be used on a faceSet. Does anyone know how to work around this?

Also, doing the following gives a similar missing field error on the density.
Code:
"density=997;"
"pressure_forces{faceSet'grouped_patches}=density*sum(p*normal()*area());"
while
Code:
"density=997;"
"pressure_forces{faceSet'grouped_patches}=sum(p*normal()*area());"
"pressure_forces_density=density*pressure_forces;"
seems to work OK. Have I completely misunderstood how variables are defined or is there a bug in swak4foam when it comes to the last field error with density?
__________________
Regards,
Per

Last edited by pad; November 14, 2021 at 10:26.
pad is offline   Reply With Quote

Reply

Tags
external expression, grouping of patches, swak4foam


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
Problem using AMI vinz OpenFOAM Running, Solving & CFD 298 November 13, 2023 08:19
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 91 December 21, 2022 04:50
[snappyHexMesh] snappyHexMesh error "Cannot determine normal vector from patches." lethu OpenFOAM Meshing & Mesh Conversion 1 June 3, 2020 07:49
Possible bug with stitchMesh and cyclics in OpenFoam Jack001 OpenFOAM Pre-Processing 0 May 21, 2016 08:00
Cyclic boundaries in OF 21x morard OpenFOAM 25 May 13, 2013 22:35


All times are GMT -4. The time now is 08:52.