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

Options for setFields

Register Blogs Community New Posts Updated Threads Search

Like Tree18Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 24, 2019, 03:28
Default
  #21
Member
 
Dokeun, Hwang
Join Date: Apr 2010
Location: Korea, Republic of
Posts: 98
Rep Power: 16
dokeun is on a distinguished road
Quote:
Originally Posted by Hisham View Post
I got it. I post here for future readers.

1. In the blockMeshDict, define the cellZone names for required blocks:
e.g. (from the damBreak example)

blocks
(
hex (0 1 5 4 12 13 17 16) cellZoneName (23 8 1) simpleGrading (1 1 1)
hex (2 3 7 6 14 15 19 18) (19 8 1) simpleGrading (1 1 1)
hex (4 5 9 8 16 17 21 20) (23 42 1) simpleGrading (1 1 1)
hex (5 6 10 9 17 18 22 21) cellZoneName (4 42 1) simpleGrading (1 1 1)
hex (6 7 11 10 18 19 23 22) (19 42 1) simpleGrading (1 1 1)
);


2. In the setFieldsDict,

defaultFieldValues
(
volScalarFieldValue alpha1 0
);

regions
(
zoneToCell
{
name "cellZoneName";
fieldValues
(
volScalarFieldValue alpha1 1
);
}
);

Dear Hisham

Thank you for your post and comment for followers like me.

I'd also like to use non-box region initialization for the flow on cylinderial wall with multiphaseInterFoam.

The difference is that I import gmsh for mesh using gmshToFoam and there was no problem but I have a problem during setFields execution.

the code I have is as below.
Code:
deaultFieldsValues
(
    volScalarFieldValue alpha.water 1
    volScalarFieldValue alpha.air 0
    volVectorFieldValue U (0 0 0)
)

regions
(
  patchToFace
  {
   name inlet_water;
   fieldValues
   (
    ....
   );
  }
  patchToFace{...}
  patchToFace{...}
  
  zoneToCell
  {  
    name internal_water;
    fieldValues
    (
      volScalarFieldValue alpha.water 1
      volScalarFieldValue alpha.air 0
      volVectorFieldValue U (0 -0.5 0)
    );
  }
)
When I run setFields then I have a error message
Code:
-->  FOAM FATAL IO ERROR:

keyword name is undefined in dictionary ".zoneToCell"

file: .zoneToCell

    From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const in file db/dictionary/dictionary.C at line 566.

FOAM exiting
But when I check the Valid type by typing errata, it recommand the zoneToCell as one of the Valid type.

I guess zoneToCell is to be applied in setFields but I didn't get any idea from tutorials which use zoneToCell. They use zoneToCell in different utilit
y other than setFields.

I solved the problem with other region option, cylinderAnnulusToCell but it is little bit annoying because I have to know the coordinates.

Is there any fault that I have tried? And how can I fix it?

Thank you in advance.
dokeun is offline   Reply With Quote

Old   July 24, 2019, 14:16
Default
  #22
Member
 
Owais Shabbir
Join Date: May 2019
Posts: 48
Rep Power: 7
Owais Shabbir is on a distinguished road
Hi Dokeun,


Have you found any solution to it? I am in a similar problem right now.

Thanks
OS
Owais Shabbir is offline   Reply With Quote

Old   July 25, 2019, 00:32
Default
  #23
Member
 
Dokeun, Hwang
Join Date: Apr 2010
Location: Korea, Republic of
Posts: 98
Rep Power: 16
dokeun is on a distinguished road
Quote:
Originally Posted by Owais Shabbir View Post
Hi Dokeun,


Have you found any solution to it? I am in a similar problem right now.

Thanks
OS
Hi
You might need to check the coincidence of the name for ‘set’ in refineMeshDict file and the name in the topoSetDict.
Good luck.
dokeun is offline   Reply With Quote

Old   August 22, 2019, 16:26
Default setFields for different time step
  #24
New Member
 
Riccardo
Join Date: Jan 2016
Posts: 16
Rep Power: 10
RANSES is on a distinguished road
Hello to everybody. I'm profiting of this open thread for asking a simple question about setFields. By default, setFields is acting on the 0 folder. Do you know if you can use it also on other time-steps (i.e. time folders)?
If yes, how?
If no, do you know if there is an alternative for doing this operation?

thank you in advance.
RANSES is offline   Reply With Quote

Old   August 22, 2019, 22:03
Default
  #25
Member
 
Dokeun, Hwang
Join Date: Apr 2010
Location: Korea, Republic of
Posts: 98
Rep Power: 16
dokeun is on a distinguished road
Quote:
Originally Posted by RANSES View Post
Hello to everybody. I'm profiting of this open thread for asking a simple question about setFields. By default, setFields is acting on the 0 folder. Do you know if you can use it also on other time-steps (i.e. time folders)?
If yes, how?
If no, do you know if there is an alternative for doing this operation?

thank you in advance.
Hello, Riccardo

When I need to run OpenFOAM case for non-zero time step, there are previous data for it. No need to use setField. Just one thin to do is changing the initial time from what you want to start in ControlDict.

If you want to start a case from other data set, then you need to use mapfields.

Good luck.
dokeun is offline   Reply With Quote

Old   August 23, 2019, 05:32
Default
  #26
New Member
 
Riccardo
Join Date: Jan 2016
Posts: 16
Rep Power: 10
RANSES is on a distinguished road
Quote:
Originally Posted by dokeun View Post
Hello, Riccardo

When I need to run OpenFOAM case for non-zero time step, there are previous data for it. No need to use setField. Just one thin to do is changing the initial time from what you want to start in ControlDict.

If you want to start a case from other data set, then you need to use mapfields.

Good luck.
Hi Dokeun,

and thank you very much for your reply. The problem I'm facing is a dispersion study. I have to simulate a pollutant dispersion phenomenon starting from a converged state of the flow-field....that's why I want/need to apply setField on the concentration field in a time-step later than 0. I think I resolved this issue by copying the field I have modified with setField in the 0 folder in the one of the converged flow-field (kind of 2s). I was wondering if there was a "more elegant" way for doing this operation.
RANSES is offline   Reply With Quote

Old   August 23, 2019, 05:37
Default
  #27
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by RANSES View Post
Hi Dokeun,

and thank you very much for your reply. The problem I'm facing is a dispersion study. I have to simulate a pollutant dispersion phenomenon starting from a converged state of the flow-field....that's why I want/need to apply setField on the concentration field in a time-step later than 0. I think I resolved this issue by copying the field I have modified with setField in the 0 folder in the one of the converged flow-field (kind of 2s). I was wondering if there was a "more elegant" way for doing this operation.

I'd say "Use funkySetFields. It has a -time-option" But I'm extremely biased
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   August 23, 2019, 09:14
Default
  #28
New Member
 
Riccardo
Join Date: Jan 2016
Posts: 16
Rep Power: 10
RANSES is on a distinguished road
Quote:
Originally Posted by gschaider View Post
I'd say "Use funkySetFields. It has a -time-option" But I'm extremely biased
Thank you Bernhard, I will give a look to it.
Also, I'm having problem at defining setFields for a volVectorField (I've bee using it just for volScalarField). Do you know if setFields can be used also for vector quantities?
RANSES is offline   Reply With Quote

Old   August 26, 2019, 08:42
Default
  #29
Member
 
Dokeun, Hwang
Join Date: Apr 2010
Location: Korea, Republic of
Posts: 98
Rep Power: 16
dokeun is on a distinguished road
Quote:
Originally Posted by RANSES View Post
Hi Dokeun,

and thank you very much for your reply. The problem I'm facing is a dispersion study. I have to simulate a pollutant dispersion phenomenon starting from a converged state of the flow-field....that's why I want/need to apply setField on the concentration field in a time-step later than 0. I think I resolved this issue by copying the field I have modified with setField in the 0 folder in the one of the converged flow-field (kind of 2s). I was wondering if there was a "more elegant" way for doing this operation.
Sorry for late reply.
I’m not so sure about my opinion because I’m newbie, too.
Anyway, as I think....
You might have a solution data without particles (and BC without particle definition) already from previous calculation for improving convergence.
And the field data folder for 2s are to be stored about the same calculation domain.

Then make a new case copying previous folders and files(system, control, 2.00, mesh file)
Make a mapfieldsPar file from examples or tutorials in control folder and change initial time as 2 sec in controlDict file.
Modify SetfieldPar so as to include boundary condition for particle with previous bc.
Then, just run SetfieldsPar, mapFieldsPar, Solver.

I hope you can crack the problem.
dokeun is offline   Reply With Quote

Reply

Tags
setfields, setfieldsdict, zonetocell


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
Remeshing with User Defined Options ChristianF CFX 2 September 24, 2014 10:19
How do I select solver options for external flow over an aircraft by fluent? hadieliasi FLUENT 5 May 2, 2011 04:54
Post processing: Hard-copy save options and image quality beguxa FLUENT 3 November 10, 2010 18:41
It would be nice to have application options abbreviated! lakeat OpenFOAM Running, Solving & CFD 0 September 16, 2009 23:22
Surface tension options for VOF models chapelle FLUENT 4 September 20, 2005 04:49


All times are GMT -4. The time now is 13:55.