|
[Sponsors] |
How to create a new mapFields functionObjects? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
June 17, 2023, 06:57 |
How to create a new mapFields functionObjects?
|
#1 |
Senior Member
TWB
Join Date: Mar 2009
Posts: 402
Rep Power: 19 |
Hi,
I need to modify mapFields to create a custom mapper as mentioned here: Why are pointVectorFields not mapped using mapFields? I start off by just making a clone of mapFields, called mapFields_dynamicMesh to make sure that's it's working. I tried to follow the tutorial by Prof Nilsson, just changing the names to work on mapFields: https://www.tfd.chalmers.se/~hani/ku...tionObject.pdf The steps are: cp -r --parents src/functionObjects/field/mapFields $WM_PROJECT_USER_DIR cd $WM_PROJECT_USER_DIR/src/functionObjects/field mv mapFields mapFields_dynamicMesh cd mapFields_dynamicMesh sed -i 's/mapFields/mapFields_dynamicMesh/g' * rename 's/mapFields/mapFields_dynamicMesh/' * Make/files: Code:
mapFields_dynamicMesh/mapFields_dynamicMesh.C LIB = $(FOAM_USER_LIBBIN)/libmyFieldFunctionObjects Code:
EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteArea/lnInclude \ -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/schemes/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/fvAgglomerationMethods/pairPatchAgglomeration/lnInclude \ -I$(LIB_SRC)/phaseSystemModels/multiphaseInter/phasesSystem/lnInclude \ -I$(LIB_SRC)/phaseSystemModels/reactingEuler/multiphaseSystem/lnInclude \ -I$(LIB_SRC)/functionObjects/field/lnInclude LIB_LIBS = \ -lfiniteVolume \ -lfiniteArea \ -lfileFormats \ -lsurfMesh \ -lmeshTools \ -ldynamicMesh \ -lsampling \ -llagrangian \ -ldistributionModels \ -lfluidThermophysicalModels \ -lsolidThermo \ -lincompressibleTransportModels \ -lturbulenceModels \ -lcompressibleTransportModels \ -lincompressibleTurbulenceModels \ -lcompressibleTurbulenceModels \ -lturbulenceModelSchemes \ -lchemistryModel \ -lreactionThermophysicalModels \ -lpairPatchAgglomeration \ -lincompressibleMultiphaseSystems \ -lreactingMultiphaseSystem \ -lfieldFunctionObjects So what should I change to make it work? I think I have to do something like: EXE = $(FOAM_USER_APPBIN)/mapFields_dynamicMesh but I'm not sure how. Can someone help? Thanks! |
|
June 17, 2023, 15:20 |
|
#2 |
Member
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 93
Rep Power: 14 |
Hi there,
I didn't get completely what you want to achieve. And it seems the things you discussed are different from each other. mapFields function object refers to "Maps input fields from local mesh to secondary mesh at runtime." (@https://develop.openfoam.com/Development/openfoam/-/blob/OpenFOAM-v2212/src/functionObjects/field/mapFields/mapFields.H) and mapFields as a standalone application is a preProcessing tool which is described as "Maps volume fields from one mesh to another, reading and interpolating all fields present in the time directory of both cases" (@https://develop.openfoam.com/Development/openfoam/-/blob/OpenFOAM-v2212/applications/utilities/preProcessing/mapFields/mapFields.C). So depending on which one you need for your case you need to modify the corresponding one. If you need the function object one, you should use it like every other function object. Just as an example refer to OpenFOAM-v2212/tutorials/incompressible/pimpleFoam/laminar/cylinder2D. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mapFields major bug | alchem | OpenFOAM Bugs | 14 | September 15, 2023 12:48 |
Foam::error::PrintStack | almir | OpenFOAM Running, Solving & CFD | 91 | December 21, 2022 04:50 |
running mapFields in parallel | mkhm | OpenFOAM Pre-Processing | 10 | September 16, 2021 13:12 |
mapFields & mapFieldsPar decompose cases | otaolafr | OpenFOAM Pre-Processing | 2 | August 26, 2021 13:13 |
create the file *.foam | phongstar | OpenFOAM | 12 | October 14, 2018 18:06 |