|
[Sponsors] |
Set cell volume integrated field values to preserve integral |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 30, 2018, 11:01 |
Set cell volume integrated field values to preserve integral
|
#1 |
Member
Andrea Di Ronco
Join Date: Nov 2016
Location: Milano, Italy
Posts: 57
Rep Power: 9 |
Hello to everyone!
What I'm doing is basically scalar transport with a custom solver which I wrote by adding a scalar transport equation to simpleFoam. Since for the moment I'm simulating point sources, I created a source volScalarField Qc which is set to zero everywhere except for a single cell, using setFields: Code:
defaultFieldValues ( volScalarFieldValue Qc 0 ); regions ( nearestToCell { points ((0.02 0.015 0)); fieldValues ( volScalarFieldValue Qc 1 ); } ); I would like to impose the total scalar source rate (e.g. in kg/s) located at the specific point, but setFields obviously sets the volume field, meaning that the value I set in setFieldsDict (1 in the above example) would be the "volume averaged" one, so that the volume integral of the source field would depend on the volume of the specific cell. At the beginning I was using a simple geometry and a structured mesh, so that I could knew the cell volume in advance. Now I need to use an unstructured mesh and to move the position of the source from one simulation to another. Is there any simple way to set the volume-integral value instead of the volume-average one to the cell (or, equivalently, to know the specific cell volume)? Thanks in advance, Andrea EDIT: another way of putting it would be to get the volume of the cellSet in which the source is defined. I'm no expert with OpenFOAM, but maybe it would be easier to manipulate a "cellSet entity" rather than a "cell" itself. The cellSet can be easily created with topoSet, and being able to calculate its volume would be a more general procedure (like in the case of non-point source). Unfortunately I've been reasoning about this possibility, but I couldn't find anything on this forum Last edited by Diro7; April 30, 2018 at 13:12. |
|
June 3, 2018, 01:47 |
|
#2 |
Senior Member
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19 |
You can use the SemiImplicitSource fvOption to specify your mass source.
There is the volumeMode entry and you can choose absolute option. https://github.com/OpenFOAM/OpenFOAM...plicitSource.H
__________________
[Personal]
|
|
June 3, 2018, 11:44 |
|
#3 | |
Member
Andrea Di Ronco
Join Date: Nov 2016
Location: Milano, Italy
Posts: 57
Rep Power: 9 |
Quote:
Hi fumiya, thank you very much for your reply. I'm not expert with using fvOptions, but it seems very useful so I'll definitely go and see what I can do with it. Regarding my initial problem, I solved it by writing a slightly modified version of setFields which computes the total volume of the cell set and divides the source intensity by it before setting the field. Thank you again! Andrea |
||
Tags |
cell volume, setfields, source terms |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
[swak4Foam] About groovyBC to set distributed fixedGradient values for each cell boundary patch | nwpukaka | OpenFOAM Community Contributions | 6 | August 12, 2014 07:34 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
FvMatrix coefficients | shrina | OpenFOAM Running, Solving & CFD | 10 | October 3, 2013 15:38 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |