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

mapField doesn't give correct Source and Target Time in openFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 4, 2023, 13:33
Default mapField doesn't give correct Source and Target Time in openFoam
  #1
New Member
 
Join Date: Sep 2023
Posts: 5
Rep Power: 2
maxning is on a distinguished road
I am following the openFOAM tutorial's "lid-driven cavity case" and am doing the "cavityfine" part. I have ran the original "cavity" process and got a good result, and is trying to do "2.1.5.3 Mapping the coarse mesh results onto the fine mesh" by typing the mapField Command in the terminal. I got very similar outputs as shown in the tutorial, but their source and target time are both 0.5, while mine is 0. Could you tell me what happened and how to solve it?

I am using a native-windows version of OpenFOAM-v2306.
maxning is offline   Reply With Quote

Old   October 17, 2023, 05:10
Smile
  #2
New Member
 
Alex Krochak
Join Date: May 2022
Posts: 9
Rep Power: 3
okrochak is on a distinguished road
Hello maxning,

the correct usage of mapFields, given your mesh topology is consistent is:

mapFields -sourceTime xxx ../patchToSourceCase -consistent.


Make sure that in the target directory in controlDict startTime is set equal to the sourceTime, I suspect this is the cause of your error.

If your mesh is not consistent you need to setup a mapFieldsDict file.
okrochak is offline   Reply With Quote

Old   October 28, 2023, 12:07
Default
  #3
New Member
 
Join Date: Sep 2023
Posts: 5
Rep Power: 2
maxning is on a distinguished road
Sorry, is it like I can directly copy your code, or I have to change the pathToSourceCase to something else? Also, when you say make sure startTime is equal to sourceTime, do you mean go into controlDict and change it? Like originally it is startTime startTime, and now I have to change it to startTime sourceTime?
maxning is offline   Reply With Quote

Old   October 28, 2023, 12:14
Default
  #4
New Member
 
Join Date: Sep 2023
Posts: 5
Rep Power: 2
maxning is on a distinguished road
I changed xxx to 0.5, changed patchToSourceCase to cavity in your code, and, in cavityFine, change the startTime startTime to startTime sourceTime in controlDict. But I still only get Source Time = 0.5, Target Time equal 0
maxning is offline   Reply With Quote

Old   November 1, 2023, 03:43
Default
  #5
New Member
 
Alex Krochak
Join Date: May 2022
Posts: 9
Rep Power: 3
okrochak is on a distinguished road
Quote:
Originally Posted by maxning View Post
I changed xxx to 0.5, changed patchToSourceCase to cavity in your code, and, in cavityFine, change the startTime startTime to startTime sourceTime in controlDict. But I still only get Source Time = 0.5, Target Time equal 0

Sorry for the late reply, if you don't quote my post I don't get a notification.

You need to change the pathToSource case to an actual relative path of our source directory relative to your target directory.

This way the mapFields utility know where to actually read the input mesh and field data from. Otherwise you can't expect it to know what source case you want to use.

Second, you need to specify:

startFrom startTime;

startTime 0; --< here you put timestep of the input field data you want to use. If you ran your source simulation for 10000 timesteps and your final data is in directory 10000 you put 10000 here.

Third, you need to go in your source directory and take your boundary conditions folder (usually 0 or 0.orig) and copy this folder and rename it to ''10000''.

Now you can run the command I've given previously.

mapFields utility will read your source case, and then apply it to the input case where boundary conditions are given.

I hope this helps

Alex
okrochak is offline   Reply With Quote

Reply

Tags
map fields, openfoam 2306, tutorial, windows 10

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[swak4Foam] swak4foam for OpenFOAM 4.0 mnikku OpenFOAM Community Contributions 80 May 17, 2022 08:06
Using PengRobinsonGas EoS with sprayFoam Jabo OpenFOAM Running, Solving & CFD 35 April 29, 2022 15:35
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 04:13
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 18:13
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 tlcoons OpenFOAM Installation 13 April 20, 2016 17:34


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